An overview of the typical use case handling the return of a webshop order.
An order can only be returned if the order has been invoiced using (create invoice for webshop order). When an order is returned, a refund is triggered via the original payment method. Alternatively, if the payment method does not allow or support a refund, the refund is triggered with a bank transfer. Accounting as a Service will automatically take care of the refund process as part of the overall returns procedure. No additional processing is required on your end.
When executing an order return, the following sequence of steps takes place:
accounting/refundCompleted
once the initiated payment has been completed.To return an order, make a POST /accounting/{version}/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/returns
request, where {businessCode}
is the related business entity, {customerNumber}
is the identifier of the affected customer and {orderReference}
is the reference of the related order.
IMPORTANT NOTE You can return single line items, full order lines, or entire orders. If you return line items that were reduced by a discount, you need to include the discount in the return request as well.
For more information, please refer to the related endpoint description within the API Explorer.
POST /accounting/v1/businesses/1000/customers/TFI2021072801/orders/ODE12345678901/returns HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json
{
"invoiceReference": "IDE12345678901",
"returnDate": "2018-09-11",
"returnReason": "CUSTOMER_RETURN",
"returnReference": "RDE12345678901",
"items": [{
"grossUnitPrice": 11.9,
"orderItemReference": 1,
"quantity": 1,
"vatAmount": 1.9,
"vatPercent": 19,
"vatType": "NORMAL"
}]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}
In some cases, your customer may wish to receive the payment to a his/her bank account (IBAN) instead of the original payment method the payment was made with. If you provide the IBAN with the return, Accounting as a Service will pay out to this specific IBAN independent of the original payment method and if the refund usually is triggered by your systems. If you want to use this process, you can specify the IBAN, bank account owner and BIC (if the account is located outside the SEPA-area) that should be used instead. By default, all other payments will be made using the original payment method and account details ifAccounting as a Service is responsible for the refund.
IMPORTANT NOTE If you want to make sure that Accounting as a Service does not process the payout to the IBAN eventhough you provide the IBAN in the return order request, Accounting as a Service can set up a validation rule which results in a hard error so that you can make sure only returns without an IBAN are processed and no additional payout takes place
If you need to make the payment to another account, the following fields are required:
IBANcode
bankAccountOwner
BIC
(this field is only mandatory if the account is located outside the SEPA-area)For more information, please refer to the related endpoint description within the API Explorer.
POST /accounting/v1/businesses/1000/customers/TFI2021072801/orders/ODE12345678901/returns HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json
{
"invoiceReference": "IDE12345678901",
"returnDate": "2018-09-11",
"returnReason": "CUSTOMER_RETURN",
"returnReference": "RDE12345678901",
"items": [{
"grossUnitPrice": 11.9,
"orderItemReference": 1,
"quantity": 1,
"vatAmount": 1.9,
"vatPercent": 19,
"vatType": "NORMAL"
}],
"IBANcode": "DE89370400440532013000",
"bankAccountOwner": "Sammy Sample",
"BIC": "INGDDEFFXXX"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}