> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ordergroove.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ordergroove.com/_mcp/server.

# order

Retrieves a single order by its `publicId`. Returns an `OrderType` containing the order's status, totals, customer, line items, payment, shipping address, and related subscription data.

## Arguments

| Argument   | Type      | Required | Description                          |
| ---------- | --------- | -------- | ------------------------------------ |
| `publicId` | `String!` | Yes      | The globally unique ID of the order. |

## Return type: `OrderType`

| Field               | Type                                                                                       | Required |
| ------------------- | ------------------------------------------------------------------------------------------ | -------- |
| `appliedIncentives` | [`[AppliedIncentiveType!]!`](/graphql/graphql-definitions/objects/applied-incentive-type)  | Yes      |
| `cancelled`         | `DateTime`                                                                                 | No       |
| `created`           | `DateTime`                                                                                 | No       |
| `currencyCode`      | `String`                                                                                   | No       |
| `customer`          | [`CustomerType`](/graphql/graphql-definitions/objects/customer-type)                       | No       |
| `discountTotal`     | `Decimal!`                                                                                 | Yes      |
| `extraData`         | `String`                                                                                   | No       |
| `genericErrorCount` | `Int!`                                                                                     | Yes      |
| `hasPlan`           | `Boolean!`                                                                                 | Yes      |
| `items`             | [`ItemsPage!`](/graphql/graphql-definitions/objects/items-page)                            | Yes      |
| `locked`            | `Boolean!`                                                                                 | Yes      |
| `merchantPublicId`  | `String!`                                                                                  | Yes      |
| `oneTimeIncentives` | [`[OneTimeIncentiveType!]!`](/graphql/graphql-definitions/objects/one-time-incentive-type) | Yes      |
| `oosFreeShipping`   | `Boolean!`                                                                                 | Yes      |
| `orderMerchantId`   | `String`                                                                                   | No       |
| `payment`           | [`PaymentType`](/graphql/graphql-definitions/objects/payment-type)                         | No       |
| `place`             | `DateTime`                                                                                 | No       |
| `publicId`          | `String`                                                                                   | No       |
| `rejectedMessage`   | `String`                                                                                   | No       |
| `shippingAddress`   | [`AddressType`](/graphql/graphql-definitions/objects/address-type)                         | No       |
| `shippingTotal`     | `Decimal!`                                                                                 | Yes      |
| `status`            | `Int!`                                                                                     | Yes      |
| `subTotal`          | `Decimal!`                                                                                 | Yes      |
| `taxTotal`          | `Decimal!`                                                                                 | Yes      |
| `total`             | `Decimal!`                                                                                 | Yes      |
| `tries`             | `Int!`                                                                                     | Yes      |
| `updated`           | `DateTime`                                                                                 | No       |

Object-typed fields (such as `customer`, `items`, `payment`, `shippingAddress`, `appliedIncentives`, and `oneTimeIncentives`) expand to their own types. See the **Objects** reference for the full field definitions of each type.

## Examples

### Get basic order information

Quick lookup for order status and totals

```graphql title="GraphQL"
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    taxTotal
    total
    place
    created
  }
}
```

```bash title="cURL"
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { order(publicId: \"abc123\") { publicId status subTotal taxTotal total place created } }"}'
```

```javascript title="Node.js"
const query = `
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    taxTotal
    total
    place
    created
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY": "<your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
```

```python title="Python"
import requests

