Product Selection Step

The first step of the journey, and where the user selects which products they wish to return, along with return reasons / attachments.

Example Flow

Example response (properties explained below):

{
  "type": "product_selection",
  "nextType": "return_options",
  "payload": {
    "status": "Delivered",
    "orderDate": "2024-01-07T00:00:00",
    "deliveryDate": "2024-01-10T00:00:00",
    "confirmButtonText": "Confirm your selection",
    "areReturnReasonsRequired": false,
    "products": [
      {
        "id": "O111111",
        "name": "Cloudrunner 2",
        "productType": "shoe",
        "size": {
          "displayName": "UK 9",
          "value": "9",
          "width": "regular",
          "sizeSystem": "UK"
        },
        "image": "https://example.com/image1.png",
        "price": {
          "amount": 149.99,
          "currencyCode": "GBP"
        },
        "colour": "Black",
        "quantity": 5,
        "reasonsForReturn": [
          {
            "id": "does-not-fit",
            "text": "Does not fit properly",
            "options": [
              {
                "id": "item-too-big",
                "text": "Item too big"
              },
              {
                "id": "item-too-small",
                "text": "Item too small"
              }
            ]
          },
          {
            "id": "item-damaged",
            "text": "Item was damaged",
            "options": [
              {
                "id": "arrived-damaged",
                "text": "Item arrived damaged",
                "requestImage": true
              },
              {
                "id": "didnt-function",
                "text": "Item didn't function properly",
                "requestImage": true,
                "requestComments": true,
                "commentsLabel": "Please leave a comment",
                "customFields": [
                  {
                    "name": "batchNumber",
                    "label": "Batch Number",
                    "type": "text",
                    "placeholder": "Enter a batch number",
                    "validation": {
                      "pattern": {
                        "value": "^[A-Z0-9]{6,12}$",
                        "message": "Batch number must be 6-12 alphanumeric characters"
                      },
                      "required": {
                        "value": true,
                        "message": "Batch number is required"
                      },
                      "maxLength": {
                        "value": 50,
                        "message": "Maximum 50 characters allowed"
                      }
                    }
                  }
                ]
              }
            ]
          },
          {
            "id": "ordered-more-than-one-size",
            "text": "Ordered more than one size"
          },
        ]
      },
      {
        "id": "O222222",
        "name": "Silhouette Bra",
        "productType": "bra",
        "size": {
          "displayName": "B10",
          "cup": "B",
          "band": "10"
        },
        "image": "https://example.com/image2.png",
        "price": {
          "amount": 49.99,
          "currencyCode": "GBP"
        },
        "nonReturnableReason": "Not Returnable - Final Sale"
      }
    ]
  }
}

Properties

* indicates required field

FieldDescription
type*The current step_type.
nextType*The next step_type in the journey.
payload*Contains the details of the product selection.
payload.status*The status of the order (e.g., delivered).
payload.orderDate*The date the order was placed.
payload.deliveryDate*The date the order was delivered.
payload.confirmButtonText*The text displayed in the confirmation button.
payload.areReturnReasonsRequiredWhen true, return reasons must be selected.
payload.products[]*See below

Products

FieldDescription
products[].id*The unique identifier for the product.
products[].name*The name of the product.
products[].image*The URL of the product image.
products[].colourThe colour of the product.
products[].quantityThe quantity of the product.
products[].productTypeUsed to format the products size.displayName. e.g. shoe, bra.
products[].price*The price of the product.
products[].image*The URL of the product image.
products[].price.amount*The amount of the price.
products[].price.currencyCode*The currency code of the price. Supported codes: (GBP, USD, EUR)
products[].sizeSizing details object. If replacements are enabled, ensure to include values for all replacement options e.g. cup, band, width.
products[].size.displayNameThe size display name.
products[].size.sizeSystemThe products sizing system e.g. UK, US EU.
products[].nonReturnableReasonThe reason why the product is non-returnable. If present, the product cannot be selected for return.
products[].reasonsForReturn*See below

Reasons for Return

FieldDescription
reasonsForReturn[].id*The unique identifier for the reason for return.
reasonsForReturn[].text*The text description of the reason for return.
reasonsForReturn[].requestImageWhen true, the user has the option to upload images.
reasonsForReturn[].optionsA list of nested options, displayed when the parent item is clicked.
reasonsForReturn[].options[].id*The unique identifier for the nested return option.
reasonsForReturn[].options[].text*The text description of the nested return option.
reasonsForReturn[].options[].requestImageWhen true, the user has the option to upload images.
reasonsForReturn[].options[].requestCommentsWhen true, the user has the option to add comments.
reasonsForReturn[].options[].commentsLabelOptional label for the comments input.
reasonsForReturn[].options[].customFieldsOptional array of custom input fields - see below.

Reason for Return - Custom Fields

FieldDescription
customFields[].name*The input name.
customFields[].label*The label displayed above the input field.
customFields[].typeSpecifies the input type (e.g., text). Defaults to "text".
customFields[].placeholderSample text shown in the field as a guide for the user.
customFields[].validationDefines validation rules for the input.
customFields[].validation.required.valueWhether the input is required - true or false.
customFields[].validation.required.messageError message displayed when the required field is not populated.
customFields[].validation.pattern.valueA custom regex pattern that the entered text must conform to.
customFields[].validation.pattern.messageError message displayed when the entered value does not match the regex pattern.
customFields[].validation.maxLength.valueA number that defines the maximum number of characters.
customFields[].validation.maxLength.messageError message displayed when the character limit is exceeded.

selected_products example

[
    {
        "id": "O111111",
        "name": "Cloudrunner 2",
        "image": "https://example.com/image1.png",
        "colour": "Black",
        "quantity": 5,
        "size": {
          "displayName": "UK 9",
          "sizeSystem": "UK"
        },
        "price": {
          "amount": 149.99,
          "currencyCode": "GBP"
        },
        "returnReason": { // the selected return reason
            "id": "arrived-damaged",
            "text": "Item arrived damaged",
            "comments": "The laces are broken", // user comments (if requestComments is true)
            "attachments": [ // uploaded attachments (if requestImage is true)
              "https://example.com/attachment1.png",
              "https://example.com/attachment2.png"
            ],
            "batchNumber": "abc123", // The value of a customField (if defined)
        }
    }
]

What’s Next