An overview of the typical use case handling the cancelation of webshop orders which have not yet been invoiced.
As long as an order has not yet been invoiced, a customer may cancel the order or any order position at any point in time. When cancelling an order, a refund may be required if the payment has already been captured. If a refund is required, Accounting as a Service will automatically take care of the refund as part of the overall cancellation process. No additional processing is required on your end.
Once the order has been created in the accounting module using create webshop order, you can cancel any of the order positions until they have been invoiced.
When executing an order cancellation, the following sequence of steps takes place:
accounting/refundCompleted
once the initiated payment has been completed.To cancel an order, make a POST /accounting/v1/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/cancellations
request, where {businessCode}
is the related business entity, {customerNumber}
is the identifier of the related customer and {orderReference}
is the reference of the order (as indicated during the creation of the order) that you would like to be cancelled.
Please note that you can only cancel entire order positions. A partial cancellation of an order line / position is not possible.
For more information, please refer to the related endpoint description within the API Explorer.
POST /accounting/v1/businesses/1000/customers/TFI2021072801/orders/ODE12345678901/cancellations HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json
{
"cancellationDate": "2018-03-21T00:00:00.0000000+00:00",
"cancellationReason": "OUT_OF_STOCK",
"invoiceReference": "IDE12345678901",
"items": [
{
"orderItemReference": 1
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}
In some cases, your customer may want to receive the payment to a different account (IBAN) than to the account from where the origin payment was made or in case of some payment methods (e.g. omnichannel) Accounting as a Service may not know any payment instrument to refund yet. In this case, you can provide the information about the IBAN, bank account owner and BIC (in case the account is located outside the SEPA-area) to be used instead of the origin account. By default, the payment will be paid to the original payment method and account number.
In case a different account shall be used, the following fields are required:
IBANcode
bankAccountOwner
BIC
(only mandatory in case 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/cancellations HTTP/1.1
Host: api-uat.accounting.riverty.io
X-Subscription-Key: YOUR_API_SUBSCRIPTION_TOKEN
Content-Type: application/json
{
"cancellationDate": "2018-03-21T00:00:00.0000000+00:00",
"cancellationReason": "OUT_OF_STOCK",
"invoiceReference": "IDE12345678901",
"IBANcode": "DE89370400440532013000",
"bankAccountOwner": "Sammy Sample",
"BIC": "INGDDEFFXXX",
"items": [
{
"orderItemReference": 3
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}