Hierarchy

  • default
    • Orders

Constructors

  • Parameters

    • __namedParameters: EndpointOptions

    Returns Orders

Methods

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

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrdersResult>

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Creates a new Order 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.orders.create({
    bearer_token: '7381273269536713689562374856',
    order: {
    item_total: 170.9,
    total: 190.9,
    state: "cart",
    adjustment_total: 20,
    user_id: "1",
    completed_at: "2022-11-08 19:33:50 UTC",
    bill_address_id: "1",
    ship_address_id: "1",
    payment_total: 190.9,
    shipment_state: "backorder",
    payment_state: "balance_due",
    email: "hi@getvendo.com",
    special_instructions: "I need it ASAP!",
    currency: "USD",
    last_ip_address: "127.0.0.1",
    created_by_id: "1",
    shipment_total: 10,
    additional_tax_total: 10,
    promo_total: 0,
    channel: "online",
    included_tax_total: 0,
    item_count: 2,
    approver_id: "string",
    approved_at: "2022-11-08 19:33:50 UTC",
    confirmation_delivered: false,
    considered_risky: false,
    canceled_at: "string",
    canceler_id: "string",
    taxable_adjustment_total: 170.9,
    non_taxable_adjustment_total: 10,
    store_owner_notification_delivered: false,
    bill_address_attributes: {
    address: {
    country_id: "224",
    state_id: "516",
    state_name: "New York",
    address1: "5th ave",
    address2: "1st suite",
    city: "NY",
    zipcode: "10001",
    phone: "+1 123 456 789",
    alternative_phone: "string",
    firstname: "John",
    lastname: "Snow",
    label: "My home address",
    company: "Vendo Cloud Inc",
    user_id: "string",
    public_metadata: {
    distance_from_city_in_km: 10,
    location_type: "building"
    },
    private_metadata: {
    close_to_shop: true
    }
    }
    },
    ship_address_attributes: {
    address: {
    country_id: "224",
    state_id: "516",
    state_name: "New York",
    address1: "5th ave",
    address2: "1st suite",
    city: "NY",
    zipcode: "10001",
    phone: "+1 123 456 789",
    alternative_phone: "string",
    firstname: "John",
    lastname: "Snow",
    label: "My home address",
    company: "Vendo Cloud Inc",
    user_id: "string",
    public_metadata: {
    distance_from_city_in_km: 10,
    location_type: "building"
    },
    private_metadata: {
    close_to_shop: true
    }
    }
    }
    }
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & OrderParams>

    Returns Promise<IOrderResult>

  • Update selected Order. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.orders.update({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    order: {
    item_total: 170.9,
    total: 190.9,
    state: "cart",
    adjustment_total: 20,
    user_id: "1",
    completed_at: "2022-11-08 19:33:50 UTC",
    bill_address_id: "1",
    ship_address_id: "1",
    payment_total: 190.9,
    shipment_state: "backorder",
    payment_state: "balance_due",
    email: "hi@getvendo.com",
    special_instructions: "I need it ASAP!",
    currency: "USD",
    last_ip_address: "127.0.0.1",
    created_by_id: "1",
    shipment_total: 10,
    additional_tax_total: 10,
    promo_total: 0,
    channel: "online",
    included_tax_total: 0,
    item_count: 2,
    approver_id: "string",
    approved_at: "2022-11-08 19:33:50 UTC",
    confirmation_delivered: false,
    considered_risky: false,
    canceled_at: "string",
    canceler_id: "string",
    taxable_adjustment_total: 170.9,
    non_taxable_adjustment_total: 10,
    store_owner_notification_delivered: false,
    bill_address_attributes: {
    address: {
    country_id: "224",
    state_id: "516",
    state_name: "New York",
    address1: "5th ave",
    address2: "1st suite",
    city: "NY",
    zipcode: "10001",
    phone: "+1 123 456 789",
    alternative_phone: "string",
    firstname: "John",
    lastname: "Snow",
    label: "My home address",
    company: "Vendo Cloud Inc",
    user_id: "string",
    public_metadata: {
    distance_from_city_in_km: 10,
    location_type: "building"
    },
    private_metadata: {
    close_to_shop: true
    }
    }
    },
    ship_address_attributes: {
    address: {
    country_id: "224",
    state_id: "516",
    state_name: "New York",
    address1: "5th ave",
    address2: "1st suite",
    city: "NY",
    zipcode: "10001",
    phone: "+1 123 456 789",
    alternative_phone: "string",
    firstname: "John",
    lastname: "Snow",
    label: "My home address",
    company: "Vendo Cloud Inc",
    user_id: "string",
    public_metadata: {
    distance_from_city_in_km: 10,
    location_type: "building"
    },
    private_metadata: {
    close_to_shop: true
    }
    }
    }
    }
    })

    Parameters

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

    Returns Promise<IOrderResult>

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

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<NoContentResult>

  • Advances an Order. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Moves an Order to the next state. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Marks an Order as completed. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Removes all line items, promotions, shipment and payments from an Order. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Approves an Order, when using a token created for a user, it will save this user as the approver. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<IOrderResult>

  • Cancels an Order, when using a token created for a user, it will save this user as the canceler. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

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

    Parameters

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

    Returns Promise<NoContentResult>

  • Creates Store Credit payment for an Order. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.orders.useStoreCredit({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    amount: 0
    })

    Parameters

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

    Returns Promise<NoContentResult>

  • Applies Coupon Code for an Order. See api docs.

    Required token: Bearer token

    Success response schema: Success schema

    Failure response schema: Error schema

    Example:

    const response = await client.orders.applyCouponCode({
    bearer_token: '7381273269536713689562374856',
    id: '1',
    coupon_code: 'string'
    })

    Parameters

    • options: _DeepAnyObjectObject<RequiredAccountToken & IQuery & OrderCouponParams & {
          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