Appeasements

Use case

The appeasement functionality is thought to resolve the scenario when a CS agent tries to calm an unsatisfied client with a refund. The appeasement is applied always at line level for virtual or physical products and also for shipping charges. The CS agent could refund partially or totally the amount of one or more lines, but never exceed the amount of any of these lines.

{
    "appeasement": {
        "credit_note_date": "2018-03-15T11:18:25+00:00",
        "lines": [
            {
                "amount": "48.71",
                "id": "85",
                "line_number": "1",
                "reason": "Item too big",
                "reason_description": "Item too big"
            }
        ],
        "order_id": "100000000000001",
        "sales_channel_id": "200001",
        "user": "userB"
    }
}

Once the appeasement is created, an event message will notify it to 3rd party systems.

{
    "refund": {
        "credit_note_date": "2018-03-15T11:18:26+00:00",
        "credit_note_number": "CUS148",
        "custom_attributes": [],
        "lines": [
            {
                "order_item_id": "190",
                "order_line": "1",
                "payments": [
                    {
                        "details": {
                            "cost_gross": "48.71",
                            "cost_net": "44.99",
                            "cost_vat": "3.72",
                            "vat_detail": [
                                {
                                    "amount": "3.72",
                                    "rate": "8.25",
                                    "type": "VAT"
                                }
                            ],
                            "vat_rate": "8.25"
                        },
                        "status": {
                            "code": "REFUNDED",
                            "name": "REFUNDED"
                        }
                    }
                ],
                "reason": "Item too big",
                "reason_description": "Item too big"
            }
        ],
        "order_id": "100000000000001",
        "refund_reason": "RELEASESUCCESS",
        "refund_type": "Appeasement",
        "rma": "",
        "sales_channel_id": "200001",
        "status": {
            "code": "RELEASED",
            "date": "2018-03-15T11:18:26+00:00",
            "name": "RELEASED",
            "reason_code": "RELEASESUCCESS",
            "reason_name": "RELEASESUCCESS"
        },
        "store_id": "200001",
        "user": "userB"
    }
}

Solution considerations

  1. Appeasements are created at line level and over the gross amount.
  2. A reason and reason description must be provided.
  3. Appeasements are created only when the payment gateway has confirmed to the OMS the payment has been captured.
  4. The credit note number associated to the appeasement is automatically generated by the OMS.
  5. Appeasements could be a partial or total amount of the line but cannot exceed the total amount of the line.

Magento Commerce Integration

Refunds in Magento Commerce work differently than in MOM. Magento Commerce allows to have multiple refunds at order level but just one per order line, whereas MOM only allows to have multiple refunds at order line level. In order to match appeasements in both systems, the appeasements created at line level in MOM are translated to order level appeasements in Magento Commerce.