Updating Order Status

Endpoint: PATCH/admin/{$order_id}/update-status

Purpose

This endpoint updates the status of a specific order. It allows businesses to modify the order processing stage, such as marking it as in progress, completed, or canceled.

Path Parameters

Field
Type
Description
order_id
integer
The unique identifier of the order

Query Parameters

This endpoint does not require any query parameters.

Use Case

A user updates the status of an order to reflect its current processing stage. This helps in order management by keeping records updated based on fulfillment status. Businesses can use this to track pending, completed, or canceled orders efficiently.

Request Body

{
    "status": "IN_PROGRESS"
}

Response

The response contains the updated order details, including order status, subtotal, tax, grand total, and payment status. It provides a customer summary, including contact and address details. The order line details include product name, quantity, price, tax, discount, and shipping eligibility. This response ensures that businesses can track orders accurately and update statuses as needed.

PATCH
https://wcapi.mywebcommander.com/api/v4/admin/order_id/update-status
Try It Out
{
    "order": {
        "order_id": ORDER_ID,
        "order_status": "ORDER_STATUS",
        "sub_total": SUB_TOTAL,
        "shipping_cost": SHIPPING_COST,
        "shipping_tax": SHIPPING_TAX,
        "handling_cost": HANDLING_COST,
        "total_surcharge": TOTAL_SURCHARGE,
        "total_discount": TOTAL_DISCOUNT,
        "total_tax": TOTAL_TAX,
        "grand_total": GRAND_TOTAL,
        "paid": PAID_AMOUNT,
        "due": DUE_AMOUNT,
        "items_total": ITEMS_TOTAL,
        "payment_status": "PAYMENT_STATUS",
        "ip_address": "IP_ADDRESS",
        "customer_summary": {
            "first_name": "CUSTOMER_FIRST_NAME",
            "last_name": "CUSTOMER_LAST_NAME",
            "customer_group": "CUSTOMER_GROUP",
            "gender": "CUSTOMER_GENDER",
            "email": "CUSTOMER_EMAIL",
            "address_line_1": "CUSTOMER_ADDRESS_LINE_1",
            "address_line_2": "CUSTOMER_ADDRESS_LINE_2",
            "city": "CUSTOMER_CITY",
            "country": {
                "id": COUNTRY_ID,
                "name": "COUNTRY_NAME",
                "code": "COUNTRY_CODE"
            },
            "state": {
                "id": STATE_ID,
                "name": "STATE_NAME",
                "code": "STATE_CODE"
            },
            "post_code": "POSTAL_CODE",
            "phone": "CUSTOMER_PHONE",
            "mobile": "CUSTOMER_MOBILE",
            "fax": "CUSTOMER_FAX",
            "company_name": "COMPANY_NAME"
        },
        "order_line_details": [
            {
                "item_id": ITEM_ID,
                "product_name": "PRODUCT_NAME",
                "product_id": PRODUCT_ID,
                "quantity": PRODUCT_QUANTITY,
                "price": PRODUCT_PRICE,
                "total_amount": TOTAL_AMOUNT,
                "tax": TAX_AMOUNT,
                "discount": DISCOUNT_AMOUNT,
                "tax_discount": TAX_DISCOUNT_AMOUNT,
                "is_taxable": IS_TAXABLE,
                "is_shippable": IS_SHIPPABLE
            }
        ]
    }
}