Orders
UpdateOrder
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.
put/v2/orders/{order_id}
Path parameters
order_idstring required
The ID of the order to update.
Request body
Example request
{
"fields_to_clear": [
"discounts"
],
"idempotency_key": "UNIQUE_STRING",
"order": {
"line_items": [
{
"base_price_money": {
"amount": 200,
"currency": "USD"
},
"name": "COOKIE",
"quantity": "2",
"uid": "cookie_uid"
}
],
"version": 1
}
}Response
Success
Example response
{
"order": {
"created_at": "2019-08-23T18:26:18.243Z",
"id": "DREk7wJcyXNHqULq8JJ2iPAsluJZY",
"line_items": [
{
"base_price_money": {
"amount": 500,
"currency": "USD"
},
"gross_sales_money": {
"amount": 500,
"currency": "USD"
},
"name": "Small Coffee",
"quantity": "1",
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 500,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"uid": "EuYkakhmu3ksHIds5Hiot",
"variation_total_price_money": {
"amount": 500,
"currency": "USD"
}
},
{
"base_price_money": {
"amount": 200,
"currency": "USD"
},
"gross_sales_money": {
"amount": 400,
"currency": "USD"
},
"name": "COOKIE",
"quantity": "2",
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 400,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"uid": "cookie_uid",
"variation_total_price_money": {
"amount": 400,
"currency": "USD"
}
}
],
"location_id": "MXVQSVNDGN3C8",
"net_amounts": {
"discount_money": {
"amount": 0,
"currency": "USD"
},
"service_charge_money": {
"amount": 0,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 900,
"currency": "USD"
}
},
"source": {
"name": "Cookies"
},
"state": "OPEN",
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 900,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"updated_at": "2019-08-23T18:33:47.523Z",
"version": 2
}
}