/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)
Identificador de la preferencia de pago asociado a la orden.
application_id
String
Identificador de aplicación.
site_id
String
Identificador de país al que pertenece la orden.
payer
Object
Información del comprador.
id
Integer
Identificador del comprador.
email
String(256)
Campo deprecado, responderá una cadena vacía.
nickname
String(256)
Nickname del comprador.
sponsor_id
Integer
Identificador del sponsor en Mercado Pago.
items
Array(Object)
Información de los ítems.
id
String
Identificador del ítem.
put
Requerido en PUT
category_id
String
Category del ítem.
currency_id
String(3)
Identificador de la moneda utilizada en el precio del ítem.
ARS
Peso argentino.
BRL
Real brasilero.
CLP
Peso chileno.
MXN
Peso mexicano.
COP
Peso colombiano.
PEN
Sol peruano.
UYU
Peso uruguayo.
description
String
Descripción del ítem.
picture_url
String
URL de imagen del ítem.
quantity
Integer
Cantidad de items.
put
Este es el único campo de ítem que puede ser modificado con un put put
unit_price
Float
Precio unitario del ítem.
title
String
Título del ítem.
notification_url
String(500)
URL en la que te gustaría recibir una notificación del estado del pago.
additional_info
String(600)
Información adicional del pago.
external_reference
String(256)
Referencia que puedes sincronizar con tu sistema de pagos.
marketplace
String(256)
Origen del pago. Valor predeterminado: '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 merchnat 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