The advanced rule’s action Trigger a webhook with the return data
will send the following data to a URL indicated in the rule.
The data sent will be a JSON payload with 2 levels:
- Return level
- Billing address level (billing address of the user that created the order)
- Products level (products belonging to the return)
Return level
Name | Type | Description |
---|---|---|
order_name | string | Shopify's order name |
original_order_name | string | Return order’s original 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 |
return_id | string | SWAP's internal return ID |
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_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 |
customer_email | string | The email 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_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. |
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
Parameter | Type | Description |
---|---|---|
product_id | string | SWAP's internal product id |
shopify_product_id | string | Shopify's Product ID |
shopify_variant_id | string | Shopify's Variant ID |
order_number | string | The return's order number |
original_order_name | string | Return order’s original order name |
date | date | Date the product was created |
product_name | string | Name of the product |
variant_name | string | Name of the variant |
full_sku_description | string | Product + Variant name |
sku | string | SKU |
main_reason_id | string | ID of the main reason for the return |
main_reason_text | string | Text of the main reason for the return |
sub_reason_id | string | ID of the sub reason for the return |
sub_reason_text | string | Text of the sub reason for the return |
comments | string | Customer’s comments |
item_count | number | Number of items |
cost | number | Total cost |
return_type | string | Return type. Can be one of the following: Refund, Shop Now Credit, Shop Later Credit, Additional Payment, Recycle, Warranty |
currency | string | Currency used by the customer |
vendor | string | Name of the vendor |
collection | list of strings | List of names of the collections this product is part of |
product_alt_type | string | Used to designate a different use case/type for a product outside of a normal return RMA (Recycle, refurbishment, etc.) |
recycle_material | string | Used with the recycle feature. Collects the material type for the product being returned for recycling |
grams | number | Product's weight, in grams |
intake_reason | string | Dropdown options for each item on the returns dashboard. Used to keep a record of the condition of the item returned. Current values: Sellable, Damaged, Missing, Wrong Item |
tags | string | Product tags |
Payload sample
{
"return": {
"order_name": "SW-P022",
"order_id": "5597137207520",
"rma": "7606",
"date_created": "2024-04-09T21:06:54.645Z",
"date_updated": "2024-04-09T22:04:34.949Z",
"type_string": "Exchange",
"type": [
"Exchange"
],
"shipping_status": "Pre-Transit",
"status": "Needs Review",
"total": 0.00,
"return_id": "1712696812381x998799650791620600",
"store_id": "1635427666272x611125723156784100",
"total_additional_payment": 0.00,
"total_refund_value_customer_currency": 0.00,
"store_name": "Swap Test Store",
"customer_currency": "GBP",
"customer_name": "P MC",
"customer_email": "email@company.com",
"screen_type": "Desktop",
"customer_locale": "",
"shipping_carrier": "Royal Mail QR",
"shopify_order_date": "2024-04-09T22:03:24+01:00",
"shipment_from_address_country": "GB",
"shipment_from_address_city": "London",
"shipment_from_address_parcel_weight": 1400.00,
"shipment_from_address_state": "ENG",
"tags": "",
"billing_address": {
"name": "a bc",
"address1": "a",
"address2": "aa",
"city": "London",
"postcode": "EC2A 4NE",
"state_province_code": "ENG",
"country_code": "GB"
},
"processed_by": "Milroy Auwardt",
"order_alt_type": "",
"total_recycle_credit": 0.0,
"num_recycled_products": 0,
"total_weight_recycled_products": 0,
"quality_control_status": "",
"delivered_date": null,
"products": [
{
"product_id": "1712696796497x633694252121194500",
"shopify_product_id": "7323548745952",
"shopify_variant_id": "41654472212704",
"order_number": "P022",
"original_order_name": "P022",
"date": "2024-04-09T21:06:38.753Z",
"product_name": "Silk Tuxedo",
"variant_name": "Small / Yellow / Silk",
"full_sku_description": "Silk Tuxedo Small / Yellow / Silk",
"sku": "BS-1",
"main_reason_id": "1708093250387x845377146441695200",
"main_reason_text": "Test (don't edit or move!!!!)",
"sub_reason_id": "",
"sub_reason_text": "",
"comments": "",
"item_count": 1,
"cost": 80.00,
"return_type": "Exchange",
"currency": "GBP",
"vendor": "partners-demo",
"collection": [],
"product_alt_type": "",
"recycle_material": "",
"grams": 100000,
"intake_reason": "Sellable",
"tags": "men, swap_customfee"
}
],
"date_closed": "2024-04-09T22:04:03.945Z",
"tracking_number": "XF958683152GB"
},
"version": 1
}
Related to