Cancel Order
The Cancel Order interface allows clients to cancel full or partial orders in the event that products are not available in the warehouse or if a customer requests a cancellation before the order has been shipped or invoiced. Cancellations can only occur for full order items (positions) rather than partial items within a position. It is essential to ensure that any associated discounts or related items are also canceled.
Standard Cancellation
The Cancel Order interface supports various business scenarios where order cancellations are necessary, including:
- Out of Stock: When items are unavailable in the warehouse.
- Customer Cancellation: When customers request to cancel their orders before shipment.
- No Payment Received for Prepaid Orders: When payment has not been received within the specified period for orders requiring prepayment.
- Customer Service Cancellation: Initiated by the customer service team for various reasons.
Key Points: Ensure all mandatory fields are completed as per the API-Explorer's guidelines.
General Workflow
- Order Creation: Customer places an order.
- Order Submission: The client sends the order to Accounting as a Service using the Create Order request.
- Order Confirmation: The client receives a confirmation via the EDI Error Sent notification.
- Cancellation Trigger: The customer requests cancellation, or the client initiates cancellation due to stock unavailability.
- Order Management System Update: The client updates the order management system to reflect the cancellation of the full order or specific positions.
- Cancellation Request Submission: The client sends a cancellation request via the Cancel Order API to Accounting as a Service.
- Confirmation or Error Handling: The client receives a confirmation via the EDI Error Sent notification or an error message and corrects the request if necessary.
In case the payment has already been captured, Accounting as a Service initiates a refund based on the received order cancellation request. - **(optional) Accounting as a Service triggers refund created notification once the initiated refund has been completed.
Response Handling
Make sure you received feedback to the request validation via Qualitative Response notification. Errors related to validation or processing are returned with descriptive messages to facilitate troubleshooting.If the cancellation could be processed without errors, a confirmation will be sent. It is important that the referred order has been processed correctly, otherwise the cancellation cannot be processed.
Path
POST /businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/cancellations Request Parameters
Request Body
application/json
Date the cancellation has been saved
- OUT_OF_STOCK
- CUSTOMER_CANCELLATION
- NO_PAYMENT
- CUSTOMER_SERVICE
Invoice number of referenced invoice
Responses
Request Example
{
"items": [
{
"orderItemReference": 3
}
],
"bankDetails": {
"bic": "GENODEM1MSC",
"iban": "DE51100100501234567890",
"accountOwner": "Max Mustermann"
},
"cancellationDate": "2018-03-21",
"invoiceReference": "IDE12345678901",
"cancellationReason": "OUT_OF_STOCK"
}
Response Example
{
"internalRequestId": "23c9579b-baaf-468f-a529-f876226e183c"
}
Use Cases for cancelling orders
Type of cancellation
You can either cancel parts of an order or the full order. However, only full line items can be cancelled. Accounting as a Service does not allow partial cancellations of a line item.
- Partial cancllation: only full line items can be cancelled (e.g. in case of unavailability of the product in the warehouse).
- Full cancellation: for full cancellations, you have to provide all line items in the items section that have been provided in the create order request originally.
Implementation:
Provide the position that has been used in the create order and provide this number in the orderItemReference.
Sample:
In this case only the line item 3 of the original order is cancelled:
{
"cancellationDate": "2024-09-09",
"cancellationReason": "OUT_OF_STOCK",
"items": [
{"orderItemReference": 3}
]
}
Cancel with / without refunds
- Cancellation with refund: If the customer already paid in the frontend (prepayment), the amount has to be refunded. This can either be initiated by Accounting as a Service or needs to be done by the client.
- Cancel an order with alternative payment method: If the original payment method cannot be refunded or does not exist anymore, or Accounting as a Service has no access (Omnichannel payments), the client can provide an IBAN as an alternative payment method that will be used to refund the amount resulting from the cancellation.
- Cancellation without refund: If the capture for the payment only takes place after the delivery, a refund is not necessary.
Implementation:
You dont have to provide any additional information in case for the refunds. This will be configured in the onboarding process and depends on whether the payment has taken place before the shipment was done or after. In case of alternative payment methods, Accounting as a Service supports the refund via bank transfer. For this you have to provide the following information:
IBANcodebankAccountOwnerBIC(only mandatory in case the account is located outside the SEPA-area)
Sample
{
"bankDetails": {
"accountOwner": "John Doe",
"bic": "GENODEM1MSC",
"iban": "DE51100100501234567890"
},
"cancellationDate": "2018-03-21",
"cancellationReason": "CUSTOMER_CANCELLATION",
"invoiceReference": "IDE12345678903",
"items": [{
"orderItemReference": 4
}]
}
Provide a reason for cancellations
Accounting as a Service provides the option to differentiate the cancellation reasons for reporting purposes.
possible Reasons:
- Out of Stock: When items are unavailable in the warehouse.
- Customer Cancellation: When customers request to cancel their orders before shipment.
- No Payment Received for Prepaid Orders: When payment has not been received within the specified period for orders requiring prepayment.
- Customer Service Cancellation: Initiated by the customer service team for various reasons.
Implementation
The cancellation reason is provided in the cancellationReason. Use the values
OUT_OF_STOCKCUSTOMER_CANCELLATIONNO_PAYMENTCUSTOMER_SERVICE
Sample
{
"cancellationDate": "2024-09-09",
"cancellationReason": "NO_PAYMENT",
"items": [
{"orderItemReference": 1},
{"orderItemReference": 2},
{"orderItemReference": 3},
{"orderItemReference": 4}
]
}