query = """
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    taxTotal
    total
    place
    created
  }
}
"""

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY": "<your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()
```

### Get subscription details by order

Retrieve complete subscription details from order

```graphql title="GraphQL"
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    shippingTotal
    discountTotal
    taxTotal
    total
    created
    place
    updated
    customer {
      merchantUserId
      firstName
      lastName
      email
      phoneNumber
    }
    shippingAddress {
      publicId
      firstName
      lastName
      address
      address2
      city
      stateProvinceCode
      zipPostalCode
      countryCode
      phone
    }
    payment {
      publicId
      ccType
      ccNumberEnding
      ccExpDate
      ccHolder
      paymentMethod
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
          every
          everyPeriod
        }
        subscription {
          publicId
          every
          everyPeriod
        }
      }
    }
  }
}
```

```bash title="cURL"
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { order(publicId: \"abc123\") { publicId status subTotal shippingTotal discountTotal taxTotal total created place updated customer { merchantUserId firstName lastName email phoneNumber } shippingAddress { publicId firstName lastName address address2 city stateProvinceCode zipPostalCode countryCode phone } payment { publicId ccType ccNumberEnding ccExpDate ccHolder paymentMethod } items { nodes { publicId quantity price totalPrice product { name externalProductId sku every everyPeriod } subscription { publicId every everyPeriod } } } } }"}'
```

```javascript title="Node.js"
const query = `
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    shippingTotal
    discountTotal
    taxTotal
    total
    created
    place
    updated
    customer {
      merchantUserId
      firstName
      lastName
      email
      phoneNumber
    }
    shippingAddress {
      publicId
      firstName
      lastName
      address
      address2
      city
      stateProvinceCode
      zipPostalCode
      countryCode
      phone
    }
    payment {
      publicId
      ccType
      ccNumberEnding
      ccExpDate
      ccHolder
      paymentMethod
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
          every
          everyPeriod
        }
        subscription {
          publicId
          every
          everyPeriod
        }
      }
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY": "<your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
```

```python title="Python"
import requests

query = """
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    shippingTotal
    discountTotal
    taxTotal
    total
    created
    place
    updated
    customer {
      merchantUserId
      firstName
      lastName
      email
      phoneNumber
    }
    shippingAddress {
      publicId
      firstName
      lastName
      address
      address2
      city
      stateProvinceCode
      zipPostalCode
      countryCode
      phone
    }
    payment {
      publicId
      ccType
      ccNumberEnding
      ccExpDate
      ccHolder
      paymentMethod
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
          every
          everyPeriod
        }
        subscription {
          publicId
          every
          everyPeriod
        }
      }
    }
  }
}
"""

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY": "<your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()
```

### Get order with applied discounts

Order totals and line items with applied coupons and incentives

```graphql title="GraphQL"
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    discountTotal
    taxTotal
    total
    place
    oneTimeIncentives {
      publicId
      externalCode
      description
      onetimeCouponType
      stackingType
      appliedAt
      expires
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        oneTimeIncentives {
          publicId
          externalCode
          description
          onetimeCouponType
          stackingType
          appliedAt
        }
      }
    }
  }
}
```

```bash title="cURL"
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { order(publicId: \"abc123\") { publicId status subTotal discountTotal taxTotal total place oneTimeIncentives { publicId externalCode description onetimeCouponType stackingType appliedAt expires } items { nodes { publicId quantity price totalPrice product { name externalProductId sku } oneTimeIncentives { publicId externalCode description onetimeCouponType stackingType appliedAt } } } } }"}'
```

```javascript title="Node.js"
const query = `
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    discountTotal
    taxTotal
    total
    place
    oneTimeIncentives {
      publicId
      externalCode
      description
      onetimeCouponType
      stackingType
      appliedAt
      expires
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        oneTimeIncentives {
          publicId
          externalCode
          description
          onetimeCouponType
          stackingType
          appliedAt
        }
      }
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY": "<your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
```

```python title="Python"
import requests

query = """
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    discountTotal
    taxTotal
    total
    place
    oneTimeIncentives {
      publicId
      externalCode
      description
      onetimeCouponType
      stackingType
      appliedAt
      expires
    }
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        oneTimeIncentives {
          publicId
          externalCode
          description
          onetimeCouponType
          stackingType
          appliedAt
        }
      }
    }
  }
}
"""

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY": "<your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()
```

### Get prepaid subscription status by order

Check prepaid subscription progress for each line item

```graphql title="GraphQL"
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    total
    place
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        subscription {
          publicId
          every
          everyPeriod
          prepaidSubscriptionContext {
            prepaidOrdersRemaining
            prepaidOrdersPerBilling
            renewalBehavior
            lastRenewalRevenue
            prepaidOriginMerchantOrderId
          }
        }
      }
    }
  }
}
```

```bash title="cURL"
curl -X POST https://restapi.ordergroove.com/graphql/2026-01/ \
  -H "X-API-KEY: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"query": "query { order(publicId: \"abc123\") { publicId status subTotal total place items { nodes { publicId quantity price totalPrice product { name externalProductId sku } subscription { publicId every everyPeriod prepaidSubscriptionContext { prepaidOrdersRemaining prepaidOrdersPerBilling renewalBehavior lastRenewalRevenue prepaidOriginMerchantOrderId } } } } } }"}'
```

```javascript title="Node.js"
const query = `
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    total
    place
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        subscription {
          publicId
          every
          everyPeriod
          prepaidSubscriptionContext {
            prepaidOrdersRemaining
            prepaidOrdersPerBilling
            renewalBehavior
            lastRenewalRevenue
            prepaidOriginMerchantOrderId
          }
        }
      }
    }
  }
}
`;

const response = await fetch(
  "https://restapi.ordergroove.com/graphql/2026-01/",
  {
    method: "POST",
    headers: {
      "X-API-KEY": "<your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ query }),
  }
);

const data = await response.json();
```

```python title="Python"
import requests

query = """
query {
  order(publicId: "abc123") {
    publicId
    status
    subTotal
    total
    place
    items {
      nodes {
        publicId
        quantity
        price
        totalPrice
        product {
          name
          externalProductId
          sku
        }
        subscription {
          publicId
          every
          everyPeriod
          prepaidSubscriptionContext {
            prepaidOrdersRemaining
            prepaidOrdersPerBilling
            renewalBehavior
            lastRenewalRevenue
            prepaidOriginMerchantOrderId
          }
        }
      }
    }
  }
}
"""

response = requests.post(
    "https://restapi.ordergroove.com/graphql/2026-01/",
    headers={
        "X-API-KEY": "<your-api-key>",
        "Content-Type": "application/json",
    },
    json={"query": query},
)

data = response.json()
```