Hierarchy

  • default
    • Wishlists

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Wishlists

Methods

  • Returns a list of Wishlists. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    is_variant_included?: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.list({
    bearer_token: '7381273269536713689562374856',
    is_variant_included: '456'
    })

    Parameters

    • options: ListOptions

    Returns Promise<WishlistsResult>

  • Returns a single Wishlist. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string
    is_variant_included?: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.show({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: '123',
    is_variant_included: '456'
    })

    Parameters

    • options: ShowOptions

    Returns Promise<WishlistResult>

  • Returns the default Wishlist for the logged in user. It will be created, if the user does not have a default Wishlist for the current store. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    is_variant_included?: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.default({
    bearer_token: '7381273269536713689562374856',
    is_variant_included: '456'
    })

    Parameters

    • options: DefaultOptions

    Returns Promise<WishlistResult>

  • Creates a new Wishlist for the logged in user.

    Required token: Bearer token

    Options schema:

    interface options {
    name: string
    is_private?: boolean
    is_default?: boolean
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.create({
    bearer_token: '7381273269536713689562374856',
    name: 'My wishlist'
    })

    Parameters

    • options: CreateOptions

    Returns Promise<WishlistResult>

  • Updates an existing Wishlist.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string
    name: string
    is_private?: boolean
    is_default?: boolean
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.update({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: '123',
    name: 'My updated wishlist',
    is_private: true
    })

    Parameters

    • options: UpdateOptions

    Returns Promise<WishlistResult>

  • Removes a Wishlist. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.remove({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: '123'
    })

    Parameters

    • options: RemoveOptions

    Returns Promise<NoContentResult>

  • Adds a new Wished Item to a Wishlist for the logged in user. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string,
    variant_id: string
    quantity: number
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.addWishedItem({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: 'WyZxWS2w3BdDRHcGgtN1LKiY',
    variant_id: '1',
    quantity: 10
    })

    Parameters

    • options: AddWishedItemOptions

    Returns Promise<WishedItemResult>

  • Updates a Wished Item for the logged in user. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string,
    id: string
    quantity: number
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.updateWishedItem({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: 'WyZxWS2w3BdDRHcGgtN1LKiY',
    id: '2',
    quantity: 13
    })

    Parameters

    • options: UpdateWishedItemOptions

    Returns Promise<WishedItemResult>

  • Removes a Wished Item for the logged in user. See api docs.

    Required token: Bearer token

    Options schema:

    interface options {
    wishlist_token: string,
    id: string
    }

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.wishlists.removeWishedItem({
    bearer_token: '7381273269536713689562374856',
    wishlist_token: 'WyZxWS2w3BdDRHcGgtN1LKiY',
    id: '2'
    })

    Parameters

    • options: RemoveWishedItemOptions

    Returns Promise<WishedItemResult>

  • 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