Name
/returns
Method
GET
Request
| Name | Type | Mandatory | Description |  | 
| api_token | string | yes | API key provided by SWAP. |  | 
| store | string | yes | The store id that the RMAs belong to. |  | 
| from_date | date | yes | Only orders that were created or modified on or after this date will be returned. |  | 
| to_date | date | no | Only orders that were modified before or on this date will be returned. |  | 
| limit | number | yes | The number of orders to return (max is 50). This means the list of orders will be paginated if there are more than 50 that fulfil the request parameters. |  | 
| version | number | yes | 1 |  | 
|  |  |  |  |  | 
Response
The endpoint will return a JSON payload with 3 levels:
- Root level
- Orders level
- billing_address (Billing Address Information object)
- Products level (products belonging to the order)
 
 
Root level
| Name | Type | Description | 
| from_date | date | The same “from_date” value sent in the request. | 
| to_date | date | The same “to_date” value sent in the request. | 
| next_from_date | date | This is the from_date of the last order returned in the orders field (orders are sorted by “date modified” in asc order). | 
Pagination is achieved by sending this value in the from_date in the request. |
| limit | number | The same “limit” value sent in the request. |
| returned | number | The number of orders returned in this response. |
| remaining | number | Number of orders remaining that fulfil the request parameters. |
| orders | list of orders | The list of orders that fulfil the request parameters. |
| version | number | 1 |
Orders level
| Name | Type | Description | 
| order_name | string | Shopify’s order name | 
| order_id | string | Shopify’s order ID | 
| rma | string | SWAP’s RMA number | 
| date_created | date | Date the return was created | 
| date_updated | date | Date the return was updated | 
| type_string | string | A comma separated string containing the types of returns. | 
| type | list of strings | An array listing the types of returns. Can be one of the following: | 
- Refund
- Shop Now Credit
- Shop Later Credit
- Additional Payment
- Recycle
- Warranty |
| shipping_status | string | The shipping status. Possible values:
- Pre-Transit
- In-Transit
- Delivered |
| status | string | The status of the return. Possible values are:
- Open
- Needs Review
- Closed
- Expired
- On Hold
- Cancelled |
| total | number | Total amount of the return |
| handling_fee | number | Handling fee value |
| shipping_fee | number | Shipping fee value |
| stripe_payment_collected | number | Amount collected with Stripe |
| return_id | string | SWAP’s internal return id |
| store_credit_bonus | number | Amount added on the top of the returned items value |
| shop_now_revenue | number | The revenue of orders that include type “Shop Now Credit” |
| shop_later_revenue | number | The revenue of orders that include type “Shop Later Credit” |
| exchange_revenue | number | The revenue of orders that include type “Exchange” |
| refund_revenue | number | The revenue of orders that include type “Refund” |
| store_id | string | SWAP’s internal store id |
| total_additional_payment | number | If there was an additional payment involved, this shows the total amount |
| total_credit_exchange_value | number | Total value of the exchange value |
| total_refund_value_customer_currency | number | Total value of the refund value |
| store_name | string | The name of the store |
| customer_currency | string | The currency that the customer used to pay |
| customer_name | string | The name of the customer |
| screen_type | string | Can be “Desktop” or “Mobile” |
| customer_locale | string | The language locale used by the customer |
| shipping_carrier | string | The carrier in charge of the shipment |
| shopify_order_date | date | The date the order was created in Shopify |
| shipment_from_address_country | string | Country where the shipment is shipped from |
| shipment_from_address_city | string | City where the shipment is shipped from |
| shipment_from_address_parcel_weight | number | Weight of the parcel (in grams) |
| shipment_from_address_state | string | State where the shipment is shipped from |
| tags | string | Order tags |
| billing_address | object | Billing address information |
| processed | string | Indicates if return was processed (Values: yes/no) |
| processed_by | string | Name of the agent that processed the return |
| order_alt_type | string | Used to designate a different use case/type for a returnOrder outside of a normal return RMA (Recycle, refurbishment, etc.) |
| total_recycle_credit | number | Credit earned from recycling |
| num_recycled_products | number | Total number of the recycled products |
| total_weight_recycle_products | number | Total weight of the recycled products |
| quality_control_status | string | Pass if condition of all products is Sellable. Fail otherwise. |
| delivered_date | date | Date the return order was delivered. |
| elapsed_days_purchase_to_return | number | Days between order created and return requested |
| elapsed_days_return_to_delivery | number | Days between return requested and return delivered |
| elapsed_days_delivery_closed | number | Days between the return being delivered and the return being closed. |
| date_closed | date | Date that the return was closed |
| tracking_number | string | The return’s tracking number |
| products | list of products | The list of products whose "productActionType” equals to Return. |
billing_address object
| Name | Type | Description | 
| name | string | Billing address full name | 
| address1 | string | Billing address line 1 | 
| address2 | string | Billing address line 2 | 
| city | string | Billing address city | 
| postcode | string | Billing address zip/postcode | 
| state_province_code | string | Billing address state/province code | 
| country_code | string | Billing address country code | 
Products level
| --- | --- | --- |