returns

Fetch returns matching the supplied arguments.

Arguments

ArgumentTypeRequiredDefaultDescription
order_idStringNo

Filter by order ID; pass the public API ID unless the field name says legacy ID.

warehouse_idStringNo

Filter by public API warehouse ID. Use this ID field when selecting a warehouse; warehouse fields are display values or nested objects.

date_fromISODateTimeNo

Inclusive start of the date range, in ISO-8601 datetime format.

date_toISODateTimeNo

Inclusive end of the date range, in ISO-8601 datetime format.

updated_fromISODateTimeNo

Filter returns updated on or after this date.

updated_toISODateTimeNo

Filter returns updated before this date.

customer_account_idStringNo

If you are a 3PL you can specify one of your customer's account.

tracking_numberStringNo

Filter by tracking number.

analyzeBooleanNo

If true, the query will only be analyzed (cost estimated) without executing it.

Return Type

ReturnsQueryResult

Query

query returns(
  $order_id: String,
  $warehouse_id: String,
  $date_from: ISODateTime,
  $date_to: ISODateTime,
  $updated_from: ISODateTime,
  $updated_to: ISODateTime,
  $customer_account_id: String,
  $tracking_number: String,
  $analyze: Boolean
) {
  returns(
    order_id: $order_id,
    warehouse_id: $warehouse_id,
    date_from: $date_from,
    date_to: $date_to,
    updated_from: $updated_from,
    updated_to: $updated_to,
    customer_account_id: $customer_account_id,
    tracking_number: $tracking_number,
    analyze: $analyze
  ) {
    request_id
    complexity
    data {
      ...ReturnConnectionFragment
    }
  }
}

Variables

{
  "order_id": "T3JkZXI6MTIzNA==",
  "warehouse_id": "V2FyZWhvdXNlOjEyMzQ=",
  "date_from": "2026-07-09T15:30:00Z",
  "date_to": "2026-07-09T15:30:00Z",
  "updated_from": "2026-07-09T15:30:00Z",
  "updated_to": "2026-07-09T15:30:00Z",
  "customer_account_id": "QWNjb3VudDoxMjM0",
  "tracking_number": "1Z999AA10123456784",
  "analyze": true
}

Response

{
  "data": {
    "returns": {
      "request_id": "UmVjb3JkOjEyMzQ=",
      "complexity": 100,
      "data": [{id: "UmV0dXJuOjEyMzQ="}]
    }
  }
}