Skip to content

Woo orders


id: woocommerce-woo-orders-list owner: woocommerce method: GET path: /wp-json/headlesswp/v1/orders title: Woo orders usedBySite: true

GET /wp-json/headlesswp/v1/orders

Fetch the authenticated user's WooCommerce orders (including pending, failed, processing, and completed statuses).

Auth + CSRF

  • Auth: cookie
  • Proxy nonce required: yes.
  • CSRF: proxy-enforced X-WP-Nonce for this user-specific GET endpoint.

Request schema

No request body.

Query params:

Order status coverage:

  • pending

  • failed

  • processing

  • completed

  • page (number, optional, default 1)

  • perPage (number, optional, default 20)

Response schema

{
  "data": {
    "orders": [
      {
        "id": 1001,
        "status": "completed",
        "currency": "USD",
        "total": 149,
        "createdAt": "2025-01-10T12:00:00Z",
        "updatedAt": "2025-01-11T12:00:00Z",
        "lineItems": [
          {
            "name": "HeadlessWP Pro Annual",
            "quantity": 1,
            "total": 149
          }
        ],
        "affiliateRef": "1",
        "affiliateCampaign": "spring",
        "affiliateReferralCreated": true,
        "affiliateVisitId": 222,
        "affiliateReferralId": 333,
        "affiliateVisitConverted": true,
        "orderAttributionSourceType": "referral",
        "orderAttributionUtmSource": "affiliatewp",
        "orderAttributionUtmMedium": "affiliate",
        "orderAttributionUtmCampaign": "spring",
        "orderAttributionUtmContent": "1",
        "marketingUtmSource": "google",
        "marketingUtmMedium": "cpc",
        "marketingUtmCampaign": "spring-sale",
        "marketingUtmContent": "hero"
      }
    ],
    "pagination": {
      "page": 1,
      "perPage": 20,
      "total": 1,
      "totalPages": 1
    }
  },
  "meta": {
    "correlationId": "string-or-null",
    "correlation_id": "string-or-null",
    "request_id": "string-or-null",
    "timestamp": "2025-01-01T00:00:00Z"
  }
}

Additive affiliate proof fields:

  • affiliateVisitId (number|null)
  • affiliateReferralId (number|null)
  • affiliateVisitConverted (boolean|null): true only after the Woo order reaches processing or completed and AffiliateWP referral acceptance is finalized.

Additive WooCommerce attribution proof fields:

  • orderAttributionSourceType (string|null)
  • orderAttributionUtmSource (string|null)
  • orderAttributionUtmMedium (string|null)
  • orderAttributionUtmCampaign (string|null)
  • orderAttributionUtmContent (string|null)

Additive marketing campaign context fields:

  • marketingUtmSource (string|null)
  • marketingUtmMedium (string|null)
  • marketingUtmCampaign (string|null)
  • marketingUtmContent (string|null)

Attribution precedence note:

  • orderAttribution* fields represent Woo attribution (referral/utm/typein) and keep AffiliateWP precedence.
  • marketingUtm* fields preserve valid checkout utm_* query context independently, including affiliate-attributed orders.

Error codes

  • NOT_AUTHENTICATED (401) when no valid cookie session is present.
  • VALIDATION_FAILED (400) when page/perPage are invalid.