ordersGetFulfillmentStatus method
Get fulfillment status
Gets the current fulfillment state of every item in an order. Returns the order id, its items (the same item shape as the order, with each item's fulfillment status, typed result and failure) and fulfillmentVersion. The version increases with every meaningful fulfillment change, including a later revision of an already delivered result, and matches fulfillmentVersion in the order.fulfillment.updated webhook: keep the highest version you have seen and use this endpoint to recover after a missed delivery. Refunds and amendments do not change the version. An order of another partner, or an unknown id, returns 404 with code 10004.
Parameters:
- String orderId (required): Order id.
Implementation
Future<OrderFulfillmentStatus?> ordersGetFulfillmentStatus(String orderId, { Future<void>? abortTrigger, }) async {
final response = await ordersGetFulfillmentStatusWithHttpInfo(orderId, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OrderFulfillmentStatus',) as OrderFulfillmentStatus;
}
return null;
}