<- Orders API

Orders API

Update orderBeta

PUT

 /v2/orders/{order_id}

Updates an open order by adding, replacing, or deleting fields.

Orders with a COMPLETED or CANCELED state cannot be updated.

An UpdateOrder request requires the following:

  • The order_id in the endpoint path, identifying the order to update.
  • The latest version of the order to update.
  • The sparse order containing only the fields to update and the version to which the update is being applied.
  • If deleting fields, the dot notation paths identifying the fields to clear.

To pay for an order, see Pay for Orders.

Permissions:ORDERS_READ, ORDERS_WRITE
Try in API Explorer
Link to section

Path parameters

Example code

Link to section

order_id

string

Required

The ID of the order to update.

Link to section

Request body

Link to section

order

The sparse order containing only the fields to update and the version to which the update is being applied.

Link to section

fields_to_clear

string [ ]

Link to section

idempotency_key

string

A value you specify that uniquely identifies this update request.

If you are unsure whether a particular update was applied to an order successfully, you can reattempt it with the same idempotency key without worrying about creating duplicate updates to the order. The latest order version is returned.

For more information, see Idempotency.

Link to section

Response fields

Link to section

order

The updated order.

Link to section

errors

Any errors that occurred during the request.