Skip to main content

Order

For loop type woo_order, here are the query parameters and fields.

Query parameters

  • billing_address_1 - Billing address 1
    Type: string

  • billing_address_2 - Billing address 2
    Type: string

  • billing_city - Billing city
    Type: string

  • billing_company - Billing company
    Type: string

  • billing_country - Billing country
    Type: string

  • billing_email - Billing email
    Type: string

  • billing_first_name - Billing first name
    Type: string

  • billing_last_name - Billing last name
    Type: string

  • billing_phone - Billing phone
    Type: string

  • billing_postcode - Billing postcode
    Type: string

  • billing_state - Billing state
    Type: string

  • cart_tax - Cart tax
    Type: number

  • count - Limit number of results, or -1 for all
    Type: number

  • currency - Currency used in order
    Type: string

  • customer_id - User ID
    Type: number, string

  • discount_tax - Discount tax
    Type: number

  • discount_total - Total discount
    Type: number

  • exclude - Exclude product ID(s)
    Type: array

  • order - Order
    Type: string - Default: desc

  • order_id - Order ID(s)
    Type: number, array

  • orderby - Order by field
    Type: string - Default: name

  • parent - Parent product ID(s)
    Type: number

  • parent_exclude - Exclude parent product ID(s)
    Type: array

  • payment_method - Slug of payment method used
    Type: string

  • payment_method_title - Full title of payment method used
    Type: string

  • prices_include_tax - Prices include tax
    Type: string

  • shipping_address_1 - Shipping address 1
    Type: string

  • shipping_address_2 - Shipping address 2
    Type: string

  • shipping_city - Shipping city
    Type: string

  • shipping_company - Shipping company
    Type: string

  • shipping_country - Shipping country
    Type: string

  • shipping_email - Shipping email
    Type: string

  • shipping_first_name - Shipping first name
    Type: string

  • shipping_last_name - Shipping last name
    Type: string

  • shipping_phone - Shipping phone
    Type: string

  • shipping_postcode - Shipping postcode
    Type: string

  • shipping_state - Shipping state
    Type: string

  • shipping_tax - Shipping tax
    Type: number

  • shipping_total - Shipping total
    Type: number

  • status - Status
    Type: string - Default: completed

  • total - Order total
    Type: number

  • type - Order Types
    Type: string - Default: shop_order

  • user - User ID, name, or "current"
    Type: number, string, array

Fields

  • billing_address_1 - Billing address 1

  • billing_address_2 - Billing address 2

  • billing_city - Billing city

  • billing_company - Billing company

  • billing_country - Billing country

  • billing_email - Billing email

  • billing_first_name - Billing first name

  • billing_last_name - Billing last name

  • billing_phone - Billing phone

  • billing_postcode - Billing postcode

  • billing_state - Billing state

  • cancel_endpoint - Helper method to return the cancel endpoint

  • cancel_order_url - Generates a URL so that a customer can cancel their (unpaid - pending) order

  • cart_hash - Get cart hash

  • cart_tax - Gets cart tax amount

  • checkout_order_received_url - Generates a URL for the thanks page (order received)

  • checkout_payment_url - Generates a URL so that a customer can pay for their (unpaid - pending) order. Pass "true" for the checkout version which does not offer gateway choices

  • created_via - Get created via

  • currency - Gets order currency

  • customer_id - Customer ID

  • customer_ip_address - Get customer ip address

  • customer_note - Get customer note

  • customer_user_agent - Get customer user agent

  • date_completed - Date completed

  • date_created - Date created

  • date_modified - Date modified

  • date_paid - Date paid

  • discount_tax - Get discount_tax

  • discount_to_display - Get the discount amount (formatted)

  • discount_total - Get discount_total

  • formatted_billing_address - Get a formatted billing address for the order

  • formatted_billing_full_name - Get a formatted billing full name

  • formatted_order_total - Gets order total - formatted for display

  • formatted_shipping_address - Get a formatted shipping address for the order

  • formatted_shipping_full_name - Get a formatted shipping full name

  • has_billing_address - Returns true if the order has a billing address

  • has_free_item - Returns true if the order contains a free product

  • has_shipping_address - Returns true if the order has a shipping address

  • id - ID

  • is_paid - Returns if an order has been paid for based on the order status

  • item_count - Gets the count of order items of a certain type

  • item_count_refunded - Gets the count of order items of a certain type that have been refunded

  • items - Return an OrderItem Loop of items within this order

  • needs_payment - Checks if an order needs payment, based on status and order total

  • needs_processing - See if the order needs processing before it can be completed

  • order_item_totals - Get totals for display on pages and in emails

  • order_key - Get order key

  • order_number - Gets the order number for display (by default, order ID)

  • payment_method - Gets the payment method

  • payment_method_title - Get payment method title

  • prices_include_tax - Gets prices including tax

  • refunds - Get order refunds

  • remaining_refund_amount - How much money is left to refund

  • remaining_refund_items - How many items are left to refund

  • shipping_address_1 - Billing address 1

  • shipping_address_2 - Billing address 2

  • shipping_address_map_url - Get a formatted shipping address for the order

  • shipping_city - Billing city

  • shipping_company - Billing company

  • shipping_country - Billing country

  • shipping_email - Billing email

  • shipping_first_name - Billing first name

  • shipping_last_name - Billing last name

  • shipping_method - Gets formatted shipping method title

  • shipping_phone - Billing phone

  • shipping_postcode - Billing postcode

  • shipping_state - Billing state

  • shipping_tax - Get shipping_tax

  • shipping_total - Get shipping_total

  • status - Status

  • subtotal - Gets order subtotal

  • subtotal_to_display - Gets subtotal - subtotal is shown before discounts, but with localised taxes

  • tax_totals - Get taxes, merged by code, formatted ready for output

  • total - Gets order grand total. incl. taxes. Used in gateways

  • total_qty_refunded - Get the total number of items refunded

  • total_refunded - Get amount already refunded

  • total_shipping_refunded - Get the total shipping refunded

  • total_tax - Get total tax amount

  • total_tax_refunded - Get the total tax refunded

  • transaction_id - Get transaction id

  • view_order_url - Generates a URL to view an order from the my account page