> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/sales-and-customer-orders/create-line-return-material-authorization.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Create Line Return Material Authorization

Creates an RMA for one delivered customer order line after gate checks, preview and explicit approval via CreateRmaFromCustomerOrderLines.

| Business area             | Action type                                |
| ------------------------- | ------------------------------------------ |
| Sales and Customer Orders | Updates IFS Cloud data after user approval |

## Overview

When a customer wants to return goods from a delivered order line, the IFS user opens the order, selects the line and runs RMA > Create. That command (HandleReturnMaterialAuthorizCreateCommand) is only enabled when HandleRmaViewCreateEnable is true, asks for a return reason and whether connected charge lines should be added, then calls the action CreateRmaFromCustomerOrderLines.

IFS Cloud reads customer order lines and creates RMAs through CustomerOrderHandling.

## How it works

{% stepper %}
{% step %}
Get Order Line Return Profile.
{% endstep %}

{% step %}
Check Rma Create Allowed and quantity sanity.
{% endstep %}

{% step %}
List Rma Lines For Order Line (duplicate check)
{% endstep %}

{% step %}
Validate Return Reason.
{% endstep %}

{% step %}
Check Connected Charges for AddChargeLines.
{% endstep %}

{% step %}
Preview. Obtain approvaltoken bound to line keys and reason.
{% endstep %}
{% endstepper %}

## Key capabilities

* Read one customer order line's return-relevant data (state, supply code, ownership, delivered, returned and invoiced quantities).
* Run the IFS eligibility function HandleRmaViewCreateEnable (same gate as the UI command).
* Detect existing RMA lines for the order line to avoid duplicates.
* Validate the return reason code against ReturnMaterialReasons.
* Detect connected charge lines (ExistChargeOnOrderLine) and ask whether to include them.
* Preview the exact action payload and require explicit user approval.
* Create the RMA with CreateRmaFromCustomerOrderLines for one line only.
* Read back the created RMA line and report the RMA number, state and quantity.
* Report IFS messages (multiple invoices, freight/promotion charges not added).

{% hint style="info" %}
This skill keeps a human in the loop. It previews every change and updates IFS Cloud only after a user approves it.
{% endhint %}

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection                               |
| --------- | ---------------------------------------- |
| ORDER     | CustomerOrderHandling                    |
| ORDER     | ReturnMaterialReasonsHandling            |
| ORDER     | ReturnMaterialAuthorizationLinesHandling |

## Version compatibility

| Projection                               | Supported IFS Cloud releases |
| ---------------------------------------- | ---------------------------- |
| CustomerOrderHandling                    | 24R2, 25R1, 25R2, 26R1, 26R2 |
| ReturnMaterialReasonsHandling            | 24R2, 25R1, 25R2, 26R1, 26R2 |
| ReturnMaterialAuthorizationLinesHandling | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Write paths require explicit user confirmation or authorization where configured.
