Update an Order

Updating Existing Orders

PUT /api/orders/{order_id}/

To update an existing order, send a PUT request to the endpoint with the order ID in the URL.

Request Example

PUT /api/orders/98

Include the order details in the HTTP request body according to the specified Content-Type. None of the fields are required.

Change Status
Change Products
Change User Details

Change Status & Notify by Email

By default, changing an order status via the API does not send email notifications. You can use these optional notification flags:

Parameter Type Description
notify_user string Set to "1" to send notification to the customer
notify_department string Set to "1" to send notification to the order department
notify_vendor string Set to "1" to send notification to the vendor
{
  "status": "P",
  "notify_user": "1",
  "notify_department": "1",
  "notify_vendor": "1"
}

This request sets the order status to P (Processed) and sends email notifications to the customer, vendor, and order department.

Changing Products in an Order

{
  "products": {
    "1": {
      "product_id": "12",
      "amount": "1"
    },
    "3": {
      "product_id": "241",
      "amount": "1",
      "product_options": {
        "12": "44",
        "13": "48"
      }
    }
  }
}

This request changes the products assigned to the order. The original order had one product with product_id=12 and two products with product_id=13. After this update, the order will have one product with product_id=12 and one product with product_id=241.

The product with ID 241 also has option variants selected:

  • Variant 44 of option 12
  • Variant 48 of option 13
Important: When updating the products object with a PUT request, you must specify all products that should be in the order. Any products not included in the request will be removed from the order. The same applies to product option variants.

Changing User Details and Order Total

{
  "total": "100",
  "user_data": {
    "email": "customer@example.com",
    "b_firstname": "John",
    "b_lastname": "Doe",
    "s_firstname": "John",
    "s_lastname": "Doe"
  }
}

This request:

  • Changes the customer's name in both billing and shipping addresses to John Doe
  • Changes the customer's email to customer@example.com
  • Sets the order total to $100 (assuming USD is your store's primary currency)
Note: Changing these details only affects the information on the order page, not the actual user account information.
Total Priority: If you specify both total and other parameters that would affect it (like discount or subtotal_discount) in the same request, the total field will always take priority. You can specify total, but not subtotal in the same request.

Response Format

Successful Response (200 OK)

{
  "order_id": "98"
}

Response Status Codes

Status Code Description
200 OK Order updated successfully
400 Bad Request Invalid request parameters
404 Not Found Order with the specified ID does not exist