# Get an order

Fetches an order. Works with Shopify and WooCommerce accounts.

```http
GET https://api.pozy.ai/v1/commerce/orders/{orderId}
```

- Area: Commerce / Commerce
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `orderId` (string, required)

## Query parameters

- `accountId` (string, required)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/commerce/orders/6b0cd41b19d2de5d892171eb?accountId=696e0b682d0a31188e7a2ba9" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/commerce/orders/6b0cd41b19d2de5d892171eb?accountId=696e0b682d0a31188e7a2ba9", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/commerce/orders/6b0cd41b19d2de5d892171eb",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `order`, object
  - `id`, string
  - `accountId`, string
  - `platform`, string: One of `shopify`, `woocommerce`
  - `number`, string
  - `status`, string: One of `pending_payment`, `on_hold`, `awaiting_fulfillment`, `partially_fulfilled`, `in_transit`, `delivered`, `completed`, `cancelled`
  - `platformStatus`, string
  - `paymentStatus`, string
  - `platformPaymentStatus`, string: Can be null
  - `currency`, string
  - `taxesIncluded`, boolean
  - `createdAt`, string (date-time)
  - `updatedAt`, string (date-time)
  - `paidAt`, string (date-time): Can be null
  - `cancelledAt`, string (date-time): Can be null
  - `cancelReason`, string: Can be null
  - `subtotal`, object
    - `amount`, string, required
    - `currency`, string, required
  - `discountTotal`, object
    - `amount`, string, required
    - `currency`, string, required
  - `shippingTotal`, object
    - `amount`, string, required
    - `currency`, string, required
  - `taxTotal`, object
    - `amount`, string, required
    - `currency`, string, required
  - `total`, object
    - `amount`, string, required
    - `currency`, string, required
  - `refundedTotal`, object
    - `amount`, string, required
    - `currency`, string, required
  - `discountCodes`, array of string
  - `paymentMethods`, array of string
  - `customer`, object: Can be null
    - `id`, string: Can be null
    - `email`, string: Can be null
    - `phone`, string: Can be null
    - `firstName`, string: Can be null
    - `lastName`, string: Can be null
  - `billingAddress`, object
    - one of: Commerce Address
      - `firstName`, string: Can be null
      - `lastName`, string: Can be null
      - `company`, string: Can be null
      - `phone`, string: Can be null
      - `line1`, string: Can be null
      - `line2`, string: Can be null
      - `city`, string: Can be null
      - `region`, string: Can be null
      - `postalCode`, string: Can be null
      - `countryCode`, string: Can be null
  - `shippingAddress`, object
    - one of: Commerce Address
      - `firstName`, string: Can be null
      - `lastName`, string: Can be null
      - `company`, string: Can be null
      - `phone`, string: Can be null
      - `line1`, string: Can be null
      - `line2`, string: Can be null
      - `city`, string: Can be null
      - `region`, string: Can be null
      - `postalCode`, string: Can be null
      - `countryCode`, string: Can be null
  - `buyerNote`, string: Can be null
  - `attribution`, object
    - `ready`, boolean
    - `firstVisit`, object
      - one of: Commerce Order Visit
        - `occurredAt`, string (date-time): Can be null
        - `landingUrl`, string: Can be null
        - `referrerUrl`, string: Can be null
        - `source`, string: Can be null
        - `sourceType`, string: Can be null
        - `utm`, object: Can be null
          - `source`, string: Can be null
          - `medium`, string: Can be null
          - `campaign`, string: Can be null
          - `term`, string: Can be null
          - `content`, string: Can be null
    - `lastVisit`, object
      - one of: Commerce Order Visit
        - `occurredAt`, string (date-time): Can be null
        - `landingUrl`, string: Can be null
        - `referrerUrl`, string: Can be null
        - `source`, string: Can be null
        - `sourceType`, string: Can be null
        - `utm`, object: Can be null
          - `source`, string: Can be null
          - `medium`, string: Can be null
          - `campaign`, string: Can be null
          - `term`, string: Can be null
          - `content`, string: Can be null
    - `customAttributes`, array of object
      - `key`, string
      - `value`, string
  - `lineItems`, array of object
    - `id`, string
    - `productId`, string: Can be null
    - `variantId`, string: Can be null
    - `sku`, string: Can be null
    - `title`, string
    - `variantTitle`, string: Can be null
    - `quantity`, integer
    - `unitPrice`, object
      - `amount`, string, required
      - `currency`, string, required
    - `subtotal`, object
      - `amount`, string, required
      - `currency`, string, required
    - `discountTotal`, object
      - `amount`, string, required
      - `currency`, string, required
    - `total`, object
      - `amount`, string, required
      - `currency`, string, required
    - `taxLines`, array of object
      - `title`, string
      - `ratePercent`, number: Can be null
      - `amount`, object
        - `amount`, string, required
        - `currency`, string, required
  - `shippingLines`, array of object
    - `id`, string
    - `title`, string
    - `amount`, object
      - `amount`, string, required
      - `currency`, string, required
    - `discountTotal`, object
      - `amount`, string, required
      - `currency`, string, required
    - `taxLines`, array of object
      - `title`, string
      - `ratePercent`, number: Can be null
      - `amount`, object
        - `amount`, string, required
        - `currency`, string, required
  - `feeLines`, array of object
    - `id`, string
    - `title`, string
    - `amount`, object
      - `amount`, string, required
      - `currency`, string, required
    - `discountTotal`, object
      - `amount`, string, required
      - `currency`, string, required
    - `taxLines`, array of object
      - `title`, string
      - `ratePercent`, number: Can be null
      - `amount`, object
        - `amount`, string, required
        - `currency`, string, required
  - `taxLines`, array of object
    - `title`, string
    - `ratePercent`, number: Can be null
    - `amount`, object
      - `amount`, string, required
      - `currency`, string, required
  - `refunds`, array of object
    - `id`, string
    - `createdAt`, string (date-time): Can be null
    - `note`, string: Can be null
    - `amount`, object
      - `amount`, string, required
      - `currency`, string, required
    - `lineItems`, array of object
      - `lineItemId`, string
      - `quantity`, integer
      - `amount`, object
        - `amount`, string, required
        - `currency`, string, required
  - `fulfillments`, array of object
    - `carrierName`, string: Can be null
    - `trackingNumber`, string: Can be null
    - `trackingUrl`, string: Can be null
  - `platformData`, object: Can be null

