Return webshop order

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.

How it works

When executing an order return, the following sequence of steps takes place:

  1. (Prerequisite) Order has been placed using create webshop order.
  2. Customer sends goods/licences back to merchant.
  3. Merchant passes request for order return to Accounting as a Service.
  4. Accounting as a Service takes over the booking of the revenue, taxes and discounts.
  5. Accounting as a Service takes over the refund towards the customer.
  6. Accounting as a Service triggers a notification of type accounting/refundCompleted once the initiated payment has been completed.
  7. (Optional) Accounting as a Service informs the customer about the initiated payment via email.
  8. (Optional) Merchants reviews the payment booking using MyAccounting.
High-level process description
An overview using BPMN to describe the process flow
Checkout the BPMN illustration to get an overview of the process, including the various activities and participating main actors.

How to implement

Return a webshop order

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.

Sample request
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"
    }]
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json

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

Return an order with refund to specific IBAN

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"
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json

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

See also