postCommerceStoreByStoreidAuthorizeWithHttpInfo method

Future<Response> postCommerceStoreByStoreidAuthorizeWithHttpInfo(
  1. String storeid
)

Authorize a new order against a storefront, holding the funds without settling them

Tallies a new order for the addressed store from the user, payment and order body, reserves its items, runs the processor authorization and answers the saved order with a Location header pointing at it. The gate is a token carrying admin or published scope, so a published storefront key is enough; no token is 401 and a token with neither bit is 403. The store is loaded BEFORE any payment work and its currency OVERRIDES whatever the body asked for, so a store that will not load ends the call with 500 and nothing is charged. On any authorization failure the reservations are released and the order and payment are persisted as cancelled, so a failed attempt still leaves a durable record. Capture is a separate call.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> postCommerceStoreByStoreidAuthorizeWithHttpInfo(String storeid,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/commerce/store/{storeid}/authorize'
    .replaceAll('{storeid}', storeid);

  // ignore: prefer_final_locals
  Object? postBody;

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

  const contentTypes = <String>[];


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