CreateReturnOrderFromOrder
Rule
Changed on:
8 Aug 2025
Overview
The rule creates a return entity. The return entity is then used to initiate the process of order items return.| Plugin Name | Order Reference Module |
|---|---|
| Namespace | [[account.id]].order |
UI Description
Creates a return entity. The return entity is then used to initiate the process of returning order items
Accepts
- ORDER
Actions
- This rule produces an action which triggers a GraphQL createReturnOrder mutation
Rule parameters
This rule does not identify any input parameters.
Event attributes
| Parameter | Description | Data Type | Required? |
| returnItems | The list of return items | Array list | Required |
| pickupLocation | The map of pickup address | Map | Optional |
| lodgedLocation | The ref of lodged location | String | Optional |
| type | The return order type | String | Required |
| ref | The order ref | String | Optional |
| returnAuthorisationKey | The return authorisation key. Metadata field | String | Optional |
| returnAuthorisationKeyExpiry | The return authorisation key expiry. Metadata field | String | Optional |
| returnAuthorisationDisposition | The return authorisation disposition. Example:`{`` value: “value”,`` label: “label``}` | JSON | Optional |
| returnVerifications | The return verifications. Example:`{`` ref: “ref”,`` type: “type”,`` verificationDetails: “verificationDetails”``}` | JSON | Optional |
| destinationLocation | The destination location. | String | Optional |
| currency | The currency. Example:`{`` alphabeticCode: “code”``}` | JSON | Optional |
| taxType | `event.taxType` maps to GQL mutation `defaultTaxType`. Example:`{`` country: “country”,`` group: “group”,`` tariff: “tariff”`` }` | JSON | Optional |
| subTotalAmount | Example:`{`` amount: 100``}` | JSON | Optional |
| totalTax | Example:`{`` amount: 100``}` | JSON | Optional |
| totalAmount | Example:`{`` amount: 100``}` | JSON | Optional |
Exceptions
This rule will throw an IllegalArgumentException
- if the
`accountId/retailerId/entityId/entityType/entitySubtype/entityStatus/event name/attributes`property is not provided - if the order not found
- if return settings
`DEFAULT_TAX_TYPE/DEFAULT_RETURN_DESTINATION_LOCATION`not found or invalid - if GraphQL mutation parameters are calculated incorrectly
Configuration example
1{
2 "name": "<ACCOUNTID>.order.CreateReturnOrderFromOrder",
3 "props": {}
4}Detailed Technical Description
Settings
| Setting Name | User Type | Setting Type | Value |
| DEFAULT_TAX_TYPE | RETAILER or ACCOUNT | JSON | Example: { "country": "AUS", "group": "STANDARD", "tariff": "GST" } ``` |
| DEFAULT_RETURN_DESTINATION_LOCATION | RETAILER or ACCOUNT | STRING | Example: F_SYD or F_NSYD |