Home
Documentation
Resources
Partners
Community

Resources

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

Partners

Discover our program for agencies or developers that offer integration services and sellers who want to hire them.

Community

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

Update order - Merchant Orders - Mercado Pago Developers

Intelligent search powered by OpenAI 

Update order

PUT

https://api.mercadopago.com/merchant_orders/{id}
Renew the details of a payment. Indicate the ID of the order and send the parameters with the information you want to update.
Request's parameters
PATH
id
number

REQUIRED

Unique identifier of the order generated by Mercado Pago
BODY
external_reference
string
Unique identifier sent by the seller to relate the order_id generated by Mercado Pago, with the id of their payment system
preference_id
string
Identifier of the payment preference associated to the order
marketplace
string
Indicates if it is a Mercado Libre (MELI) or Mercado Pago (NONE) Marketplace payment
notification_url
string
URL where you'd like to receive a payment notification.
Response parameters
id
number
Unique identifier of the order generated by Mercado Pago
status
string
Show the current merchant order state.
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
Unique identifier sent by the seller to relate the order_id generated by Mercado Pago, with the id of their payment system
preference_id
string
Identifier of the payment preference associated to the order
Errors

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

Request
curl -X PUT \
    'https://api.mercadopago.com/merchant_orders/{id}'\
    -H 'Content-Type: application/json' \
       -H 'Authorization: Bearer TEST-8971*********918-01191*********5874530a4*********4799fdf-1*********' \
    -d '{
  "external_reference": "default",
  "preference_id": "Preference identification",
  "sponsor_id": null,
  "payer": {
    "id": 123,
    "nickname": "JOHN"
  },
  "site_id": "MLA",
  "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"
    }
  ],
  "application_id": "10000000000000000"
}'
Sample answer
{
  "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"
}