{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/woocommerce/refs/heads/main/json-schema/woocommerce-rest-api-order-schema.json", "title": "Order", "description": "A WooCommerce customer order.", "type": "object", "properties": { "id": { "type": "integer", "description": "Order unique identifier.", "example": 1 }, "parent_id": { "type": "integer", "description": "Parent order ID (for order refunds and child orders).", "example": 1 }, "number": { "type": "string", "description": "Order number displayed to customers.", "example": "string-value" }, "order_key": { "type": "string", "description": "Order key used to verify order ownership.", "example": "string-value" }, "status": { "type": "string", "description": "Order status. Options: pending, processing, on-hold, completed, cancelled, refunded, failed, trash.", "enum": [ "pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed", "trash" ], "example": "pending" }, "currency": { "type": "string", "description": "ISO 4217 currency code used for the order.", "example": "string-value" }, "date_created": { "type": "string", "format": "date-time", "description": "Date the order was created.", "example": "2026-05-03T14:30:00Z" }, "date_modified": { "type": "string", "format": "date-time", "description": "Date the order was last modified.", "example": "2026-05-03T14:30:00Z" }, "date_completed": { "type": "string", "format": "date-time", "description": "Date the order was marked as completed.", "nullable": true, "example": "2026-05-03T14:30:00Z" }, "discount_total": { "type": "string", "description": "Total discount applied to the order as a decimal string.", "example": "string-value" }, "discount_tax": { "type": "string", "description": "Total discount tax as a decimal string.", "example": "string-value" }, "shipping_total": { "type": "string", "description": "Total shipping cost as a decimal string.", "example": "string-value" }, "shipping_tax": { "type": "string", "description": "Total shipping tax as a decimal string.", "example": "string-value" }, "cart_tax": { "type": "string", "description": "Total cart item taxes as a decimal string.", "example": "string-value" }, "total": { "type": "string", "description": "Grand total as a decimal string.", "example": "string-value" }, "total_tax": { "type": "string", "description": "Total tax as a decimal string.", "example": "string-value" }, "customer_id": { "type": "integer", "description": "Customer ID (0 for guest orders).", "example": 1 }, "customer_note": { "type": "string", "description": "Note left by the customer at checkout.", "example": "string-value" }, "billing": { "type": "object", "description": "Billing or shipping address associated with a customer or order.", "properties": { "first_name": { "type": "string", "description": "First name.", "example": "Example Name" }, "last_name": { "type": "string", "description": "Last name.", "example": "Example Name" }, "company": { "type": "string", "description": "Company name.", "example": "string-value" }, "address_1": { "type": "string", "description": "Address line 1.", "example": "string-value" }, "address_2": { "type": "string", "description": "Address line 2.", "example": "string-value" }, "city": { "type": "string", "description": "City name.", "example": "string-value" }, "state": { "type": "string", "description": "ISO code or name of the state, province, or district.", "example": "string-value" }, "postcode": { "type": "string", "description": "Postal code.", "example": "string-value" }, "country": { "type": "string", "description": "ISO 3166-1 alpha-2 country code.", "example": "string-value" }, "email": { "type": "string", "format": "email", "description": "Email address (billing only).", "example": "user@example.com" }, "phone": { "type": "string", "description": "Phone number (billing only).", "example": "string-value" } } }, "shipping": { "type": "object", "description": "Billing or shipping address associated with a customer or order.", "properties": { "first_name": { "type": "string", "description": "First name.", "example": "Example Name" }, "last_name": { "type": "string", "description": "Last name.", "example": "Example Name" }, "company": { "type": "string", "description": "Company name.", "example": "string-value" }, "address_1": { "type": "string", "description": "Address line 1.", "example": "string-value" }, "address_2": { "type": "string", "description": "Address line 2.", "example": "string-value" }, "city": { "type": "string", "description": "City name.", "example": "string-value" }, "state": { "type": "string", "description": "ISO code or name of the state, province, or district.", "example": "string-value" }, "postcode": { "type": "string", "description": "Postal code.", "example": "string-value" }, "country": { "type": "string", "description": "ISO 3166-1 alpha-2 country code.", "example": "string-value" }, "email": { "type": "string", "format": "email", "description": "Email address (billing only).", "example": "user@example.com" }, "phone": { "type": "string", "description": "Phone number (billing only).", "example": "string-value" } } }, "payment_method": { "type": "string", "description": "Payment method ID (e.g. stripe, paypal).", "example": "string-value" }, "payment_method_title": { "type": "string", "description": "Human-readable payment method name.", "example": "Example Name" }, "transaction_id": { "type": "string", "description": "Payment gateway transaction ID.", "example": "500123" }, "line_items": { "type": "array", "description": "Line items in the order.", "items": { "type": "object", "description": "A product line item within an order.", "properties": { "id": { "type": "integer", "description": "Line item unique identifier.", "example": 1 }, "name": { "type": "string", "description": "Product name at time of purchase.", "example": "Example Name" }, "product_id": { "type": "integer", "description": "Product ID.", "example": 1 }, "variation_id": { "type": "integer", "description": "Variation ID (0 if not a variation).", "example": 1 }, "quantity": { "type": "integer", "description": "Quantity ordered.", "example": 1 }, "tax_class": { "type": "string", "description": "Tax class used for this line item.", "example": "string-value" }, "subtotal": { "type": "string", "description": "Line subtotal (before discounts) as a decimal string.", "example": "string-value" }, "subtotal_tax": { "type": "string", "description": "Line subtotal tax as a decimal string.", "example": "string-value" }, "total": { "type": "string", "description": "Line total (after discounts) as a decimal string.", "example": "string-value" }, "total_tax": { "type": "string", "description": "Line total tax as a decimal string.", "example": "string-value" }, "sku": { "type": "string", "description": "Product SKU.", "example": "string-value" }, "price": { "type": "number", "description": "Product price at time of purchase.", "example": 10.5 }, "meta_data": { "type": "array", "description": "Metadata for the line item (e.g. variation attributes).", "items": { "$ref": "#/components/schemas/MetaData" }, "example": [ "string-value" ] } } }, "example": [ "string-value" ] }, "meta_data": { "type": "array", "description": "Custom metadata attached to the order.", "items": { "type": "object", "description": "Custom metadata key-value entry.", "properties": { "id": { "type": "integer", "description": "Metadata unique identifier.", "example": 1 }, "key": { "type": "string", "description": "Metadata key.", "example": "string-value" }, "value": { "type": "string", "description": "Metadata value.", "example": "string-value" } } }, "example": [ "string-value" ] } } }