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

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:

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:

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 protected]",
        "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",
        "dest_post_zip_code": "SL4 1RZ",
        "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
}