Create payment/v1/paymentsCreate a payment and add all the information you need. Remember to add the payment details and the payer's information.
POST
Products that use it:
Request's parameters
additional_info
Localization: bodyAt Payments level, it's only data, and we only forward that information to other APIs like Risk, to perform scoring and prevent fraud, or to Tax, to determine them for international payments.object
application_fee
Localization: bodyCommission (fee) that third parties (integrators) charge their customers, in this case, sellers, for using the marketplace platform and other services. This is a value in reais to be defined by the integrator to the seller.number
binary_mode
Localization: bodyWhen set to TRUE, payments can only be approved or rejected. Otherwise they can also result in_process.boolean
callback_url
Localization: bodyURL where mercadopago does the final redirect (only for bank transfers).string
Response parameters
id
Localization: bodyUnique Payment Identifier, automatically generated by Mercado Pagonumber
date_created
Localization: bodyPayment creation date.string
date_approved
Localization: bodyPayment approval date. A payment can be generated in an intermediate state and then approved, so the creation date will not always coincide with the Approval Date.string
date_last_updated
Localization: bodyDate on which the last payment event was recorded.string
Request
curl
curl -X POST \
'https://api.mercadopago.com/v1/payments' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"additional_info": {
"items": [
{
"id": "MLB2907679857",
"title": "Point Mini",
"description": "Producto Point para cobros con tarjetas mediante bluetooth",
"picture_url": "https://http2.mlstatic.com/resources/frontend/statics/growth-sellers-landings/device-mlb-point-i_medium@2x.png",
"category_id": "electronics",
"quantity": 1,
"unit_price": 58.8
}
],
"payer": {
"first_name": "Test",
"last_name": "Test",
"phone": {
"area_code": 11,
"number": "987654321"
},
"address": {}
},
"shipments": {
"receiver_address": {
"zip_code": "12312-123",
"state_name": "Rio de Janeiro",
"city_name": "Buzios",
"street_name": "Av das Nacoes Unidas",
"street_number": 3003
}
}
},
"description": "Payment for product",
"external_reference": "MP0001",
"installments": 1,
"metadata": {},
"payer": {
"entity_type": "individual",
"type": "customer",
"identification": {}
},
"payment_method_id": "visa",
"token": "ff8080814c11e237014c1ff593b57b4d",
"transaction_amount": 58.8
}'
Answer
json
{
"id": 20359978,
"date_created": "2019-07-10T14:47:58.000Z",
"date_approved": "2019-07-10T14:47:58.000Z",
"date_last_updated": "2019-07-10T14:47:58.000Z",
"money_release_date": "2019-07-24T14:47:58.000Z",
"issuer_id": 25,
"payment_method_id": "visa",
"payment_type_id": "credit_card",
"status": "approved",
"status_detail": "accredited",
"currency_id": "BRL",
"description": "Point Mini a maquininha que dá o dinheiro de suas vendas na hora.",
"taxes_amount": 0,
"shipping_amount": 0,
"collector_id": 448876418,
"payer": {
"id": 123,
"email": "test_user_80507629@testuser.com",
"identification": {
"number": 19119119100,
"type": "CPF"
},
"type": "customer"
},
"metadata": {},
"additional_info": {
"items": [
{
"id": "PR0001",
"title": "Point Mini",
"description": "Producto Point para cobros con tarjetas mediante bluetooth",
"picture_url": "https://http2.mlstatic.com/resources/frontend/statics/growth-sellers-landings/device-mlb-point-i_medium@2x.png",
"category_id": "electronics",
"quantity": 1,
"unit_price": 58.8
}
],
"payer": {
"registration_date": "2019-01-01T15:01:01.000Z"
},
"shipments": {
"receiver_address": {
"street_name": "Av das Nacoes Unidas",
"street_number": 3003,
"zip_code": 6233200,
"city_name": "Buzios",
"state_name": "Rio de Janeiro"
}
}
},
"external_reference": "MP0001",
"transaction_amount": 58.8,
"transaction_amount_refunded": 0,
"coupon_amount": 0,
"transaction_details": {
"net_received_amount": 56.16,
"total_paid_amount": 58.8,
"overpaid_amount": 0,
"installment_amount": 58.8
},
"fee_details": [
{
"type": "coupon_fee",
"amount": 2.64,
"fee_payer": "payer"
}
],
"statement_descriptor": "MercadoPago",
"installments": 1,
"card": {
"first_six_digits": 423564,
"last_four_digits": 5682,
"expiration_month": 6,
"expiration_year": 2023,
"date_created": "2019-07-10T14:47:58.000Z",
"date_last_updated": "2019-07-10T14:47:58.000Z",
"cardholder": {
"name": "APRO",
"identification": {
"number": 19119119100,
"type": "CPF"
}
}
},
"notification_url": "https://www.suaurl.com/notificacoes/",
"processing_mode": "aggregator",
"point_of_interaction": {
"type": "PIX",
"application_data": {
"name": "NAME_SDK",
"version": "VERSION_NUMBER"
},
"transaction_data": {
"qr_code_base64": "iVBORw0KGgoAAAANSUhEUgAABRQAAAUUCAYAAACu5p7oAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAIABJREFUeJzs2luO3LiWQNFmI+Y/Zd6vRt36KGNXi7ZOBtcagHD4kNLeiLX33v8DAAAAABD879sDAAAAAAA/h6AIAAAAAGSCIgAAAACQCYoAAAAAQCYoAgAAAACZoAgAAAAAZIIiAAAAAJAJigAAAABAJigCAAAAAJmgCAAAAABkgiIAAAAAkAmKAAAAAEAmKAIAAAAAmaAIAAAAAGSCIgAAAACQCYoAAAAAQCYoAgAAAACZoAgAAAAAZIIiAAAAAJAJigAAAABAJigCA...",
"qr_code": "00020126600014br.gov.bcb.pix0117test@testuser.com0217dados adicionais520400005303986540510.005802BR5913Maria Silva6008Brasilia62070503***6304E2CA",
"ticket_url": "https://www.mercadopago.com.br/payments/123456789/ticket?caller_id=123456&hash=123e4567-e89b-12d3-a456-426655440000"
}
}
}
Errors
400bad_request
1
3Token must be for test.
5Must provide your access_token to proceed.
23The following parameters must be valid date and format (yyyy-MM-dd'T'HH:mm:ssz) date_of_expiration.
1000Number of rows exceeded the limits.
1001Date format must be yyyy-MM-dd'T'HH:mm:ss.SSSZ.
2001Already posted the same request in the last minute.
2002Customer not found.
2004POST to Gateway Transactions API fail.
2006Card Token not found.
2007Connection to Card Token API fail.
2009Card token issuer can't be null.
2060The customer can't be equal to the collector.
2077Deferred capture not supported.
3000You must provide your cardholder_name with your card data.
3001You must provide your cardissuer_id with your card data.
3003Invalid card_token_id.
3004Invalid parameter site_id.
3005Not valid action, the resource is in a state that does not allow this operation. For more information see the state that has the resource.
3006Invalid parameter cardtoken_id.
3007The parameter client_id can not be null or empty.
3008Not found Cardtoken.
3009unauthorized client_id.
3010Not found card on whitelist.
3011Not found payment_method.
3012Invalid parameter security_code_length.
3013The parameter security_code is a required field can not be null or empty.
3014Invalid parameter payment_method.
3015Invalid parameter card_number_length.
3016Invalid parameter card_number.
3017The parameter card_number_id can not be null or empty.
3018The parameter expiration_month can not be null or empty.
3019The parameter expiration_year can not be null or empty.
3020The parameter cardholder.name can not be null or empty.
3021The parameter cardholder.document.number can not be null or empty.
3022The parameter cardholder.document.type can not be null or empty.
3023The parameter cardholder.document.subtype can not be null or empty.
3024Not valid action - partial refund unsupported for this transaction.
3025Invalid Auth Code.
3026Invalid card_id for this payment_method_id.
3027Invalid payment_type_id.
3028Invalid payment_method_id.
3029Invalid card expiration month.
3030Invalid card expiration year.
4000card atributte can't be null.
4001payment_method_id atributte can't be null.
4002transaction_amount atributte can't be null.
4003transaction_amount atributte must be numeric.
4004installments atributte can't be null.
4005installments atributte must be numeric.
4006payer atributte is malformed.
4007site_id atributte can't be null.
4012payer.id atributte can't be null.
4013payer.type atributte can't be null.
4015payment_method_reference_id atributte can't be null.
4016payment_method_reference_id atributte must be numeric.
4017status atributte can't be null.
4018payment_id atributte can't be null.
4019payment_id atributte must be numeric.
4020notificaction_url atributte must be url valid.
4021notificaction_url atributte must be shorter than 500 characters.
4022metadata atributte must be a valid JSON.
4023transaction_amount atributte can't be null.
4024transaction_amount atributte must be numeric.
4025refund_id can't be null.
4026Invalid coupon_amount.
4027campaign_id atributte must be numeric.
4028coupon_amount atributte must be numeric.
4029Invalid payer type.
4037Invalid transaction_amount.
4038application_fee cannot be bigger than transaction_amount.
4039application_fee cannot be a negative value.
4050payer.email must be a valid email.
4051payer.email must be shorter than 254 characters.
7523Invalid expiration date.
403bad_request
4The caller is not authorized to access this resource.
3002The caller is not authorized to perform this action.
404bad_request
2000Payment not found