Hierarchy

  • default
    • Adjustments

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Adjustments

Methods

  • Returns a list of adjustments. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IAdjustmentsResult>

  • Returns a single adjustment. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IAdjustmentResult>

  • Creates new adjustment 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.adjustments.create({
    bearer_token: '7381273269536713689562374856',
    adjustment: {
    order_id: 'string',
    label: 'Shipping costs',
    adjustable_id: 'string',
    adjustable_type: 'Spree::LineItem',
    source_id: 'string',
    source_type: 'Spree::TaxRate',
    amount: '10.9',
    mandatory: true,
    eligible: true,
    state: 'open',
    included: false
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & AdjustmentParams>

    Returns Promise<IAdjustmentResult>

  • Update selected Adjustment for the signed in User. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.adjustments.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    adjustment: {
    order_id: string,
    label: Shipping costs',
    adjustable_id: 'string',
    adjustable_type: 'Spree::LineItem',
    source_id: 'string',
    source_type: 'Spree::TaxRate',
    amount: 10.9,
    mandatory: true,
    eligible: true,
    state: 'open',
    included: false
    }
    })

    Parameters

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

    Returns Promise<IAdjustmentResult>

  • This endpoint removes the specified adjustment for the current user. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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