Hierarchy

  • default
    • Countries

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Countries

Methods

  • Returns a list of all countries. See api docs.

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const countries = await client.countries.list()
    

    Parameters

    • Optional options: _DeepAnyObjectObject<Record<string, unknown> & Record<string, any>>

    Returns Promise<ICountriesResult>

  • Returns the details of a specific country. See api docs.

    Options schema:

    interface options {
    iso: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const country = await client.countries.show({
    iso: 'USA'
    })

    Parameters

    • options: _DeepAnyObjectObject<Record<string, unknown> & IQuery & {
          iso: string;
      }>

    Returns Promise<ICountryResult>

  • Returns the default country for the current store. By default this will be the US. See api docs.

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const countries = await client.countries.default()
    

    Parameters

    • Optional options: _DeepAnyObjectObject<Record<string, unknown> & IQuery & Record<string, any>>

    Returns Promise<ICountryResult>

  • Type Parameters

    • ResponseType = JsonApiResponse

    Parameters

    • method: HttpMethod
    • url: string
    • Optional tokens: IToken
    • Optional params: any
    • Optional responseParsing: ResponseParsing

    Returns Promise<ResultResponse<ResponseType>>

  • The HTTP error code returned by Spree is not indicative of its response shape. This function determines the information provided by Spree and uses everything available.

    Parameters

    • error: default

    Returns ErrorType

  • Parameters

    • error: Error

    Returns default

  • Parameters

    • error: default

    Returns default

  • Parameters

    • tokens: IToken

    Returns {
        [headerName: string]: string;
    }

    • [headerName: string]: string

Properties

fetcher: Fetcher

Generated using TypeDoc