Product Returns Queries

Access product returns from customers, including return reasons and received status.

ProductReturn — Returns a single product return by id

query GetProductReturn($id: ID!) {
  ProductReturn(id: $id) {
    id
    label
    status
    dated_at
    add_in_stock
    total_units
    customer { id label }
    location_label
    line_items {
      id
      variant { id label }
      quantity
    }
  }
}

ProductReturns — Returns a paginated list of product returns with sorting and filters

query ProductReturns(
  $where: QueryProductReturnsWhereWhereConditions,
  $orderBy: [QueryProductReturnsOrderByOrderByClause!],
  $search: String,
  $first: Int,
  $page: Int
) {
  ProductReturns(
    where: $where,
    orderBy: $orderBy,
    search: $search,
    first: $first,
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      label
      status
      dated_at
      customer { id label }
    }
  }
}

Available fields

FieldTypeDescription
idIntUnique identifier.
labelStringReturn document number.
statusProductReturnStatusCurrent workflow status.
add_in_stockBooleanTrue if returned items increase stock levels.
total_unitsFloatTotal quantity of items returned.
total_units_aggregateFloatSum of units for filtered returns.
dated_atDateDocument date.
created_atDateCreation date.
customerCustomerLinked customer.
location_labelStringTarget location name.
notesStringPublic notes for documents.
internal_notesStringPrivate internal notes.
credit_statusCreditStatusProgress of associated credit notes.
credited_quantityFloatQuantity already processed for credit.
uncredited_quantityFloatQuantity awaiting credit processing.
credited_amountFloatValue already processed for credit.
uncredited_amountFloatValue awaiting credit processing.
seasonSeasonAssociated business season.
account_representativeAccountRepresentativeLinked sales rep.
line_items[LineItemProductReturn]List of returned items.
orders_countIntNumber of linked sales orders.
orders[Order]Linked sales orders history.
invoices_countIntNumber of linked invoices.
invoices[Invoice]Linked invoices details.
credit_notes_countIntNumber of linked credit notes.
credit_notes[CreditNote]Associated credit notes.
refunds_countIntNumber of linked refunds.
refunds[Refund]Associated direct refunds.
integrations[Integration]External platform links.
email_histories[EmailHistory]History of sent emails.
files[File]Attached documents.
pdf_templatePdfTemplateDesign used for PDF generation.
has_batch_numbersBooleanTrue if items have batch tracking.
tracking_completedBooleanTrue if all tracking info is entered.
custom_fields[EntityCustomField]Custom fields for this entity.

Filters

The following fields can be used in the where parameter:

id, label, status, add_in_stock, total_units, dated_at, created_at, updated_at, customer_id, orders_count, variant_id, variant_label, variant_sku, location_id, batch_number_id, has_batch_numbers, tracking_completed.

Example Filters:

FieldExample
status{ "column": "STATUS", "operator": "EQ", "value": "pending" }
customer_id{ "column": "CUSTOMER_ID", "operator": "EQ", "value": 100050 }
variant_id{ "column": "VARIANT_ID", "operator": "EXISTS", "value": 200080 }

Sorting

You can sort results using the orderBy parameter:

  • id
  • label
  • add_in_stock
  • total_units
  • status
  • dated_at
  • created_at
  • customer_id
  • customer_label

Grouping Options

You can group product returns using the groupBy parameter for reports:

FieldDescription
idGroup by internal ID.
yearGroup by year of dated_at.
monthGroup by month of dated_at.
dayGroup by day of dated_at.

Enums

ProductReturnStatus

ValueDescription
unpublishedDraft status (hidden).
pendingDocument created, awaiting processing.
completedReturn fully processed.
cancelledDocument voided.

CreditStatus

ValueDescription
not_creditedNo credit processed yet.
partially_creditedPartial credit generated.
creditedFull value processed for credit.