Criar pagamento - Pagamentos - Mercado Pago Developers
Criar pagamento

POST

/v1/payments
Crie um pagamento e acrescente todas as informações que você precisa. Certifique-se de acrescentar os detalhes do pagamento e os detalhes do cliente.
Parâmetros de requisição
additional_info
object
Localização: bodyInformações que podem melhorar a análise de prevenção de fraude e a taxa de conversão. Trata de enviar-nos toda a informação possível
application_fee
number
Localização: bodyComissão coletadas pelo mercado ou pelo Mercado Pago
binary_mode
boolean
Localização: bodyQuando definido como TRUE, os pagamentos só podem ser aprovados ou rejeitados. Caso contrário, eles também podem resultar in_process.
callback_url
string
Localização: bodyURL para a qual o Mercado Pago faz o redirecionamento final (apenas para transferência bancária)
Parâmetros de resposta
id
number
Localização: bodyIdentificador único de pagamento, gerado automaticamente pelo Mercado Pago
date_created
string
Localização: bodyData de criação do pagamento.
date_approved
string
Localização: bodyData de aprovação do pagamento. Um pagamento pode ser gerado em um estado intermediário e depois aprovado, portanto, a data de criação nem sempre coincidirá com a Data de Aprovação.
date_last_updated
string
Localização: bodyData em que o último evento de pagamento foi registrado.
Solicitação
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": "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": {
      "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
      }
    },
    "barcode": {}
  },
  "description": "Payment for product",
  "external_reference": "MP0001",
  "installments": 1,
  "metadata": {},
  "payer": {
    "entity_type": "individual",
    "type": "customer",
    "identification": {}
  },
  "payment_method_id": "visa",
  "transaction_amount": 58.8
}'
Resposta
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"
    }
  }
}
Erros
400bad_request
11--Params Error.
33--Token must be for test.
55--Must provide your access_token to proceed.
2323--The following parameters must be valid date and format (yyyy-MM-dd'T'HH:mm:ssz) date_of_expiration.
10001000--Number of rows exceeded the limits.
10011001--Date format must be yyyy-MM-dd'T'HH:mm:ss.SSSZ.
20012001--Already posted the same request in the last minute.
20022002--Customer not found.
20042004--POST to Gateway Transactions API fail.
20062006--Card Token not found.
20072007--Connection to Card Token API fail.
20092009--Card token issuer can't be null.
20602060--The customer can't be equal to the collector.
30003000--You must provide your cardholder_name with your card data.
30013001--You must provide your cardissuer_id with your card data.
30033003--Invalid card_token_id.
30043004--Invalid parameter site_id.
30053005--Not valid action, the resource is in a state that does not allow this operation. For more information see the state that has the resource.
30063006--Invalid parameter cardtoken_id.
30073007--The parameter client_id can not be null or empty.
30083008--Not found Cardtoken.
30093009--unauthorized client_id.
30103010--Not found card on whitelist.
30113011--Not found payment_method.
30123012--Invalid parameter security_code_length.
30133013--The parameter security_code is a required field can not be null or empty.
30143014--Invalid parameter payment_method.
30153015--Invalid parameter card_number_length.
30163016--Invalid parameter card_number.
30173017--The parameter card_number_id can not be null or empty.
30183018--The parameter expiration_month can not be null or empty.
30193019--The parameter expiration_year can not be null or empty.
30203020--The parameter cardholder.name can not be null or empty.
30213021--The parameter cardholder.document.number can not be null or empty.
30223022--The parameter cardholder.document.type can not be null or empty.
30233023--The parameter cardholder.document.subtype can not be null or empty.
30243024--Not valid action - partial refund unsupported for this transaction.
30253025--Invalid Auth Code.
30263026--Invalid card_id for this payment_method_id.
30273027--Invalid payment_type_id.
30283028--Invalid payment_method_id.
30293029--Invalid card expiration month.
30303030--Invalid card expiration year.
40004000--card atributte can't be null.
40014001--payment_method_id atributte can't be null.
40024002--transaction_amount atributte can't be null.
40034003--transaction_amount atributte must be numeric.
40044004--installments atributte can't be null.
40054005--installments atributte must be numeric.
40064006--payer atributte is malformed.
40074007--site_id atributte can't be null.
40124012--payer.id atributte can't be null.
40134013--payer.type atributte can't be null.
40154015--payment_method_reference_id atributte can't be null.
40164016--payment_method_reference_id atributte must be numeric.
40174017--status atributte can't be null.
40184018--payment_id atributte can't be null.
40194019--payment_id atributte must be numeric.
40204020--notificaction_url atributte must be url valid.
40214021--notificaction_url atributte must be shorter than 500 characters.
40224022--metadata atributte must be a valid JSON.
40234023--transaction_amount atributte can't be null.
40244024--transaction_amount atributte must be numeric.
40254025--refund_id can't be null.
40264026--Invalid coupon_amount.
40274027--campaign_id atributte must be numeric.
40284028--coupon_amount atributte must be numeric.
40294029--Invalid payer type.
40374037--Invalid transaction_amount.
40384038--application_fee cannot be bigger than transaction_amount.
40394039--application_fee cannot be a negative value.
40504050--payer.email must be a valid email.
40514051--payer.email must be shorter than 254 characters.
75237523--Invalid expiration date.
403bad_request
44--The caller is not authorized to access this resource.
30023002--The caller is not authorized to perform this action.
404bad_request
20002000--Payment not found