# Create payment Specific payments for Wallet Connect. During the agreement process, the integrator receives a "payer token" from the payer. This token allows the integrator to execute the payment directly from the payer's wallet. If you wish to apply discounts, it is necessary to first create a discount promise before using them. **POST** `/v1/advanced_payments` ## Request parameters ### Header - `X-Idempotency-Key` (string, required) This feature allows you to safely retry requests without the risk of accidentally performing the same action more than once. This is useful for avoiding errors, such as creating two identical payments, for example. To ensure that each request is unique, it's important to use an exclusive value in the header of your request. We suggest using a UUID V4 or random strings. - `X-Meli-Session-Id` (string, optional) The Device ID is an important piece of information to ensure better security and, consequently, a better payment approval rate. It's a unique number that's used to identify a customer's device when they are buying. - `wallet_payment` (object, optional) It indicates is a payment from a seller with a previous Wallet Connect vinculation. - `wallet_payment.transaction_amount` (number, optional) Payment amount. - `wallet_payment.description` (string, optional) A brief description of the payment. - `wallet_payment.external_reference` (string, optional) An string to allow identification of payment in case of an issue. - `wallet_payment.statement_descriptor` (string, optional) Description that appears on the cardholder's bank statement along with the amount and date of the charge. This parameter accepts a maximum of 50 alphanumeric characters. - `wallet_payment.forward_data` (object, optional) Information that payment facilitators must send mandatorily to identify the sub-merchants during the transaction. The sending of this parameter and its attributes is only required for transactions carried out in Brazil (MLB). - `wallet_payment.forward_data.sub_merchant` (object, optional) Mandatory data related to the su-merchant. They are used by Payment facilitators to identify submerchants at the time of the transaction. - `wallet_payment.forward_data.sub_merchant.sub_merchant_id` (number, optional) Submerchant code. - `wallet_payment.forward_data.sub_merchant.mcc` (string, optional) Submerchant MCC (Merchant Code Category) according to Abecs (Associação Brasileira das Empresas de Cartões de Crédito e Serviços) decision and/or primary CNAE. - `wallet_payment.forward_data.sub_merchant.country` (string, optional) Country where the submerchant is located. - `wallet_payment.forward_data.sub_merchant.address_door_number` (number, optional) Street number where the submerchant is located. - `wallet_payment.forward_data.sub_merchant.zip` (string, optional) CEP of the submerchant. - `wallet_payment.forward_data.sub_merchant.document_number` (string, optional) CPF or CNPJ identification of the submerchant. - `wallet_payment.forward_data.sub_merchant.city` (string, optional) City where the submerchant is located. - `wallet_payment.forward_data.sub_merchant.address_street` (string, optional) Street where the submerchant is located. - `wallet_payment.forward_data.sub_merchant.legal_name` (string, optional) Name of the submerchant. - `wallet_payment.forward_data.sub_merchant.region_code_iso` (string, optional) State where the submerchant is located. - `wallet_payment.forward_data.sub_merchant.region_code` (string, optional) Postal code of the submerchant. - `wallet_payment.forward_data.sub_merchant.document_type` (string, optional) CPF or CNPJ number of the submerchant. - `wallet_payment.forward_data.sub_merchant.phone` (object, optional) Phone number of the submerchant. - `wallet_payment.forward_data.sub_merchant.url` (string, optional) Payment facilitator URL. A Payment facilitator is an entity that provides payment solutions for end customers (submerchants) to sell their products and/or services. They are responsible for capturing, processing, and settling transactions directly to their submerchants, becoming creditors of the acquirer. - `wallet_payment.discount` (object, optional) Information of the discount to be used in payment. - `wallet_payment.discount.amount` (number, optional) Discounted amount from the total payment amount - `wallet_payment.discount.description` (string, optional) Description of discount to be aplied. - `wallet_payment.discount.code` (number, optional) Unique ID that identifies coupon used for discount. This field must be only sent when the user fulfilled the coupon field in the seller flow. - `wallet_payment.discount.detail` (object, optional) Discount information details. - `wallet_payment.discount.detail.cap` (number, optional) Discount cap. This parameter is used to limit the maximum amount to be deducted from the payment. - `wallet_payment.discount.detail.type` (string, optional) Type of discount applied. - `wallet_payment.discount.detail.value` (number, optional) Value of discount based on its type. - `payer` (object, optional) Payer information required to craete the payment. - `payer.token` (string, optional) The payer token is a code used by the integrator to make payments from the payer's wallet. - `payer.type_token` (string, optional) The token type. - `binary_mode` (boolean, optional) When the payment is activated, it can only be approved or rejected. Otherwise, the payment may be pending. - `capture` (boolean, optional) It is a boolean field found in two-step payments (like debit card). In this type of payment, which is carried out asynchronously, the purchase value is first reserved (capture = false). This amount is captured and not debited from the account instantly. When the money is actually transferred to the collector (who receives the payment) the amount is captured (capture = true). ## Response parameters - `id` (number, optional) Unique ID that identifies the payment. - `payments` (array, optional) List of payments. - `payments[].id` (number, optional) Unique payment ID. - `payments[].status` (string, optional) The status of a payment made by Advanced Payments internal-api.mercadopago.com Possible enum values: - `approved` approved - `in_process` in process - `payments[].status_detail` (string, optional) Status description. - `payments[].payment_type_id` (string, optional) O tipo de pagamento preferencial do pagador. Possible enum values: - `credit_card` credit card - `debit_card` debit card - `account_money` account money - `payments[].payment_method_id` (string, optional) Method used in payment type. - `payments[].transaction_amount` (number, optional) The payment amount. - `payments[].installments` (number, optional) Total installment for the payment. - `payments[].description` (string, optional) Purchased product’s description, the reason for payment. - `payments[].capture` (boolean, optional) It is a boolean field found in two-step payments (like debit card). In this type of payment, which is carried out asynchronously, the purchase value is first reserved (capture = false). This amount is captured and not debited from the account instantly. When the money is actually transferred to the collector (who receives the payment) the amount is captured (capture = true). - `payments[].external_reference` (string, optional) This is a custom seller identifier, used in case to match a request between seller and Mercado Pago. - `wallet_payment` (object, optional) It indicates is a payment from a seller with a previous Wallet Connect vinculation. - `wallet_payment.transaction_amount` (number, optional) Payment amount. - `wallet_payment.description` (string, optional) A brief description of the payment. - `wallet_payment.external_reference` (string, optional) An string to allow identification of payment in case of an issue. - `wallet_payment.discount` (object, optional) Information of the discount to be used in payment. - `wallet_payment.discount.amount` (number, optional) Discounted amount from the total payment amount - `wallet_payment.discount.code` (number, optional) Unique ID that identifies coupon used for discount. - `disbursements` (array, optional) - `disbursements[].collector_id` (string, optional) Merchant Mercado Pago account id. - `payer` (object, optional) - `payer.id` (number, optional) The payment identifier. - `site_id` (string, optional) Country of origin of the Mercado Pago account. - `binary_mode` (boolean, optional) When the payment is activated, it can only be approved or rejected. Otherwise, the payment may be pending. - `date_created` (string, optional) Payment creation date. - `date_last_updated` (string, optional) Payment last update date. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | 400 | Missing header parameter. | | 500 | 500 | Error | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v1/advanced_payments' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "wallet_payment": { "transaction_amount": "24.50", "description": "Payment for the purchase of furniture", "external_reference": "Payment_seller_123", "statement_descriptor": "descriptor", "forward_data": { "sub_merchant": { "sub_merchant_id": "123123", "mcc": "5462", "country": "CO", "address_door_number": "93-09", "zip": "110221", "document_number": "222222222222222", "city": "Bogotá", "address_street": "RUA A", "legal_name": "LOJINHA DO ZÉ", "region_code_iso": "BR-MG", "region_code": "BR", "document_type": "NIT", "phone": "300-1234567", "url": "www.nomedofacilitador.com.br" } }, "discount": { "amount": 10, "description": "DESC20", "code": "WALLET10", "detail": { "cap": 1000000, "type": "percentage", "value": 10 } } }, "payer": { "token": "abcdef1e23f4567d8e9123eb6591ff68df74c57930551ed980239f4538a7e530", "type_token": "wallet-tokens" }, "binary_mode": false, "capture": true }' ``` ## Response example ```json { "id": 10267812, "payments": [ { "id": 3870106238, "status": "approved", "status_detail": "approved_id", "payment_type_id": "credit_card", "payment_method_id": "credit_card", "transaction_amount": "24.50", "installments": 1, "description": "Payment for the purchase of furniture", "capture": true, "external_reference": "payment_123" } ], "wallet_payment": { "transaction_amount": "24.50", "description": "payment of a bussines trip", "external_reference": "Payment_seller_123", "discount": { "amount": 10, "code": "WALLET10" } }, "disbursements": [ { "collector_id": "collectorId" } ], "payer": { "id": 8879 }, "site_id": "MCO", "binary_mode": true, "date_created": "2018-10-20T09:34:20.518-04:00", "date_last_updated": "2018-10-20T09:34:20.518-04:00" } ```