/merchant_orders
BASE URI https://api.mercadopago.com/merchant_orders
HTTP Request
curl
curl -X POST \
'https://api.mercadopago.com/merchant_orders' \
-H 'Authorization: Bearer ACCESS_TOKEN_ENV' \
-d '{
"preference_id": "preference_id",
"items": [
{
"id": "item_id",
"category_id": "category_id",
"currency_id": "[FAKER][CURRENCY][ACRONYM]",
"description": "item description",
"picture_url": "picture_url",
"title": "item title",
"quantity": 1,
"unit_price": 5
}
],
"marketplace": "",
"external_reference": "default",
"additional_info": "additional information"
}'
Request Params
ParameterTypeDescription
preference_id
String(UUID)
Payment preference identifier associated to the merchant order.
application_id
String
application identifier.
site_id
String
Country identifier that merchant order belongs to.
payer
Object
Buyer Information.
id
Integer
Buyer id.
email
String(256)
Deprecated field, will return an empty string.
nickname
String(256)
Buyer nickname.
sponsor_id
Integer
Sponsor ID in Mercado Pago.
items
Array(Object)
items information.
id
String
Item id.
put
Required in PUT
category_id
String
Item category.
currency_id
String(3)
ID of the currency used in the item price.
ARS
Argentine peso.
BRL
Brasil real.
CLP
Chilean peso.
MXN
Mexican peso.
COP
Colombian peso.
PEN
Peruvian sol.
UYU
Uruguayan peso.
description
String
Item description.
picture_url
String
Item picture URL.
quantity
Integer
Item quantity.
put
This is the only field of item that can be modified in put
unit_price
Float
Item unit price.
title
String
Item title.
notification_url
String(500)
URL where you'd like to receive a payment notification.
additional_info
String(600)
Additional information.
external_reference
String(256)
Reference you can synchronize with your payment system.
marketplace
String(256)
Origin of the payment. Default value: 'NONE'
HTTP Response
json
{
"id": 9999999999,
"status": "closed",
"external_reference": "default",
"preference_id": "Preference identification",
"payments": [],
"shipments": [],
"collector": {
"id": 999999999,
"nickname": null
},
"marketplace": "NONE",
"notification_url": null,
"date_created": "2018-09-14T13:11:31.000-04:00",
"last_updated": "2018-09-14T13:11:43.000-04:00",
"sponsor_id": null,
"shipping_cost": 0,
"total_amount": 5,
"site_id": "[FAKER][GLOBALIZE][SITE_ID]",
"paid_amount": 5,
"refunded_amount": 0,
"payer": {
"id": 999999999,
"email": ""
},
"items": [
{
"id": "item id",
"category_id": "item category",
"currency_id": "[FAKER][CURRENCY][ACRONYM]",
"description": "item description",
"picture_url": "item picture url",
"title": "item title",
"quantity": 1,
"unit_price": 5
}
],
"cancelled": false,
"additional_info": "additional information",
"application_id": 9999999999999999,
"order_status": "payment_required"
}
Error Codes
CodeDescription
400 BAD_REQUEST
invalid_user_id
invalid users involved.
invalid_order_state
the action requested is not valid for the current merchant order state.
invalid_string
string too long.
invalid_application_id
internal server error.
invalid_items
title cannot be null for the given item.
invalid_items
quantity cannot be null for the given item.
invalid_items
invalid item quantity.
invalid_items
unit_price cannot be null for the given item.
invalid_items
currency_id cannot be null for the given item.
invalid_items
cannot operate with this currency code.
invalid_items
invalid unit_price.
user_not_allowed
user not allowed to operate.
invalid_operation_type
invalid operation type.
invalid_payer
invalid payer identifier.
invalid_id
invalid preference_id.
invalid_expired
the preference_id has expired.
invalid_sponsor_id
invalid sponsor_id.
invalid_marketplace
invalid marketplace.
unmarshal_error
could not unmarshal request body into merchant order struct.
invalid_url
invalid URL. Isn't HTTP or HTTPS.
communication_error
Error when calling...
401 UNAUTHORIZED
invalid_token
access denied.
invalid_caller_id
invalid caller_id