Getting all Orders

Endpoints: GET /ordersGET /admin/orders

Purpose

This endpoint retrieves a list of customer orders along with their details, including status, payment, and customer information. It supports pagination and sorting through query parameters to fetch and organize orders efficiently.

Path Parameters

This endpoint does not require any path parameters.

Query Parameters

Field
Type
Description
max
integer
The maximum number of orders to return per request
offset
integer
The starting point for fetching orders (used for pagination)
order_by
string
The field by which results should be sorted (e.g., order_id, grand_total)
direction
string
The sorting direction (asc for ascending, desc for descending)

Use Case

A user retrieves a paginated list of orders with sorting and filtering options to manage transactions effectively. The endpoint provides essential order details such as totals, payment status, and customer information. Businesses can use this data to monitor order trends, track pending payments, and manage logistics

Request Body

This endpoint does not require a request body.

Response

The response contains a list of orders, each including order ID, status, total price breakdown, and payment details. It provides a customer summary, including personal information and address details. The order line details contain product-specific data, including product name, quantity, price, and tax information. This response structure helps businesses track customer purchases, payment status, and product shipping details efficiently.

GET
https://wcapi.mywebcommander.com/api/v4/orders
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders
Try It Out
{
    "orders": [
        {
            "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
                }
            ]
        }
    ]
}

Getting specific Order

Endpoint: GET /orders/{$order_id}GET/ admin/orders/{$order_id}

Purpose

This endpoint retrieves detailed information about a specific order, including order status, payment details, customer information, and purchased products. It allows businesses to track order fulfillment, payment processing, and customer details.

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 retrieves complete order details, including payment and shipping information, customer details, and purchased products. This helps businesses monitor order status, pending payments, and product shipments while improving order processing and customer service.

Request Body

This endpoint does not require a request body.

Response

The response contains a detailed breakdown of the order, 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 enables businesses to efficiently track orders, verify payments, and manage customer relations.

GET
https://wcapi.mywebcommander.com/api/v4/orders/order_id
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders/order_id
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
            }
        ]
    }
}

Getting all order count

Endpoint: GET /orders/count & GET /admin /orders/count

Purpose

This endpoint retrieves the total number of orders in the system. It helps businesses track the total order volume and monitor sales performance.

Path Parameters

This endpoint does not require any path parameters.

Query Parameters

This endpoint does not require any path parameters.

Use Case

A user retrieves the total number of orders placed in the system. This information is useful for generating sales reports, tracking order trends, and monitoring business growth.

Request Body

This endpoint does not require a request body.

Response 

The response contains the total count of orders placed in the system. This value represents the total number of orders processed, helping businesses analyze their transaction volume.

GET
https://wcapi.mywebcommander.com/api/v4/orders/count
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders/count
Try It Out
{
    "order_count": ORDER_COUNT
}

Getting Order comments

Endpoint: GET /orders/{$order_id}/commentsGET/admin /orders/{$order_id}/comments

Purpose

This endpoint retrieves comments associated with a specific order. These comments can be used for internal tracking or customer communication, helping businesses manage order updates and processing notes.

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 retrieves all comments related to an order to track updates, internal notes, or customer communications. This helps businesses ensure clear order tracking and transparency for both staff and customers.

Request Body

This endpoint does not require a request body.

Response

The response contains a list of comments associated with the order, including content, the admin who posted it, visibility settings, and timestamp. Admin comments may be marked as internal (not visible to customers) or customer-facing for communication updates.

GET
https://wcapi.mywebcommander.com/api/v4/orders/order_id/comments
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders/order_id/comments
Try It Out
{
    "comments": [
        {
            "id": COMMENT_ID,
            "content": "COMMENT_CONTENT",
            "admin_name": "ADMIN_NAME",
            "is_visible_to_customer": true,
            "is_admin": true,
            "created": "CREATED_TIMESTAMP"
        }
    ]
}

Getting specific Order Shipment

Endpoint: GET /orders/{$order_id}/shipmentsGET/admin /orders/{$order_id}/shipments

Purpose

This endpoint retrieves shipment details associated with a specific order, including tracking information, shipping method, shipping and billing addresses, and shipped items. It helps businesses track order fulfillment and delivery progress.

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 retrieves shipment details for an order to monitor delivery progress. This helps businesses and customers track shipping status, verify shipment addresses, and confirm shipped items.

Request Body

