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.
The Cancel Order interface supports various business scenarios where order cancellations are necessary, including:
Key Points: Ensure all mandatory fields are completed as per the API-Explorer's guidelines.
General Workflow
accounting/refundCompleted
once the initiated refund has been completed.To create an order, make a POST request to:
/accounting/v1/businesses/{businessCode}/customers/{customerNumber}/orders/{orderReference}/cancellations
{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 orderRequest Body Structure
Below is an example of a complete request body for cancelling an order:
{
"cancellationDate": "2024-09-09",
"cancellationReason": "OUT_OF_STOCK",
"items": [
{"orderItemReference": 1},
{"orderItemReference": 2}
]
}
Make sure you received feedback to the request validation via EDI Error Sent 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. For more details: Error Handling section
Description 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.
Implementation
Provide the position that has been used in the create order and provide this number in the orderItemReference
.
Example for a partial cancellation
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}
]
}
Description
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:
IBANcode
bankAccountOwner
BIC
(only mandatory in case the account is located outside the SEPA-area)Example for cancellation with alternative payment method
{
"bankDetails": {
"accountOwner": "John Doe",
"bic": "GENODEM1MSC",
"iban": "DE51100100501234567890"
},
"cancellationDate": "2018-03-21",
"cancellationReason": "CUSTOMER_CANCELLATION",
"invoiceReference": "IDE12345678903",
"items": [{
"orderItemReference": 4
}]
}
Description Accounting as a Service provides the option to differentiate the cancellation reasons for reporting purposes.
Reasons:
Implementation
The cancellation reason is provided in the cancellationReason
. Use the values OUT_OF_STOCK
, CUSTOMER_CANCELLATION
, NO_PAYMENT
, or CUSTOMER_SERVICE
.
Example for No Payment
{
"cancellationDate": "2024-09-09",
"cancellationReason": "NO_PAYMENT",
"items": [
{"orderItemReference": 1},
{"orderItemReference": 2},
{"orderItemReference": 3},
{"orderItemReference": 4}
]
}