# Init payment

Operation for the initiation of a payment using an <a href="https://docs.solidgate.com/payments/alternative-payments/" target="_blank">APMs</a>, performs order creation and prepares the transaction for payment, allowing the customer to proceed with the payment process.

Endpoint: POST /init-payment
Version: 1.0.0
Security: merchant, signature

## Header parameters:

  - `merchant` (string, required)

  - `signature` (string, required)

## Response 200 fields (application/json):

  - `order` (object)
    Details of an order, including identifiers, timestamps, amounts, status, and customer data.
Order's structure may vary depending on the alternative payment method method used.

  - `order.method` (string)

  - `transactions` (array)
    Details of transactions, including payment method, identifiers, amounts, currencies, statuses, and types.
Transaction's structure may vary depending on the alternative payment method method used.

  - `transactions.method` (string, required)
    Payment method used for the transaction.

  - `pay_form` (object)
    Payment form data.
Including fields necessary for processing the payment.

  - `pay_form.return_url` (string)
    URL for browser redirect after a payment process.

  - `pay_form.script_url` (string)
    URL of the JavaScript file required to render the APM payment form during integration, initialization, and configuration.

  - `pay_form.token` (string)
    Secure payment token representing sensitive payment method information.
Token received on the first payment, which should be used for subsequent payments.

  - `payment_type_data` (any)
    Additional data required to make payments with the specific alternative payment methods.
This object is specifically for Boleto, Multibanco (24-hour reference validity), Pix QR, Pix Automático initial mandate responses with QR payload and expiry, and UPI Intent responses with a deep link for mandate authorization.

  - `payment_type_data.amount` (number)
    Amount in the smallest currency unit supported by the alternative payment method.
Should be provided in the currency of the transaction.

  - `payment_type_data.currency` (string)
    Three-letter ISO-4217 currency code.

  - `payment_type_data.expiration_date` (string)
    Expiration date.

  - `payment_type_data.image_url` (string)
    URL of the image representing the full boleto method details.
This provides a visual reference for the user.

  - `payment_type_data.number` (string)
    Ticket number.
Long number customers enter in their bank app or website to complete the payment.

  - `payment_type_data.type` (string)
    Payment method type.
This specifies the category of the alternative payment method being used.

  - `payment_type_data.entity` (string)
    Five-digit entity code identifying the merchant for Multibanco payments.
Customers use this code together with the payment reference at an ATM or home banking.

  - `payment_type_data.reference` (string)
    Nine-digit payment reference number.
Customers enter this reference together with the entity code to complete the payment.

  - `payment_type_data.reference_expiration` (string)
    ISO 8601 datetime when the Multibanco payment reference expires.
The voucher is active for 120 hours (5 days) from issuance.

  - `payment_type_data.qr_code_value` (string)
    EMV payload for the customer to scan or copy into a Pix app.

  - `payment_type_data.qr_code_expiration_date` (string)
    Expiration datetime of the QR code.

  - `payment_type_data.qr_code_expiration_date` (string)
    Expiration datetime of the QR code, usually within one hour after issuance.

  - `payment_type_data.deep_link_value` (string)
    UPI deep link URI for mandate or payment authorization.

  - `error` (object, required)
    Error object.

  - `error.code` (string, required)
    Unauthorized access due to invalid credentials.
    Example: 1.01

  - `error.messages` (array, required)
    Array of error messages applied to the decline payment.

