Customer Orders API

Access your WooCommerce.com order history and invoices programmatically via the REST API.

Overview

↑ Back to top

The Customer Orders API gives you read-only access to your own orders on WooCommerce.com. Use it to automate accounting, sync order data with your systems, or download invoices programmatically.

Prerequisites

↑ Back to top
  1. API access must be enabled on your WooCommerce.com account. Contact your account manager or support to have this turned on.
  2. You need an application password (a special API token) โ€” see Quick Start below.

Quick Start

↑ Back to top

Step 1: Create an Application Password

↑ Back to top
  1. Log in to WooCommerce.com
  2. Go to My Account and navigate to Application Passwords
  3. Enter a name for your password (e.g., “Accounting Integration”) and click Create
  4. Copy the token immediately โ€” it is only displayed once and cannot be retrieved later

Step 2: Make Your First API Call

↑ Back to top

Replace you@example.com with your WooCommerce.com login email and YOUR_TOKEN with the application password you just created:

curl -u "you@example.com:YOUR_TOKEN" \\
  <https://woocommerce.com/wp-json/wc/v3/orders>

This returns a JSON array of your orders.

Authentication

↑ Back to top

Two authentication methods are supported. Use whichever fits your tooling.

Option A: HTTP Basic Auth

↑ Back to top

Pass your WooCommerce.com login email as the username and your application password as the password:

curl -u "you@example.com:YOUR_TOKEN" \\
  <https://woocommerce.com/wp-json/wc/v3/orders>

Option B: X-API-KEY Header

↑ Back to top

Pass your application password in the X-API-KEY header (no username needed):

curl -H "X-API-KEY: YOUR_TOKEN" \\
  <https://woocommerce.com/wp-json/wc/v3/orders>

Tip: If you use HTTP Basic Auth, the username must match your WooCommerce.com login email or username. Using the wrong username will result in a 401 error.

API Reference

↑ Back to top

List Your Orders

↑ Back to top

GET /wp-json/wc/v3/orders

Returns a paginated list of your orders. The API automatically scopes results to your account โ€” you will only ever see your own orders.

Common query parameters:

ParameterTypeDescription
per_pageintegerNumber of orders per page (default: 10, max: 100)
pageintegerPage number
statusstringFilter by order status (e.g., completed, processing, refunded)
afterstringLimit to orders created after this ISO 8601 date
beforestringLimit to orders created before this ISO 8601 date

Example โ€” get your 5 most recent completed orders:

curl -u "you@example.com:YOUR_TOKEN" \\
  "<https://woocommerce.com/wp-json/wc/v3/orders?status=completed&per_page=5>"

Get a Single Order

↑ Back to top

GET /wp-json/wc/v3/orders/{id}

Returns full details for a specific order. You can only retrieve orders that belong to your account โ€” requesting someone else’s order returns a 403 Forbidden error.

Example:

curl -u "you@example.com:YOUR_TOKEN" \\
  <https://woocommerce.com/wp-json/wc/v3/orders/12345>

Get an Invoice

↑ Back to top

GET /wp-json/wc/v3/orders/{id}/invoice

Returns a URL to download the invoice PDF for a specific order.

Requirements:

  • The order must have a status of completed or refunded
  • Orders with other statuses return a 404 Not Found

Example:

curl -u "you@example.com:YOUR_TOKEN" \\
  <https://woocommerce.com/wp-json/wc/v3/orders/12345/invoice>

Response:

{
  "order_id": 12345,
  "invoice_url": "https://...",
  "type": "redirect"
}

Open the invoice_url in a browser or follow the redirect to download the PDF.

The type field indicates how to access the invoice:

  • redirect โ€” follow the URL to a hosted PDF
  • download_url โ€” direct download link for the PDF

Response Format

↑ Back to top

Order responses follow the standard WooCommerce REST API format. Key fields include:

FieldDescription
idOrder ID
statusOrder status (e.g., completed, processing)
totalOrder total
currencyCurrency code (e.g., USD)
date_createdWhen the order was placed
billingBilling address and contact details
shippingShipping address
line_itemsArray of purchased products with names, quantities, and prices
payment_method_titlePayment method used (e.g., “Credit Card”)
date_paidWhen payment was received

Fields not included in customer responses: internal metadata, customer IP address, customer user agent, and cost-of-goods data. These are omitted for privacy and security.


Important Notes

↑ Back to top
  • API versions โ€” both /wc/v2/ and /wc/v3/ are supported. We recommend using v3.
  • Revoking access โ€” you can revoke an application password at any time from My Account > Application Passwords. This immediately disables that token.
  • Lost token โ€” if you lose your application password, create a new one. Old tokens cannot be retrieved.

Troubleshooting

↑ Back to top
IssueSolution
401 UnauthorizedCheck that your application password is correct and your username matches your WooCommerce.com login email
403 ForbiddenYour account may not have API access enabled, or you’re trying to access an order that doesn’t belong to you
404 Not Found on invoiceInvoices are only available for completed or refunded orders
Token stopped workingYour application password may have been revoked. Create a new one from My Account.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.