Skip to main content

Query order information

This guide describes how to get orders from the Traide GraphQL API.

Traide has two levels of order:

  • A marketplace order (NauticalOrder) is what the customer placed. Query it with nauticalOrder and nauticalOrders.
  • A seller order (Order) is one seller's portion of a marketplace order. Query it with order and orders. A marketplace order lists its seller orders in subOrders.

Orders are private data, so authenticate as a staff user or an app that can manage orders. See Authentication.

Retrieving a list of orders​

To fetch a list of seller orders, run the orders query. The orders field is a paginated collection, see Pagination for more information.

{
orders(first: 2) {
edges {
node {
id
number
created
status
total {
gross {
baseAmount
currency
}
}
}
}
}
}

In this example, for each order, we return:

  • id: the unique order ID, most operations will require one.
  • number: the order number shown to staff and customers.
  • created: when the order was placed.
  • status: the fulfillment status, for example UNFULFILLED or FULFILLED.
  • total: the order total. baseAmount is in the currency's smallest unit, for example cents for USD.

Filtering​

Use the optional filter argument to narrow the results. Some of the available filters:

  • status: [OrderStatusFilter!]: for example UNFULFILLED, PARTIALLY_FULFILLED, FULFILLED, READY_TO_FULFILL or CANCELED.
  • paymentStatus: [PaymentChargeStatusEnum!]: for example NOT_CHARGED, FULLY_CHARGED or FULLY_REFUNDED.
  • customer: String: the customer's name or email address.
  • search: String: search across order fields.
  • created: { gte: Date, lte: Date }: orders placed on or after gte and on or before lte.

Here is an example query that fetches the first 3 unfulfilled orders placed since January 1, 2026:

{
orders(
first: 3
filter: { status: [UNFULFILLED], created: { gte: "2026-01-01" } }
) {
edges {
node {
number
created
status
}
}
}
}

Sorting​

Sort the results with the sortBy argument. It takes two required fields:

  • field: one of NUMBER, CREATION_DATE, UPDATE_DATE, CUSTOMER, PAYMENT, PAYMENT_DATE, FULFILLMENT_STATUS, TOTAL, PO_NUMBERS, EXTERNAL_ID or EXTERNAL_SOURCE.
  • direction: ASC for ascending or DESC for descending.

This example lists the newest orders first:

{
orders(first: 2, sortBy: { field: CREATION_DATE, direction: DESC }) {
edges {
node {
number
created
}
}
}
}

Retrieving a single order​

To get a single seller order, use the order query with the order's id:

query {
order(id: "T3JkZXI6MTE1") {
id
number
status
paymentStatus
userEmail
seller {
companyName
}
}
}

Retrieving order lines​

Each order has lines, one per product variant ordered:

query {
order(id: "T3JkZXI6MTE1") {
number
lines {
id
productName
variantName
productSku
quantity
quantityFulfilled
unitPrice {
gross {
baseAmount
currency
}
}
thumbnail(size: 100) {
url
alt
}
}
}
}
Show more ↓
  • productName and variantName: the names at the time of the order.
  • quantity and quantityFulfilled: how many were ordered, and how many have shipped.
  • thumbnail: the line's product image. The optional size argument sets the size in pixels.

Pricing​

An order's money fields are TaxedMoney: subtotal, shippingPrice, total, discountedTotal and originalTotal. Each order line has unitPrice and totalPrice.

type TaxedMoney {
currency: String!
net: Money!
gross: Money!
tax: Money!
}

type Money {
currency: String!
baseAmount: BigInt!
}

net is before tax and gross after it; tax is the difference.

Marketplace orders​

To see a customer's whole order across sellers, query the marketplace order and its seller orders:

{
nauticalOrders(first: 1, sortBy: { field: CREATION_DATE, direction: DESC }) {
edges {
node {
id
number
status
total {
gross {
baseAmount
currency
}
}
subOrders {
number
status
seller {
companyName
}
}
}
}
}
}
Show more ↓

Was this page helpful?