Actualizar orden - Órdenes comerciales - Mercado Pago Developers
¿Qué estás buscando?

¿No sabes cómo empezar la integración? 

Accede a los primeros pasos
Actualizar orden

PUT

https://api.mercadopago.com/merchant_orders/{id}
Renueva los datos de un pago. Indica el ID de la orden y envía los parámetros con la información que quieras actualizar.
Parámetros para la solicitud
PATH
id
number

REQUERIDO

Identificador único de la orden generada por Mercado Pago
BODY
additional_info
string
Información adicional
application_id
string
Identificador de aplicación
external_reference
string
Identificador único que envía el vendedor para relacionar la order_id generada por Mercado Pago, con el id de su sistema de pagos
items
array
Información de los ítems
Parámetros de respuesta
id
number
Identificador único de la orden generada por Mercado Pago
status
string
Muestra el estado actual de la orden
opened: Order without payments.
closed: Order with payments covering total amount.
expired: Canceled order that does not have approved or pending payments (all rejected or returned).
external_reference
string
Identificador único que envía el vendedor para relacionar la order_id generada por Mercado Pago, con el id de su sistema de pagos
preference_id
string
Identificador de la preferencia de pago asociado a la orden
Errores

400Error

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

only the item quantity of an item can be modified.

user_not_allowed

user not allowed to operate.

invalid_payment_id

invalid payment identifier.

invalid_operation_type

invalid operation type.

invalid_payer

invalid payer identifier.

invalid_shipment_id

invalid shipment identifier.

invalid_sponsor_id

invalid sponsor_id.

invalid_marketplace

invalid marketplace.

unmarshall_error

could not unmarshal request body into merchant order struct.

invalid_format

invalid merchant order id.

invalid_url

invalid URL. Isn't HTTP or HTTPS.

communication_error

Error when calling...

401Error

invalid_token

access denied.

invalid_caller_id

invalid caller_id

Solicitud
curl -X PUT \
      'https://api.mercadopago.com/merchant_orders/{id}'\
       -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer TEST-7719*********832-03141*********ec9309854*********f1e54b5-1*********' \
       -d '{
  "application_id": "10000000000000000",
  "external_reference": "default",
  "items": [
    {
      "id": "item id",
      "category_id": "item category",
      "currency_id": "BRL",
      "description": "item description",
      "picture_url": "item picture",
      "quantity": 1,
      "unit_price": 5,
      "title": "item title"
    }
  ],
  "payer": {
    "id": 123,
    "nickname": "JOHN"
  },
  "preference_id": "Preference identification",
  "site_id": "MLA",
  "sponsor_id": null
}'
Respuesta de ejemplo
{
  "id": 9999999999,
  "status": "closed",
  "external_reference": "default",
  "preference_id": "Preference identification",
  "payments": {},
  "shipments": {},
  "payouts": {},
  "collector": {
    "id": 999999999,
    "email": "vendedor+329653108@adf12.com.br",
    "nickname": "TESTRPEHE21Q"
  },
  "marketplace": "NONE",
  "date_created": "2018-09-14T17:11:31.000Z",
  "last_updated": "2018-09-14T17:11:43.000Z",
  "shipping_cost": 0,
  "total_amount": 5,
  "site_id": "mla",
  "paid_amount": 5,
  "refunded_amount": 0,
  "payer": {
    "id": 999999999
  },
  "items": [
    {
      "id": "item id",
      "category_id": "item category",
      "currency_id": "BRL",
      "description": "item description",
      "picture_url": "item picture url",
      "title": "item title",
      "quantity": 1,
      "unit_price": 5
    }
  ],
  "cancelled": false,
  "additional_info": "additional information",
  "application_id": "10000000000000000",
  "order_status": "paid"
}