Fluent Commerce Logo
Docs

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 NameOrder Reference Module
Namespace[[account.id]].order
The Order Reference Module is the foundation for order-related implementations. It provides reference workflows for click & collect, home delivery and mixed baskets and those needed to build your own. Extensible by design, use this Module as a base to build a solution to your customers' needs.

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

ParameterDescriptionData TypeRequired?
returnItemsThe list of return itemsArray listRequired
pickupLocationThe map of pickup addressMapOptional
lodgedLocationThe ref of lodged locationStringOptional
typeThe return order typeStringRequired
refThe order refStringOptional
returnAuthorisationKeyThe return authorisation key. Metadata fieldStringOptional
returnAuthorisationKeyExpiryThe return authorisation key expiry. Metadata fieldStringOptional
returnAuthorisationDispositionThe return authorisation disposition. Example:
`{`
`  value: “value”,`
`  label: “label`
`}`
JSONOptional
returnVerificationsThe return verifications. Example:
`{`
`  ref: “ref”,`
`  type: “type”,`
`  verificationDetails: “verificationDetails”`
`}`
JSONOptional
destinationLocationThe destination location.StringOptional
currencyThe currency. Example:
`{`
`  alphabeticCode: “code”`
`}`
JSONOptional
taxType`event.taxType` maps to GQL mutation `defaultTaxType`. Example:
`{`
`  country: “country”,`
`  group: “group”,`
`  tariff: “tariff”`
` }`
JSONOptional
subTotalAmountExample:
`{`
`  amount: 100`
`}`
JSONOptional
totalTaxExample:
`{`
`  amount: 100`
`}`
JSONOptional
totalAmountExample:
`{`
`  amount: 100`
`}`
JSONOptional

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
All generated exceptions will be wrapped with RubixException: 422

Configuration example

1{
2  "name": "<ACCOUNTID>.order.CreateReturnOrderFromOrder",
3  "props": {}
4}

Detailed Technical Description

Settings 

Setting NameUser TypeSetting TypeValue
DEFAULT_TAX_TYPERETAILER or ACCOUNTJSONExample:
{
"country": "AUS",
"group": "STANDARD",
"tariff": "GST"
} ```
DEFAULT_RETURN_DESTINATION_LOCATIONRETAILER or ACCOUNTSTRINGExample:
F_SYD or F_NSYD

Version History

2023-08-04

v1.0.0

refers to plugin