Export
A comprehensive list of the export query keys and allowed fields values for the return resource
Last updated
A comprehensive list of the export query keys and allowed fields values for the return resource
To export returns as CSV send a POST request to the /returns/export endpoint specifying in the payload the query keys and filter parameters like in the generic example below:
{
"search": {
"sort": "...",
"sort_by": "...",
"fields": [ "...", "...", ... ]
},
"filter": { ... }
}The response is a CSV file (text/csv) returned inline (maximum size allowed is 100K records). Please find more information on how export queries work here.
These are the keys you need to set when performing an export query:
sort
String
The way you want the results of the query to be sorted.
One of asc or desc (default is desc).
sort_by
String
The date field you want the results of the query sorted by.
Here the full list of valid values for this key. Default is return.current_date.
fields
Array
The list of fields you want to be exported for each record.
Here the full list of valid values for this key. Default is ["return.id", "return.created_at", "return.status"].
sort_by valuesThese are the valid values you can specify for the sort_by key of the export query:
return.approved_at
return.archived_at
return.cancelled_at
return.created_at
return.current_date
return.received_at
return.rejected_at
return.shipped_at
return.updated_at
field valuesThese are the valid values you can specify for the fields key of the export query:
customer.email
customer.group_name
customer.id
destination_address.business
destination_address.city
destination_address.country_code
destination_address.geocoded
destination_address.localized
destination_address.state_code
destination_address.zip_code
market.id
market.name
market.number
organization.id
organization.name
organization.slug
origin_address.business
origin_address.city
origin_address.country_code
origin_address.geocoded
origin_address.localized
origin_address.state_code
origin_address.zip_code
return.aggregated_details
return.approved_at
return.archived
return.archived_at
return.cancelled_at
return.created_at
return.currency_code
return.current_date
return.id
return.mode
return.number
return.order_id
return.received_at
return.reference
return.reference_origin
return.rejected_at
return.shipped_at
return.skus_count
return.status
return.updated_at
stock_location.id
stock_location.name
stock_location.reference
stock_location.reference_origin
tags.id
tags.name
Only return and single-level references are allowed (no return line items). tags.name and tags.id generate space-separated values.
Last updated