Litium Connect ERP APIs supports order returns and refunding the money for those returns, including partial returns and refunding part of the money back to end customer. This section walks through a complete process of processing an order return.
For Litium 7.4 and later, see the Sales return management for more information on Sales Return Management process.
Swagger documentation
The web api endpoints in the following sections can be reached by:
https://<your domain>/Litium/Swagger?urls.primaryName=Litium%20Connect%20Erp%20version%202.0
Registering an order return
The order return may be initiated by the customer. Usually it can be by contacting the customer support or going the website to fill a special form.
When an order return is initiated (or warehousing system), notify Litium to create a RMA by sending a POST request to
/Litium/api/connect/erp/rmas
Litium stores the return slips and uses them to create the RMAs.
RMA is the primary document to approve an order return.
Approving the RMA
The created RMA above, can be set to the following states successively:
When the actual physical package is received by the warehouse, call the following:
/Litium/api/connect/erp/rmas/{systemId}/notify/packageReceived
When the package is inspected change the state to Processing by:
/Litium/api/connect/erp/rmas/{systemId}/notify/processing
Then approve the package by calling:
/Litium/api/connect/erp/rmas/{systemId}/action/approve
At this point, the return is accepted, and the RMA approval process is completed. Litium will automatically create the sales return order
Refunding the money
Refunding the money to the customer is done through the sales return order. This sales return order is automatically created during the process of RMA approval. The refund amount is automatically calculated by Litium.
Confirm the sales return order, so that the customer will be notified that their return is accepted:
/Litium/api/connect/erp/salesReturnOrders/{orderId}/action/confirmReturn
Then refund the money by using:
/Litium/api/connect/erp/salesReturnOrders/{orderId}/action/refund
Postman example
In this example, we simulate and ERP system by using Postman queries, which uses Litium connect ERP APIs. To use Postman, import "Litium Connect ERP - Order Partial Return" postman collection as below:
You can download it here.

There are 10 steps in the postman collection, which will call to application to do these steps:
1. Retrieve the order to run this step externalOrderId must be provided. We could try to book an order on Litium Connect for any two items with the quantity = 2 each and copy the order number to Postman variable:
Url : /litium/api/connect/erp/orders/

2: Create shipment: Create a full or partial shipment of the order.
On how to create a full or partial shipment , please check the Pre-req tab at 01 Get Order request.
Step 01 Get Order end-point.
/**
* If the articleNumbers variable is having some article numbers, this end-point will execute and receive a response then create a shipmentRows variable which contained these article numbers.
* If the articleNumbers variable is empty, this end-point will execute and receive a response then create a shipmentRows variable which contained all article numbers of this sales order.
* The shipmentRows variable will be automatical to pass to the Create Shipment end-point for creating one shipment contained these article numbers when the Create Shipment end-point executed.
* We can change or add these article numbers and quantity to be suitable to each testing case.
* Example for the articleNumbers variable is having some article numbers:
* var articleNumbers = [
{
ArticleNumber: "courtdress-l-001-638022225859406387",
Quantity: 1
}
];
*/
var articleNumbers = [<Insert Article Number here>];
Url : /Litium/api/connect/erp/orders/<externalOrderId>/shipments
3: Notify the shipment delivered: Update the shipment status to delivered. This will make Connect raise ReadyToShip event.
Url : /Litium/api/connect/erp/orders/{externalOrderId}/shipments/{shipmentId}/notify/delivered
Step 03 Notify order delivered end-point Pre-req. note:
/**
* If the shipmentId variable is empty, the shipmentId variable will get value from the response of the Create Shipment end-point.
*/
let shipmentId = "<insert shipment id here>";
4: Build Rma from return split: Start return process to return the first item in the delivered shipment. More info on sales return management process can be found here.
Url: /litium/api/connect/erp/rmas
Create RMA to from return script. This is the Pre-req. note of Request 04 - Send Return Slip
/**
* If the articleNumbers variable is having some article numbers, this script will create a returnRows variable which contained these article numbers and will be passed to request body.
* If the articleNumbers variable is empty, this script will create a returnRows variable which contained all article numbers from the shipmentRows variable of the Get Order end-point and will be passed to request body.
* When this end-point executed , it will receive a response and create a rmaSystemId variable with value from this response.
* We can change or add these article numbers and quantity to be suitable to each testing case
* Example for the articleNumbers variable is having some article numbers:
* var articleNumbers = [
{
ArticleNumber: "courtdress-l-001-638022225859406387",
Quantity: 1
}
];
*/
var articleNumbers = [];
5 to 7: Change Rma states all the way to Approved.
8 and 9: Retrieve and Confirm the Sales Return Order.
Step 09 Confirm return end-point Pre-req. note:
/**
* If the sroId variable is empty, the sroId variable will get value from the response of the Get Sales Return Order end-point.
*/
let sroId = "<Insert SRO ID here>";
10: Refund the money for the sales return order.
Url: /litium/api/connect/erp/salesReturnOrders/{saleReturnOrderId}/action/refund
Step 10 Refund money end-point Pre-req. note:
/**
* If the sroId variable is empty, the sroId variable will get value from the response of the Get Sales Return Order end-point.
*/
let sroId = "<Insert SRO ID here>";