Order Return Management Process

Litium Connect ERP APIs supports order returns and refunding the money for those returns, including partial returns and partial refunds. This section walks through a complete process of processing an order return.

Sales return management is a process of Litium Connect ( Litium 7.4 or later required).

Swagger documentation

The web api endpoints in the following sections can be reached by:

http://<your domain>/Litium/Swagger?urls.primaryName=Litium%20Connect%20Erp%20version%201.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 (Api 1.0 ref >>)

Note, that in Litium 7.4, Litium does not process the return slips. But it accepts the return slip to create the RMA.

RMA (Return merchandise authorization) is the primary document to approve an order return.

Approving the RMA

The created RMA above, need to be set to following states successively:

When the actual physical package is received by the warehouse, call 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}/approve

At this point, the return is accepted, and the RMA approval process is completed. Notify Litium about the completion of the RMA process. Litium will automatically create the Sales Return Order.

/Litium/api/connect/erp/rmas/{systemId}/notify/completed

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}/confirmReturn

Then refund the money by using

/Litium/api/connect/erp/salesReturnOrders/{orderId}/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.

Postman collection 2.PNG

There are 13 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 quality = 2 each and copy the order number to Postman variable: 

Url : /litium/api/connect/erp/orders/

Connect set variable.PNG

 

 

2: Order exported to ERP: This was the endpoint for the application to notify back to connect that the order was sent to ERP. This will change the order status to Processing.

Url : /litium/api/connect/erp/orders//OrderExportedToErp

 

3: Create partial shipment: Create a partial shipment for the first two items of the order. For example, this json will help to create a partial shipment for the first two items in order with shipping quality = 1 .

{
	"Id": "c40b8ba1-f165-4546-994b-7b4dbe69de70",
	"OrderId": "",
	"ShippingMethod": "Expresspaket",
	"Rows": [
		{
			"Id": "c40b8ba1-f165-4546-994b-7b4dbe69de69",
			"ArticleNumber": "",
			"Quantity": 1
		},
        {
			"Id": "c40b8ba1-f165-4546-994b-7b4dbe69des39",
			"ArticleNumber": "",
			"Quantity": 1
		}
		]
}

Url : /Litium/api/connect/erp/orders//shipment

 

4: Notify the first shipment delivered: Update the first shipment status to delivered. This will make Connect raise ReadyToShip event.

Url : /Litium/api/connect/erp/orders//deliveries//notify/delivered

 

5: 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 return the first item. Sample JSON: 

{
	"SystemId": "c40b8ba1-f165-4546-994b-7b4dbe69de69",
	"SalesOrderId": "",
	"FirstName": "Steve",
	"LastName": "Jobs",
	"Phone": "12345-6",
	"Email": "steve.job@app.com",
	"Comments": "my first rma",
	"CreatedDateUtc": "03/12/2019",
	"LastUpdatedDateUtc": "03/12/2019",
	"SalesOrderSystemId": "",
	"Rows": [
			{
				"ArticleNumber": "",
				"QuantityReturned": "1",
				"ReturnReason": "DamagedInShipment"
			}
		]
}

6 to 8: Change Rma states all the way to Approved.

 

9 and 10:  Retrieve and Confirm the Sales Return Order.

 

11: Refund the money for the sales return order.

Url: /litium/api/connect/erp/salesReturnOrders//refund

 

11: Create a second shipment, ship another two items of the order.

Url: /Litium/api/connect/erp/orders//shipment

Sample input JSON:

{
	"Id": "c40b8ba1-f165-4546-994b-7b4dbe69de70",
	"OrderId": "",
	"ShippingMethod": "Express",
	"Rows": [
		{
			"Id": "c40b8ba1-f165-4546-994b-7b4dbe69de69",
			"ArticleNumber": "",
			"Quantity": 1
		},
		{
			"Id": "c40b8ba1-f165-4546-994b-7b4dbe69de69",
			"ArticleNumber": "",
			"Quantity": 1
		}]
}

12: Notify the second shipment as delivered. If these was the last shipment of the order then the order state should be changed to Completed after this step.

Url: /Litium/api/connect/erp/orders//deliveries//notify/delivered