This endpoint does not require a request body.

Response 

The response contains shipment details, including tracking number, shipping method, and creation date. It provides shipping and billing addresses associated with the order. Additionally, the response includes a list of shipped items, their quantities, and total amount, ensuring businesses can track shipped products and delivery progress.

GET
https://wcapi.mywebcommander.com/api/v4/orders/order_id/shipments
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders/order_id/shipments
Try It Out
{
    "shipments": [
        {
            "shipping_id": SHIPPING_ID,
            "order_id": ORDER_ID,
            "customer_id": CUSTOMER_ID,
            "order_address_id": ORDER_ADDRESS_ID,
            "date_created": "CREATION_DATE",
            "tracking_number": "TRACKING_NUMBER",
            "shipping_method": "SHIPPING_METHOD",
            "shipping_address": {
                "id": SHIPPING_ADDRESS_ID,
                "first_name": "SHIPPING_FIRST_NAME",
                "last_name": "SHIPPING_LAST_NAME",
                "email": "SHIPPING_EMAIL",
                "company_name": "SHIPPING_COMPANY",
                "address_line_1": "SHIPPING_ADDRESS_LINE_1",
                "address_line_2": "SHIPPING_ADDRESS_LINE_2",
                "country": {
                    "id": COUNTRY_ID,
                    "name": "COUNTRY_NAME",
                    "code": "COUNTRY_CODE"
                },
                "state": {
                    "id": STATE_ID,
                    "name": "STATE_NAME",
                    "code": "STATE_CODE"
                },
                "city": "CITY",
                "post_code": "POSTAL_CODE",
                "mobile": "MOBILE",
                "phone": "PHONE",
                "fax": "FAX"
            },
            "billing_address": {
                "id": BILLING_ADDRESS_ID,
                "first_name": "BILLING_FIRST_NAME",
                "last_name": "BILLING_LAST_NAME",
                "email": "BILLING_EMAIL",
                "company_name": "BILLING_COMPANY",
                "address_line_1": "BILLING_ADDRESS_LINE_1",
                "address_line_2": "BILLING_ADDRESS_LINE_2",
                "country": {
                    "id": COUNTRY_ID,
                    "name": "COUNTRY_NAME",
                    "code": "COUNTRY_CODE"
                },
                "state": {
                    "id": STATE_ID,
                    "name": "STATE_NAME",
                    "code": "STATE_CODE"
                },
                "city": "CITY",
                "post_code": "POSTAL_CODE",
                "mobile": "MOBILE",
                "phone": "PHONE",
                "fax": "FAX"
            },
            "items": [
                {
                    "order_item_id": ORDER_ITEM_ID,
                    "product_id": PRODUCT_ID,
                    "product_name": "PRODUCT_NAME",
                    "product_sku": "PRODUCT_SKU",
                    "shipping_class": "SHIPPING_CLASS",
                    "order_quantity": ORDER_QUANTITY,
                    "shipped_quantity": SHIPPED_QUANTITY,
                    "total_amount": TOTAL_AMOUNT
                }
            ]
        }
    ]
}

Getting shipment status of an Order

Endpoint:  GET /orders/{$order_id}/shipment-statusGET/admin/orders/{$order_id}/shipment-status

Purpose

This endpoint retrieves the shipment status of a specific order, including current shipment state, tracking information, and last updated details. It helps businesses and customers track order fulfillment and delivery progress.

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 retrieves the current shipment status of an order to monitor delivery progress. This helps businesses and customers stay informed about order fulfillment, estimated delivery timelines, and tracking details for shipments.

Request Body

This endpoint does not require a request body.

Response 

The response contains order shipment status, indicating whether the order is pending, shipped, or delivered. It includes shipment provider details, tracking number, and the last update timestamp, ensuring accurate tracking and visibility of delivery status.

GET
https://wcapi.mywebcommander.com/api/v4 /orders/order_id/shipment-status
Try It Out
GET
https://wcapi.mywebcommander.com/api/v4/admin/orders/order_id/shipment-status
Try It Out
{
    "order_id": ORDER_ID,
    "shipment_status": "SHIPMENT_STATUS",
    "shipments_info": [
        {
            "shipping_provider": "SHIPPING_PROVIDER",
            "tracking_number": "TRACKING_NUMBER",
            "last_updated": "LAST_UPDATED_TIMESTAMP"
        }
    ]
}