Fluent Commerce Logo
Docs
Sign In

CreateReturnOrderFromOrder

Rule

Changed on:

12 June 2024

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

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

All generated exceptions will be wrapped with RubixException: 422

Configuration example

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

Language: json

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

Version History

2023-08-04

v1.0.0

refers to plugin

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo