Skip to Main Content
Riverty Docs
riverty logo Docs

Return Order

The Return Order interface in Accounting as a Service is designed to handle the return of goods or licenses by customers. It allows clients to submit return data for processed orders, ensuring accurate booking of returned items, taxes, and discounts, as well as initiating refunds where applicable. This interface supports both standard returns initiated by customers and carrier returns where parcels were undeliverable. The process is integrated with existing order and invoice data, allowing seamless management of returns and associated refunds.

The Return Order interface allows clients to process returns when customers send back goods or when parcels are returned by carriers as undeliverable. There are two primary reasons for returns:

  • Carrier return: Used when the carrier returns the goods because the parcel was undeliverable (e.g., the end-customer was not home, did not pick up the parcel, or rejected it at the door).
  • Customer return: Used when the customer returns the goods for various reasons, such as not liking the product or it not fitting.

In both cases, a refund will be triggered if the end-customer has already paid for the goods and there is no outstanding amount on the end-customer’s account.

Key Points:

  • Prerequisites:
    • The order must have been created using the create order request and confirmed by Accounting as a Service via an Qualified response notification.
    • The line item must have been shipped and invoiced; the create invoice request must have been sent to Accounting as a Service and confirmed via Qualified response notification.
    • Partial Returns: The system supports partial returns (e.g., returning part of a line item). You are responsible for adjusting discounts and shipment fees that may no longer apply due to the return.
    • Multiple Return Requests: You can send multiple return requests for a single order, even for individual pieces of a line item. However, the order's value cannot increase due to the return process.
    • Refund Processing: If an open position is found on the end-customer account, it will be settled first before any refund is issued to the customer.

General Workflow:

  1. Order Creation: Order is placed using create order and confirmed by Accounting as a Service via Qualified response notification.
  2. Invoice and Shipment: Line items are shipped and invoiced; the create invoice request is confirmed by Accounting as a Service via Qualified response notification.
  3. Return Initiation: The customer or carrier returns goods or licenses, and you posts a return order request to Accounting as a Service.
  4. Validation and Confirmation: Accounting as a Service validates the return request and provides feedback (confirmation or error) via via Qualified response notification.
  5. Booking and Refund: Accounting as a Service books the returned revenue, taxes, and discounts of the returned line items and processes the refund (if configured).
  6. Notifications:
    a. Optionally, Accounting as a Service triggers the refund completed notification once the payment has been processed.
    b. Optionally, the end-customer is informed about the initiated refund via email.

You are responsible to provide the correct items that need to be considered (e.g. Discounts, Shipment-Discounts) and the correct values (considering previously granted goodwills). Accounting as a Service takes the values as given.

Path

POST /businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/returns

Request Parameters

businessCode
required
string
The business in the context of which this request is to be executed, e.g. 1000
customerNumber
required
string
The customer in the context of which this request is to be executed, e.g. TFI2021072801
orderReference
required
string
The order in the context of which this request is to be executed, e.g. TFI2021072801_03
X-Request-ID
string
The unique ID of this particular request/transaction. Subsequent requests with the same request ID might get ignored.

Request Body

application/json

object
invoiceReference
string
Max length: 30
maxLength(30)
Invoice number of referenced invoice
required
array
Values(>=1)
The individual items of the original order to be returned; if omitted, the entire order will be returned
returnDate
required
string
yyyy-MM-dd
Format(yyyy-MM-dd)
Date the return has been received
returnReason
required
string
Enum:
  • CARRIER_RETURN
  • CUSTOMER_RETURN
Reason for the return: * CARRIER_RETURN = carrier return * CUSTOMER_RETURN = customer return
returnReference
required
string
Max length: 30
maxLength(30)
External return reference (defined by order management system)

Responses

Return Order example

Request Example

    
        {
 "items": [
  {
   "vatType": "NORMAL",
   "quantity": 2.5,
   "vatAmount": 19.02,
   "vatPercent": 19,
   "grossUnitPrice": 119.12,
   "orderItemReference": 3
  }
 ],
 "returnDate": "2018-09-11",
 "bankDetails": {
  "bic": "GENODEM1MSC",
  "iban": "DE51100100501234567890",
  "accountOwner": "Max Mustermann"
 },
 "returnReason": "CUSTOMER_RETURN",
 "returnReference": "RDE12345678901",
 "invoiceReference": "IDE12345678901"
}
    

Response Example

    
        {
 "internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}
    

Use Cases

Return with Alternative Refund Payment Method (Bank Transfer)

In some scenarios, such as when the original payment method does not involve a PSP or bank account (e.g., Cash on Delivery or Omnichannel payments), Accounting as a Service may not have the necessary details to process a refund. In such cases, the client must provide alternative refund payment details in the return order request.

Implementation:

When processing a return that requires an alternative refund method, you have to request the details from the end-customer and include the customer's bank details within the return order request. This additional information allows Accounting as a Service to perform the refund via bank transfer, even when the original payment method does not directly support refunds. The bank details should include the account accountOwner, IBAN, and BIC (for non-SEPA countries).

Sample

{
    "invoiceReference": "ORDNL-9100250113",
    "returnDate": "2024-08-28",
    "returnReason": "CUSTOMER_RETURN",
    "returnReference": "RETNL-440025011",
    "items": [
        {
            "grossUnitPrice": 5.00,
            "orderItemReference": 2,
            "quantity": 1.0,
            "vatAmount": 0.87,
            "vatPercent": 21,
            "vatType": "NORMAL"
        }
    ],
    "bankDetails": {
        "accountOwner": "John Doe",
        "iban": "DE436345345344742",
        "bic": "BOFIIE2DXXX"
    }
}

Returns of Goods with Bundle Discounts

When customers purchase items as part of a bundle that includes a discount (e.g., "Buy 3, get 10% off"), returning a portion of the bundle can affect the eligibility for the discount. In such cases, you are responsible for recalculating the applicable discounts and including the relevant line items in the return order request.

Implementation

Include both the returned items and the discount that cannot be considered anymore in the return order request.

Sample

{
    "invoiceReference": "ORDNL-9100250113",
    "returnDate": "2024-08-28",
    "returnReason": "CUSTOMER_RETURN",
    "returnReference": "RETNL-440025011",
    "items": [
        {
            "grossUnitPrice": 5.00,
            "orderItemReference": 2,
            "quantity": 1.0,
            "vatAmount": 0.87,
            "vatPercent": 21,
            "vatType": "NORMAL"
        },
        {
            "grossUnitPrice": -2.00,  // Adjusted discount for the remaining items
            "orderItemReference": 3,  // Reference to the discount line item
            "quantity": 1.0,
            "vatAmount": -0.42,
            "vatPercent": 21,
            "vatType": "NORMAL"
        }
    ]
}