Initialising a Return

Example initialisation flow

Prerequisites

Before initialising the returns portal, a check should be made in flow to ensure the order is eligible to return (e.g. the status is Delivered).

If the return is overdue, please display the return overdue component.

If the order has not yet been delivered, please display the order tracker component.

1. Create Returns Flow

In your customers dashboard, create a new flow, the name should be something along the lines of Returns Master.

Give the flow a unique External Account Key - ensure there are no spaces.

2. Get Order Number

Within the chat flow, capture the users order number, we recommend using a form component.

3. Send Initialise Message

Once we have the relevent order number, we can initialise the returns portal.

Add an Advanced Chat Activity with the following properties:

{
  "type": "initialise_return",
  "returnFlowId": "*****", // id of the flow created in step 1
  "externalAccountKey": "*****", // the external account key of the flowcreated in step 1
  "inputs": {
    "order_number": "*****" // the order number collected in Step 2
  }
}

The returns flow will be executed with any properties defined in the inputs object. But only order_number is required.

E.g.

{
  "type": "initialise_return",
  "returnFlowId": "*****",
  "externalAccountKey": "*****",
  "inputs": {
    "order_number": "*****", // required
    "step_type": "return_details", // (optional) initialise the returns portal on a specific step. Defaults to product_selection
    "custom_property": "some_value" // (optional) any additional properties to be passed to the returns flow
  }
}

4. Handle Failed Initialisation

If for whatever reason an error occurs during initialisation, the flow should send an initialise_return_error message.

This is displayed as an error popop in the widget.

{
  "type": "initialise_return_error",
  "message": "We are sorry but your order could not be processed at this time!"
}

What’s Next