Skip to main content
PATCH
{micro_service_base_url}
/
orders
/
{order_id}
/
patch-order
{
  "id": "<string>",
  "original_subtotal": "<string>",
  "tax_amount": "<string>",
  "original_price": "<string>",
  "partner": "<string>",
  "special_instructions": "<string>",
  "customer": {},
  "fulfillments": [
    {
      "fulfillmentsLogs": [
        {
          "date_created": "<string>",
          "description": "<string>",
          "order_status_title": "<string>",
          "employee": {}
        }
      ]
    }
  ],
  "orderItems": [
    {}
  ]
}
This endpoint allows you to modify order contents after the order has been created but before it’s completed. You can remove items, reduce quantities, add new items, or update existing items. This is useful for handling out-of-stock situations, customer requests, or inventory adjustments.
Order modifications should only be made with customer approval and may affect the final order price. Always communicate changes to the customer.

Path Parameters

order_id
string
required
The unique identifier of the order to modify

Request Body

The request body should be an array of action objects, each specifying a modification to perform:
action_type
string
required
Type of modification: “remove_item”, “reduce_quantity”, “add_item”, “update_item”
order_item_id
string
required
The unique identifier of the order item to modify (required for remove_item, reduce_quantity, update_item)
quantity
integer
New quantity for the item (required for reduce_quantity and add_item actions)
item_id
string
Product identifier (required for add_item actions)
special_instructions
string
Updated special instructions for the item

Response

id
string
Updated order identifier
original_subtotal
string
Updated order subtotal after modifications
tax_amount
string
Recalculated tax amount
original_price
string
Updated original price
partner
string
Delivery platform name
special_instructions
string
Order-level special instructions
customer
object
Customer information remains unchanged
fulfillments
array
Updated fulfillment information with modification logs
orderItems
array
Updated array of order items after modifications

Request Example

[
  {
    "action_type": "remove_item",
    "order_item_id": "35bf2e22-a70f-4dda-9de0-eb92ee581d4a"
  },
  {
    "action_type": "reduce_quantity",
    "order_item_id": "3133710b-6d3e-4533-8d67-26c7a4a93e29",
    "quantity": 2
  }
]

Response Example

{
  "id": "a8e2c9ee-0bbd-4e86-ab2c-40e94297b3bd",
  "original_subtotal": "-35.26",
  "is_auto_accepted": false,
  "order_id": null,
  "tax_amount": "NaN",
  "discount": null,
  "original_price": null,
  "createdAt": "2024-07-04T12:06:57.740Z",
  "partner": "DoorDash",
  "special_instructions": "Cancel the order if the first item is not Present",
  "exclude_allergens_items": "",
  "is_include_disposables": false,
  "store_id": "449235c1-3d04-4519-998b-40d2a621e5e0",
  "dsp_order_number": "",
  "custom_fee": null,
  "tax_remitted": "NaN",
  "customer": {
    "customer_name": "Lula D.",
    "contact_phone": "+1 312-766-6835",
    "phone_code": null
  },
  "fulfillments": [
    {
      "quantity": null,
      "date_ready": null,
      "createdAt": "2024-07-04T12:06:57.756Z",
      "estimated_date_delivered": "2024-07-04T12:17:14.540Z",
      "id": "2f71af29-e115-42f1-839f-1137efa73c8a",
      "store_id": "449235c1-3d04-4519-998b-40d2a621e5e0",
      "fulfillmentStatus": {
        "delivery_status_name": "waiting"
      },
      "fulfillmentsLogs": [
        {
          "date_created": "2024-07-04T12:06:57.758Z",
          "description": "DoorDash store mock order received",
          "order_status_title": "Order received",
          "fulfillments_id": "2f71af29-e115-42f1-839f-1137efa73c8a",
          "employee": null
        },
        {
          "date_created": "2024-07-04T12:07:14.577Z",
          "description": "",
          "order_status_title": "Bagging order",
          "fulfillments_id": "2f71af29-e115-42f1-839f-1137efa73c8a",
          "employee": {
            "id": "f78c06a0-8a0f-4d0b-a5d1-d7d2b0ffde70",
            "first_name": "Salman",
            "last_name": "Saeed Paul"
          }
        },
        {
          "date_created": "2024-07-04T12:07:56.205Z",
          "description": "Removing [1] 'Cheetos Flamin' Hot Cheese Flavored Snacks'.",
          "order_status_title": "Item quantity edited",
          "fulfillments_id": "2f71af29-e115-42f1-839f-1137efa73c8a",
          "employee": {
            "id": "f78c06a0-8a0f-4d0b-a5d1-d7d2b0ffde70",
            "first_name": "Salman",
            "last_name": "Saeed Paul"
          }
        }
      ]
    }
  ],
  "orderItems": []
}
remove_item
  • Completely removes an item from the order
  • Requires: order_item_id
  • Use when item is out of stock or customer requests removal
reduce_quantity
  • Reduces the quantity of an existing item
  • Requires: order_item_id, quantity (new quantity, not amount to reduce)
  • Use for partial availability or customer quantity changes
add_item
  • Adds a new item to the order
  • Requires: item_id, quantity
  • Optional: special_instructions
  • Use for customer additions or substitutions
update_item
  • Updates item details without changing quantity
  • Requires: order_item_id
  • Optional: special_instructions, item modifications
  • Use for customization changes
Price Recalculation: The system automatically recalculates taxes, fees, and total price after modifications. Negative subtotals in the response indicate cost reductions.
Best Practice: Always batch multiple modifications into a single request to avoid multiple price recalculations and to maintain order consistency.

Error Responses

Invalid Order Item
{
  "error": "Order item not found",
  "order_item_id": "invalid-id"
}
Order Not Modifiable
{
  "error": "Order cannot be modified in current status",
  "current_status": "completed"
}
Invalid Quantity
{
  "error": "Quantity must be greater than 0",
  "provided_quantity": 0
}
Status Restrictions: Orders can only be modified in certain statuses (pending, accepted, in_progress). Completed, canceled, or delivered orders cannot be modified.

Use Cases

Out of Stock Items
  • Remove unavailable items
  • Reduce quantities for partial availability
  • Add substitute items with customer approval
Customer Requests
  • Add items to existing order
  • Remove items customer no longer wants
  • Modify special instructions
Inventory Adjustments
  • Reduce quantities when stock is lower than expected
  • Remove items due to quality issues
  • Update item specifications
Price Corrections
  • Adjust item quantities for pricing corrections
  • Remove incorrectly priced items
  • Add corrected items
I