Hierarchy

  • default
    • Products

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Products

Methods

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

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.products.list({
    bearer_token: '7381273269536713689562374856'
    })

    Parameters

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

    Returns Promise<IProductsResult>

  • Returns a single Product by its ID. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.products.show({
    bearer_token: '7381273269536713689562374856'
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & {
          id: string;
      }>

    Returns Promise<IProductResult>

  • Creates a new Product and returns its attributes. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.products.create({
    bearer_token: '7381273269536713689562374856',
    product: {
    name: 'string',
    description: 'string',
    available_on: 'string',
    discontinue_on: 'string',
    permalink: 'string',
    meta_description: 'string',
    meta_keywords: 'string',
    price: 'string',
    sku: 'string',
    deleted_at: 'string',
    prototype_id: 'string',
    option_values_hash: 'string',
    weight: 'string',
    height: 'string',
    width: 'string',
    depth: 'string',
    shipping_category_id: 'string',
    tax_category_id: 'string',
    cost_currency: 'string',
    cost_price: 'string',
    compare_at_price: 'string',
    option_type_ids: 'string',
    taxon_ids: 'string',
    public_metadata: {},
    private_metadata: {}
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & ProductParams>

    Returns Promise<IProductResult>

  • Update the selected Product. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.products.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    product: {
    name: 'string',
    description: 'string',
    available_on: 'string',
    discontinue_on: 'string',
    permalink: 'string',
    meta_description: 'string',
    meta_keywords: 'string',
    price: 'string',
    sku: 'string',
    deleted_at: 'string',
    prototype_id: 'string',
    option_values_hash: 'string',
    weight: 'string',
    height: 'string',
    width: 'string',
    depth: 'string',
    shipping_category_id: 'string',
    tax_category_id: 'string',
    cost_currency: 'string',
    cost_price: 'string',
    compare_at_price: 'string',
    option_type_ids: 'string',
    taxon_ids: 'string',
    public_metadata: {},
    private_metadata: {}
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & ProductParams & {
          id: string;
      }>

    Returns Promise<IProductResult>

  • This endpoint removes the specified Product. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.products.remove({
    bearer_token: '7381273269536713689562374856',
    id: '1'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & Record<string, unknown> & {
          id: string;
      }>

    Returns Promise<NoContentResult>

  • 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