Fluent Commerce Logo
Docs
Sign In

CreateCreditMemoForRevisedOrder

Rule

Changed on:

28 Nov 2023

Overview

The rule creates a CreditMemo for the BillingAccount using the supplied revised order details and the old order as well.

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 CreditMemo for the BillingAccount using the supplied revised order details and the old order as well.

Accepts

  • ORDER
  • BILLING ACCOUNT

Actions

  • This rule produces a createAction mutation that creates a credit memo

Rule parameters

Parameter

Description

creditMemoType

The credit memo type, default value = CREDIT_MEMO.

creditMemoItemType

The credit memo item type, default value = CREDIT_MEMO_ITEM.

Event attributes

Parameter

Description

Data Type

Required?

entityReference

The order reference

EntityReference object

Required

Exceptions

This rule will throw an IllegalArgumentException

  • if the 
    `accountId/retailerId/entityRef/entityReference`
     in event attributes property is not provided
  • if the revised order with ref and its items not found or invalid
  • if the old order with ref and its items not found or invalid
  • if failed to set up the taxType
  • if failed to handle the money

All generated exceptions will be wrapped with RubixException: 422.

Configuration example

1{
2  "name": "<ACCCOUNTID>.order.CreateCreditMemoForRevisedOrder",
3  "props": {
4    "creditMemoType": "CREDIT_MEMO",
5    "creditMemoItemType": "CREDIT_MEMO_ITEM"
6  }
7}

Language: json

Version History

2023-08-04

v1.0.0

refers to plugin