ordersGetCancellationPreviewWithHttpInfo method
Preview an order cancellation
Previews cancelling every item of an order now, with the totals. Requires the read order permission. Returns { orderId, currency, items, totals }, every amount in the order currency. Each item has orderItemId, productType and status. previewable items carry preview, the same payload as GET order-items/{id}/cancellation-preview (isRefundable: false included); notCancellable items carry a reason: notFulfilled (not delivered), refunded, refundInProgress (a refund was started and has not finished), amendmentInProgress, manualReview (contact support) or notAllowed (the product's rules do not allow cancelling it now). totals sums penaltyAmount, cancellationFee and refundAmount over the previewable items; totals.isComplete is true only when every item is previewable. The preview cancels nothing, changes no state and locks no amount: cancelling an item prices its cancellation again. Only an item the item preview refuses is notAllowed: a booking system that cannot answer right now fails this whole call, with 503 when it is unavailable, as it fails the item preview. Retry later. An order of another partner, or an unknown id, returns 404 with code 10004.
Note: This method returns the HTTP Response.
Parameters:
- String id (required):
Order id (
idfrom the order response).
Implementation
Future<Response> ordersGetCancellationPreviewWithHttpInfo(String id, { Future<void>? abortTrigger, }) async {
// ignore: prefer_const_declarations
final path = r'/api/v1/b2b/orders/{id}/cancellation-preview'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}