Intelligent search powered by OpenAI
Create payment
POST
Products that use it:
Request's parameters
HEADER
X-Idempotency-Key
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 en...View morestring
REQUIRED
X-Meli-Session-Id
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.string
BODY
wallet_payment
It indicates is a payment from a seller with a previous Wallet Connect vinculation.object
REQUIRED
payer
Payer information required to craete the payment.object
REQUIRED
binary_mode
When the payment is activated, it can only be approved or rejected. Otherwise, the payment may be pending.boolean
capture
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 de...View moreboolean
Response parameters
id
Unique ID that identifies the payment.number
payments
List of payments.array
wallet_payment
It indicates is a payment from a seller with a previous Wallet Connect vinculation.object
disbursements
array
Errors
400Bad Request
400
Missing header parameter.
500Error
500
Error
Request
curl -X POST \
'https://api.mercadopago.com/v1/advanced_payments'\
-H 'Content-Type: application/json' \
-H 'X-Idempotency-Key: 0d5020ed-1af6-469c-ae06-c3bec19954bb' \
-H 'X-Meli-Session-Id: DEVICE_ID' \
-H 'Authorization: Bearer TEST-2151*********762-03031*********750b665b7*********4dac477-1*********' \
-d '{
"wallet_payment": {
"transaction_amount": 125.98,
"description": "Payment for the purchase of furniture",
"external_reference": "Payment_seller_123",
"forward_data": {
"sub_merchant": {
"sub_merchant_id": "123123",
"mcc": "5462",
"country": "BRA",
"address_door_number": 1,
"zip": "2222222",
"document_number": "222222222222222",
"city": "SÃO PAULO",
"address_street": "RUA A",
"legal_name": "LOJINHA DO ZÉ",
"region_code_iso": "BR-MG",
"region_code": "BR",
"document_type": "CNPJ",
"phone": {},
"url": "www.nomedofacilitador.com.br"
}
},
"discount": {
"amount": 10,
"description": "DESC20",
"code": null,
"detail": {
"cap": 1000000,
"type": "percentage",
"value": 10
}
}
},
"payer": {
"token": "abcdef1e23f4567d8e9123eb6591ff68df74c57930551ed980239f4538a7e530",
"type_token": "wallet-tokens"
},
"binary_mode": false,
"capture": false
}'
Sample answer
{
"id": 10267812,
"payments": [
{
"id": 3870106238,
"status_detail": "approved_id",
"payment_method_id": "credit_card_id",
"transaction_amount": 700.5,
"installments": 1,
"description": "Payment for the purchase of furniture",
"capture": true,
"external_reference": "payment_123"
}
],
"wallet_payment": {
"transaction_amount": 125.98,
"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": "MLA",
"binary_mode": true,
"date_created": "2018-10-20T09:34:20.518-04:00",
"date_last_updated": "2018-10-20T09:34:20.518-04:00"
}