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:
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:
General Workflow:
To create an invoice, make a POST request to:
POST /accounting/v1/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/returns
{businessCode}
: Represents the legal entity (e.g., use "1000" in sandbox).{customerNumber}
: The end-customer’s unique identifier used in the create order{orderReference}
: The orderReference provided for the original order in the create orderKey Points: Ensure all mandatory fields are completed as per the API-Explorer.
Request Body Structure
Below is an example of a complete request body for returning an order (or parts of an order):
{
"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": 74.80,
"orderItemReference": 1,
"quantity": 1.0,
"vatAmount": 12.98,
"vatPercent": 21,
"vatType": "NORMAL"
}
]
}
invoiceReference
: Reference to the original invoice.returnDate
: Date when the return was processed.returnReason
: Reason for the return (e.g., CARRIER_RETURN, CUSTOMER_RETURN).returnReference
: Unique reference for the return transaction.items
: Details of the returned items, including line item reference, quantity, and applicable tax information.
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.
Description
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).
Example
{
"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"
}
}
Description
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.
Example
{
"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"
}
]
}