Home
Documentation
Resources
Certifications
Community

Resources

Check for updates on our solutions and system performance, or request technical support.

Community

Get the latest news, ask others for help and share your knowledge.

Online payments
In-person payments
Tools and resources
APIs and SDKs
Create order - QR Code - Mercado Pago Developers
Create order

POST

https://api.mercadopago.com/v1/orders
This endpoint allows to create an order for QR Code for payment transactions. In case of success, the request will return a response with status 201.
Request's 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. To ensure that eac...View more
BODY
type
string

REQUIRED

Order type, associated with the Mercado Pago solution for which it is created. For Mercado Pago's QR Code payments, the only possible value is "qr".
qr: Value associated with the creation of orders for Mercado Pago QR Code payments.
total_amount
string
Total order amount. Represents the sum of the transactions. It must be a whole number, with no decimals.
description
string
Description of the purchased product or service, the reason for the order. The maximum limit is 150 characters and it must not contain PII data.
external_reference
string

REQUIRED

It is the external reference of the order, assigned when creating it. The maximum allowed limit is 64 characters, and the allowed characters are: uppercase and lowercase letters, numbers, and the symbols hyphen (-) and u...View more
Response parameters
id
string
Identifier of the order created in the request, automatically generated by Mercado Pago.
user_id
string
ID of the Mercado Pago account that created the order.
type
string
Order type.
qr: Order created for Mercado Pago QR Code payments.
external_reference
string
External reference of the order, assigned when creating it.
Errors

400Error.

empty_required_header

The 'X-Idempotency-Key' header is required and was not sent. Make the request again including it.

unsupported_site

An attempt was made to create the order from an unsupported country. Make sure you have the necessary authorization.

unsupported_properties

An unsupported property was sent. Check the message returned in the error details to find out what the problem was and try again.

bad_request

An attempt was made to create the order with unsupported or invalid fields. Please retry sending the request, validating all fields and.

property_value

An incorrect value for some property was sent. Check the message returned in the error details to find out what the problem was and try again.

property_type

An incorrect property type was sent. Check the message returned in the error details to find out what the problem was and try again.

marketplace_not_valid

The Access Token sent as a header in the request is not one obtained through the OAuth protocol and, therefore, it is not possible to identify a valid marketplace. Please verify that you have completed the process correctly.

sponsor_id_not_valid

An invalid value was sent as the Mercado Pago account identifier (USER_ID). Check the returned message in the error details to find out what the problem was and try again.

401Error.

unauthorized

The value sent as Access Token is incorrect. Please check and try again with the correct value.

404Error.

marketplace_fee_not_allowed

The "marketplace_fee" field cannot be submitted because the marketplace could not be found. Please verify if the correct Access Token was sent and try again.

pos_not_found

The value for the "external_pos_id" field does not belong to any POS. Please confirm that you entered the correct value and try again.

409Error.

idempotency_key_already_used

The value sent as the idempotency header has already been used with a different request within the last 24 hours. Please try the request again sending a new value.

500Error.

500

Generic error. Please check the returned message and try submitting the request again.

Request
curl -X POST \
    'https://api.mercadopago.com/v1/orders'\
    -H 'Content-Type: application/json' \
       -H 'X-Idempotency-Key: 0d5020ed-1af6-469c-ae06-c3bec19954bb' \
       -H 'Authorization: Bearer TEST-7719*********832-03141*********ec9309854*********f1e54b5-1*********' \
    -d '{
  "type": "qr",
  "total_amount": "50.00",
  "description": "Point New Land",
  "external_reference": "ext_ref_1234",
  "expiration_time": "PT16M",
  "marketplace_fee": "11.22",
  "integration_data": {
    "platform_id": "dev_1234567890",
    "integrator_id": "dev_1234",
    "sponsor": {
      "id": "446566691"
    }
  },
  "config": {
    "qr": {
      "external_pos_id": "EXTERNALPOS019285",
      "mode": "static"
    }
  },
  "transactions": {
    "payments": [
      {
        "amount": "50.00"
      }
    ]
  },
  "taxes": [
    {
      "payer_condition": "payment_taxable_iva"
    }
  ],
  "items": [
    {
      "title": "Point New Land",
      "unit_price": "50.00",
      "quantity": 1,
      "unit_measure": "kg",
      "external_code": "777489134",
      "external_categories": [
        {
          "id": "device"
        }
      ]
    }
  ],
  "discounts": {
    "payment_methods": [
      {
        "new_total_amount": "47.28",
        "type": "account_money"
      }
    ]
  }
}'
Sample answer
{
  "id": "ORD00001111222233334444555566",
  "user_id": "5238400195",
  "type": "qr",
  "external_reference": "ext_ref_1234",
  "description": "Point Mini",
  "expiration_time": "PT16M",
  "processing_mode": "automatic",
  "total_amount": "50.00",
  "country_code": "CHL",
  "marketplace_fee": "11.22",
  "integration_data": {
    "application_id": "1234567890",
    "platform_id": "dev_1234567890",
    "integrator_id": "dev_1234",
    "sponsor": {
      "id": "446566691"
    }
  },
  "status": "created",
  "status_detail": "created",
  "created_date": "2024-09-10T14:26:42.109Z",
  "last_updated_date": "2024-09-10T14:27:42.109Z",
  "config": {
    "qr": {
      "external_pos_id": "EXTERNALPOS019285",
      "mode": "static"
    }
  },
  "transactions": {
    "payments": [
      {
        "id": "PAY01J67CQQH5904WDBVZEM4JMEP3",
        "amount": "50.00",
        "status": "created",
        "status_detail": "ready_to_process"
      }
    ]
  },
  "taxes": [
    {
      "payer_condition": "payment_taxable_iva"
    }
  ],
  "items": [
    {
      "title": "Point New Land",
      "unit_price": "50.00",
      "quantity": 1,
      "unit_measure": "kg",
      "external_code": "777489134",
      "external_categories": [
        {
          "id": "food"
        }
      ]
    }
  ],
  "discounts": {
    "payment_methods": [
      {
        "new_total_amount": "47.28",
        "type": "account_money"
      }
    ]
  },
  "type_response": {
    "qr_data": "00020101021243650016com.mercadolibre020130636261ba79b-e543-41c7-b71a-cec05c18e72b50120008326594305204970053030325802AR5904Test6004CABA63041094"
  }
}