ordersRetryFulfillmentWithHttpInfo method

Future<Response> ordersRetryFulfillmentWithHttpInfo(
  1. String orderId,
  2. String idempotencyKey, {
  3. Future<void>? abortTrigger,
})

Retry an order's fulfillment

Starts delivery again for the order items that failed and can safely be bought again. Available when the order is processing, partiallyFulfilled or fulfillmentFailed and at least one item is confirmed as not delivered and not refunded, as actions.fulfillmentRetry shows. Fulfilled items are never bought again. Returns 202 with the order id and retriedItemIds, the items[].id values being retried; the outcome arrives later through the order, the fulfillment status endpoint and the order.fulfillment.updated webhook. An order that is not eligible, including one created in the dashboard, which must be retried there, returns 400 with code 10001. A concurrent retry of the same order returns 409. Requires an Idempotency-Key header (a UUID). Repeating a completed request with the same key returns 409 with code 12000 (IDEMPOTENCY_KEY_ALREADY_USED); one still running returns 409 with code 12002. Use a new key for each new retry attempt.

Note: This method returns the HTTP Response.

Parameters:

  • String orderId (required): Order id.

  • String idempotencyKey (required): UUID idempotency key for safe retries of this operation.

Implementation

Future<Response> ordersRetryFulfillmentWithHttpInfo(String orderId, String idempotencyKey, { Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/orders/{orderId}/fulfillment/retry'
    .replaceAll('{orderId}', orderId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  headerParams[r'Idempotency-Key'] = parameterToString(idempotencyKey);

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}