I’m in Sandbox, trying to remove a line item from an order. I’m following the instructions here to replace a field: Update Orders
In this example, I’m trying to remove the latte line item. However, the line items are not getting updated. The updated order line items still contain the latte.
Order I’m editing:
{
"order": {
"id": "3gEhn3Qfk5BOZIOwnzPLaWmBLTJZY",
"location_id": "LNR8WX2PQJ3QP",
"line_items": [
{
"uid": "qhEFkxeGhYfJq9YvemIiZC",
"catalog_object_id": "HIP5ITYK7EKHLNB2JXJVSYLQ",
"catalog_version": 1697214751535,
"quantity": "1",
"name": "Drip Coffee",
"variation_name": "Large",
"base_price_money": {
"amount": 450,
"currency": "USD"
},
"gross_sales_money": {
"amount": 450,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 450,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 450,
"currency": "USD"
},
"item_type": "ITEM",
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
}
},
{
"uid": "jP9Fz1vueoL7ThAhHIZf1B",
"catalog_object_id": "FG3EVAMYSIR4WEGQY5ZBO4JR",
"catalog_version": 1697214751535,
"quantity": "1",
"name": "Latte",
"variation_name": "Small, Hot",
"base_price_money": {
"amount": 480,
"currency": "USD"
},
"modifiers": [
{
"uid": "9GXxio3VS1Xi6WW1WrzM4C",
"base_price_money": {
"amount": 100,
"currency": "USD"
},
"total_price_money": {
"amount": 100,
"currency": "USD"
},
"name": "Vanilla",
"catalog_object_id": "A5A6GSTWB4EPEQ4D3SPTM3EM",
"catalog_version": 1697214751535,
"quantity": "1"
}
],
"gross_sales_money": {
"amount": 580,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 580,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 480,
"currency": "USD"
},
"item_type": "ITEM",
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
}
}
],
"fulfillments": [
{
"uid": "DvGYlNcSicPBF9PUfK4LSD",
"type": "PICKUP",
"state": "PROPOSED",
"pickup_details": {
"pickup_at": "2023-10-31T16:58:10.390Z",
"recipient": {
"customer_id": "9ZV32FSJN9EQA6JT7WNRS5CRT4",
"display_name": "(313) 599-5857",
"phone_number": "+13135995857"
}
}
}
],
"created_at": "2023-10-31T16:42:36.412Z",
"updated_at": "2023-10-31T16:43:12.185Z",
"state": "DRAFT",
"version": 2,
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_tip_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 1030,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"net_amounts": {
"total_money": {
"amount": 1030,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"tip_money": {
"amount": 0,
"currency": "USD"
},
"service_charge_money": {
"amount": 0,
"currency": "USD"
}
},
"source": {
"name": "TextJoy"
},
"customer_id": "9ZV32FSJN9EQA6JT7WNRS5CRT4",
"pricing_options": {
"auto_apply_discounts": true,
"auto_apply_taxes": true
},
"net_amount_due_money": {
"amount": 1030,
"currency": "USD"
}
}
}
Update request to remove line item:
{
"order": {
"version": 2,
"location_id": "LNR8WX2PQJ3QP",
"state": "DRAFT",
"fulfillments": [
{
"pickup_details": {
"pickup_at": "2023-10-31T16:58:51.809172"
},
"uid": "DvGYlNcSicPBF9PUfK4LSD"
}
],
"fields_to_clear": [
"line_items"
],
"line_items": [
{
"uid": "qhEFkxeGhYfJq9YvemIiZC",
"name": "Drip Coffee",
"quantity": "1",
"item_type": "ITEM",
"total_money": {
"amount": 450,
"currency": "USD"
},
"variation_name": "Large",
"catalog_version": 1697214751535,
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"base_price_money": {
"amount": 450,
"currency": "USD"
},
"catalog_object_id": "HIP5ITYK7EKHLNB2JXJVSYLQ",
"gross_sales_money": {
"amount": 450,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 450,
"currency": "USD"
}
}
]
}
}
Response:
{
"order": {
"id": "3gEhn3Qfk5BOZIOwnzPLaWmBLTJZY",
"location_id": "LNR8WX2PQJ3QP",
"line_items": [
{
"uid": "qhEFkxeGhYfJq9YvemIiZC",
"catalog_object_id": "HIP5ITYK7EKHLNB2JXJVSYLQ",
"catalog_version": 1697214751535,
"quantity": "1",
"name": "Drip Coffee",
"variation_name": "Large",
"base_price_money": {
"amount": 450,
"currency": "USD"
},
"gross_sales_money": {
"amount": 450,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 450,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 450,
"currency": "USD"
},
"item_type": "ITEM",
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
}
},
{
"uid": "jP9Fz1vueoL7ThAhHIZf1B",
"catalog_object_id": "FG3EVAMYSIR4WEGQY5ZBO4JR",
"catalog_version": 1697214751535,
"quantity": "1",
"name": "Latte",
"variation_name": "Small, Hot",
"base_price_money": {
"amount": 480,
"currency": "USD"
},
"modifiers": [
{
"uid": "9GXxio3VS1Xi6WW1WrzM4C",
"base_price_money": {
"amount": 100,
"currency": "USD"
},
"total_price_money": {
"amount": 100,
"currency": "USD"
},
"name": "Vanilla",
"catalog_object_id": "A5A6GSTWB4EPEQ4D3SPTM3EM",
"catalog_version": 1697214751535,
"quantity": "1"
}
],
"gross_sales_money": {
"amount": 580,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 580,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 480,
"currency": "USD"
},
"item_type": "ITEM",
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
}
}
],
"fulfillments": [
{
"uid": "DvGYlNcSicPBF9PUfK4LSD",
"type": "PICKUP",
"state": "PROPOSED",
"pickup_details": {
"pickup_at": "2023-10-31T16:58:51.809Z",
"recipient": {
"customer_id": "9ZV32FSJN9EQA6JT7WNRS5CRT4",
"display_name": "(313) 599-5857",
"phone_number": "+13135995857"
}
}
}
],
"created_at": "2023-10-31T16:42:36.412Z",
"updated_at": "2023-10-31T16:43:52.548Z",
"state": "DRAFT",
"version": 3,
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_tip_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 1030,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"net_amounts": {
"total_money": {
"amount": 1030,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"tip_money": {
"amount": 0,
"currency": "USD"
},
"service_charge_money": {
"amount": 0,
"currency": "USD"
}
},
"source": {
"name": "TextJoy"
},
"customer_id": "9ZV32FSJN9EQA6JT7WNRS5CRT4",
"pricing_options": {
"auto_apply_discounts": true,
"auto_apply_taxes": true
},
"net_amount_due_money": {
"amount": 1030,
"currency": "USD"
}
}
}