gettestordertemplate method

Future<OrdersGetTestOrderTemplateResponse> gettestordertemplate(
  1. String merchantId,
  2. String templateName, {
  3. String? country,
  4. String? $fields,
})

Sandbox only.

Retrieves an order template that can be used to quickly create a new order in sandbox.

Request parameters:

merchantId - The ID of the account that should manage the order. This cannot be a multi-client account.

templateName - The name of the template to retrieve. Possible string values are:

  • "TEMPLATE1" : Get template1.
  • "TEMPLATE2" : Get template2.
  • "TEMPLATE1A" : Get template1A.
  • "TEMPLATE1B" : Get template1B.
  • "TEMPLATE3" : Get template3.
  • "TEMPLATE4" : Get template4.

country - The country of the template to retrieve. Defaults to "US".

$fields - Selector specifying which fields to include in a partial response.

Completes with a OrdersGetTestOrderTemplateResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<OrdersGetTestOrderTemplateResponse> gettestordertemplate(
  core.String merchantId,
  core.String templateName, {
  core.String? country,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (country != null) 'country': [country],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = commons.escapeVariable('$merchantId') +
      '/testordertemplates/' +
      commons.escapeVariable('$templateName');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return OrdersGetTestOrderTemplateResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}