Hierarchy

  • default
    • StockLocations

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns StockLocations

Methods

  • Returns a list of Stock Locations. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IStockLocationsResult>

  • Returns a single Stock Location 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.stockLocations.show({
    bearer_token: '7381273269536713689562374856'
    id: '1'
    })

    Parameters

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

    Returns Promise<IStockLocationResult>

  • Creates a new Stock Location 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.stockLocations.create({
    bearer_token: '7381273269536713689562374856',
    stock_location: {
    name: 'Warehouse 3',
    default: true,
    address1: 'South St. 8',
    address2: 'South St. 109',
    country_id: '2',
    state_id: '4',
    city: 'Los Angeles',
    state_name: 'California',
    zipcode: '90005',
    phone: '23333456',
    active: true,
    backorderable_default: true,
    propagate_all_variants: true,
    admin_name: 'string'
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & StockLocationParams>

    Returns Promise<IStockLocationResult>

  • Update selected Stock Location. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.stockLocations.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    stock_location: {
    name: 'Warehouse 3',
    default: true,
    address1: 'South St. 8',
    address2: 'South St. 109',
    country_id: '2',
    state_id: '4',
    city: 'Los Angeles',
    state_name: 'California',
    zipcode: '90005',
    phone: '23333456',
    active: true,
    backorderable_default: true,
    propagate_all_variants: true,
    admin_name: 'string'
    }
    })

    Parameters

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

    Returns Promise<IStockLocationResult>

  • This endpoint removes the specified Stock Location. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.stockLocations.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