```json
{
  "order": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "shopify",
    "number": "string",
    "status": "pending_payment",
    "platformStatus": "instagram",
    "paymentStatus": "pending",
    "platformPaymentStatus": "instagram",
    "currency": "USD",
    "taxesIncluded": true,
    "createdAt": "2026-10-02T09:00:00.000Z",
    "updatedAt": "2026-10-02T09:00:00.000Z",
    "paidAt": "2026-10-02T09:00:00.000Z",
    "cancelledAt": "2026-10-02T09:00:00.000Z",
    "cancelReason": "string",
    "subtotal": {
      "amount": "string",
      "currency": "USD"
    },
    "discountTotal": {
      "amount": "string",
      "currency": "USD"
    },
    "shippingTotal": {
      "amount": "string",
      "currency": "USD"
    },
    "taxTotal": {
      "amount": "string",
      "currency": "USD"
    },
    "total": {
      "amount": "string",
      "currency": "USD"
    },
    "refundedTotal": {
      "amount": "string",
      "currency": "USD"
    },
    "discountCodes": [
      "string"
    ],
    "paymentMethods": [
      "string"
    ],
    "customer": {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "email": "alex@example.com",
      "phone": "+14155550123",
      "firstName": "Acme",
      "lastName": "Acme"
    },
    "billingAddress": {
      "firstName": "Acme",
      "lastName": "Acme",
      "company": "string",
      "phone": "+14155550123",
      "line1": "string",
      "line2": "string",
      "city": "string",
      "region": "string",
      "postalCode": "string",
      "countryCode": "US"
    },
    "shippingAddress": {
      "firstName": "Acme",
      "lastName": "Acme",
      "company": "string",
      "phone": "+14155550123",
      "line1": "string",
      "line2": "string",
      "city": "string",
      "region": "string",
      "postalCode": "string",
      "countryCode": "US"
    },
    "buyerNote": "string",
    "attribution": {
      "ready": true,
      "firstVisit": {
        "occurredAt": "2026-10-02T09:00:00.000Z",
        "landingUrl": "https://pozy.ai/media/example-1.jpg",
        "referrerUrl": "https://pozy.ai/media/example-1.jpg",
        "source": "string",
        "sourceType": "string",
        "utm": {
          "source": "string",
          "medium": "string",
          "campaign": "string",
          "term": "string",
          "content": "Hello from Pozy"
        }
      },
      "lastVisit": {
        "occurredAt": "2026-10-02T09:00:00.000Z",
        "landingUrl": "https://pozy.ai/media/example-1.jpg",
        "referrerUrl": "https://pozy.ai/media/example-1.jpg",
        "source": "string",
        "sourceType": "string",
        "utm": {
          "source": "string",
          "medium": "string",
          "campaign": "string",
          "term": "string",
          "content": "Hello from Pozy"
        }
      },
      "customAttributes": [
        {
          "key": "string",
          "value": "string"
        }
      ]
    },
    "lineItems": [
      {
        "id": "6bfebd43ddc270f6d2c56fc5",
        "productId": "659773d34b353e6821202f21",
        "variantId": "64058b146247283881d19961",
        "sku": "string",
        "title": "Launch day",
        "variantTitle": "string",
        "quantity": 1,
        "unitPrice": {
          "amount": "string",
          "currency": "USD"
        },
        "subtotal": {
          "amount": "string",
          "currency": "USD"
        },
        "discountTotal": {
          "amount": "string",
          "currency": "USD"
        },
        "total": {
          "amount": "string",
          "currency": "USD"
        },
        "taxLines": [
          {
            "title": "Launch day",
            "ratePercent": 12.5,
            "amount": {
              "amount": "string",
              "currency": "USD"
            }
          }
        ]
      }
    ],
    "shippingLines": [
      {
        "id": "6bfebd43ddc270f6d2c56fc5",
        "title": "Launch day",
        "amount": {
          "amount": "string",
          "currency": "USD"
        },
        "discountTotal": {
          "amount": "string",
          "currency": "USD"
        },
        "taxLines": [
          {
            "title": "Launch day",
            "ratePercent": 12.5,
            "amount": {
              "amount": "string",
              "currency": "USD"
            }
          }
        ]
      }
    ],
    "feeLines": [
      {
        "id": "6bfebd43ddc270f6d2c56fc5",
        "title": "Launch day",
        "amount": {
          "amount": "string",
          "currency": "USD"
        },
        "discountTotal": {
          "amount": "string",
          "currency": "USD"
        },
        "taxLines": [
          {
            "title": "Launch day",
            "ratePercent": 12.5,
            "amount": {
              "amount": "string",
              "currency": "USD"
            }
          }
        ]
      }
    ],
    "taxLines": [
      {
        "title": "Launch day",
        "ratePercent": 12.5,
        "amount": {
          "amount": "string",
          "currency": "USD"
        }
      }
    ],
    "refunds": [
      {
        "id": "6bfebd43ddc270f6d2c56fc5",
        "createdAt": "2026-10-02T09:00:00.000Z",
        "note": "string",
        "amount": {
          "amount": "string",
          "currency": "USD"
        },
        "lineItems": [
          {
            "lineItemId": "681b8812378e080e232ba5be",
            "quantity": 1,
            "amount": {
              "amount": "string",
              "currency": "USD"
            }
          }
        ]
      }
    ],
    "fulfillments": [
      {
        "carrierName": "Acme",
        "trackingNumber": "string",
        "trackingUrl": "https://pozy.ai/media/example-1.jpg"
      }
    ],
    "platformData": {}
  }
}
```
