Hierarchy

  • Orders

Properties

impersonating: boolean = false

Methods

  • Add a promotion to an order. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • promoCode: string

      Promo code of the order promotion.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrderPromotion>>

  • AutoApply eligible promotions. Apply up to 100 eligible promotions to an order. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Description

    enables impersonation by calling the subsequent method with the stored impersonation token

    Example

    Orders.As().List() // lists Orders using the impersonated users' token
    

    Returns Orders

  • Complete an order. Use only when an order doesn't need a shipment. You will not be able to ship or reopen an order after completing it. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Create a new order. If ID is provided and an object with that ID already exists, a 409 (conflict) error is returned. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • order: Order<any, any, any>
    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Delete an order. Check out the docs for more info

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Forward an order. Creates and submits 0 or more outgoing Orders to Suppliers, one for each unique Product.DefaultSupplierID on this Order. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrderSplitResult>>

  • Get a list of orders. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • listOptions: {
          buyerID?: string;
          filters?: Filters;
          from?: string;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "FromCompanyID" | "ToCompanyID" | "Comments")[];
          searchType?: SearchType;
          sortBy?: ("ID" | "FromCompanyID" | "ToCompanyID" | "DateCreated" | "!ID" | "!DateCreated" | "DateSubmitted" | "FromUserID" | "Status" | "DateApproved" | "DateDeclined" | "DateCanceled" | "DateCompleted" | "LastUpdated" | "Subtotal" | "ShippingCost" | "TaxCost" | "Gratuity" | "PromotionDiscount" | "Total" | "IsSubmitted" | "!DateSubmitted" | "!FromCompanyID" | "!ToCompanyID" | "!FromUserID" | "!Status" | "!DateApproved" | "!DateDeclined" | "!DateCanceled" | "!DateCompleted" | "!LastUpdated" | "!Subtotal" | "!ShippingCost" | "!TaxCost" | "!Gratuity" | "!PromotionDiscount" | "!Total" | "!IsSubmitted")[];
          supplierID?: string;
          to?: string;
      } = {}
      • Optional buyerID?: string

        ID of the buyer.

      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional from?: string

        Lower bound of date range that the order was created.

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "FromCompanyID" | "ToCompanyID" | "Comments")[]

        Comma-delimited list of fields to search on.

      • Optional searchType?: SearchType

        Type of search to perform. Possible values: AnyTerm (default), AllTermsAnyField, AllTermsSameField, ExactPhrase, ExactPhrasePrefix.

      • Optional sortBy?: ("ID" | "FromCompanyID" | "ToCompanyID" | "DateCreated" | "!ID" | "!DateCreated" | "DateSubmitted" | "FromUserID" | "Status" | "DateApproved" | "DateDeclined" | "DateCanceled" | "DateCompleted" | "LastUpdated" | "Subtotal" | "ShippingCost" | "TaxCost" | "Gratuity" | "PromotionDiscount" | "Total" | "IsSubmitted" | "!DateSubmitted" | "!FromCompanyID" | "!ToCompanyID" | "!FromUserID" | "!Status" | "!DateApproved" | "!DateDeclined" | "!DateCanceled" | "!DateCompleted" | "!LastUpdated" | "!Subtotal" | "!ShippingCost" | "!TaxCost" | "!Gratuity" | "!PromotionDiscount" | "!Total" | "!IsSubmitted")[]

        Comma-delimited list of fields to sort by.

      • Optional supplierID?: string

        ID of the supplier.

      • Optional to?: string

        Upper bound of date range that the order was created.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrder>>>

  • Get a list of order approvals. Returns all Approvals associated with the Order. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("Comments" | "ApprovalRuleID" | "ApprovingGroupID" | "Approver")[];
          sortBy?: ("ApprovalRuleID" | "ApprovingGroupID" | "Approver" | "DateCreated" | "!DateCreated" | "!ApprovingGroupID" | "Status" | "DateCompleted" | "!Status" | "!DateCompleted" | "!ApprovalRuleID" | "!Approver" | "AllowResubmit" | "!AllowResubmit")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("Comments" | "ApprovalRuleID" | "ApprovingGroupID" | "Approver")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ApprovalRuleID" | "ApprovingGroupID" | "Approver" | "DateCreated" | "!DateCreated" | "!ApprovingGroupID" | "Status" | "DateCompleted" | "!Status" | "!DateCompleted" | "!ApprovalRuleID" | "!Approver" | "AllowResubmit" | "!AllowResubmit")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrderApproval>>>

  • Get a list of order eligible approvers. Returns all Users who can approve or decline this order (but have not done so). Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[];
          sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TUser>>>

  • List eligible promotions. Get a list of promotions eligible for an order. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[];
          sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrderPromotion>>>

  • Get a list of order promotions. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[];
          sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "DateApplied" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!DateApplied" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TOrderPromotion>>>

  • List shipments for an order. Check out the docs for more info

    Type Parameters

    • TShipment extends Shipment<any, any, any, TShipment>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "BuyerID" | "Shipper" | "DateShipped" | "DateDelivered" | "TrackingNumber")[];
          sortBy?: ("ID" | "BuyerID" | "Shipper" | "DateShipped" | "DateDelivered" | "!ID" | "OwnerID" | "!OwnerID" | "!BuyerID" | "Cost" | "!DateShipped" | "!Shipper" | "!DateDelivered" | "!Cost")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "BuyerID" | "Shipper" | "DateShipped" | "DateDelivered" | "TrackingNumber")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "BuyerID" | "Shipper" | "DateShipped" | "DateDelivered" | "!ID" | "OwnerID" | "!OwnerID" | "!BuyerID" | "Cost" | "!DateShipped" | "!Shipper" | "!DateDelivered" | "!Cost")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TShipment>>>

  • Partially update an order billing address. Not allowed on unsubmitted orders where BillingAddressID has been set. In that case, use the Addresses resource to update the saved address. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    Returns Promise<RequiredDeep<TOrder>>

  • Partially update an order shipping address. Not allowed on unsubmitted orders where ShippingAddressID has been set. In that case, use the Addresses resource to update the saved address. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    Returns Promise<RequiredDeep<TOrder>>

  • Remove a promotion from an order. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • promoCode: string

      Promo code of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Create or update an order. If an object with the same ID already exists, it will be overwritten. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • order: Order<any, any, any>
    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Set a billing address. Use only when the address is not to be saved/reused.

    To use a saved address (i.e. from the Addresses resource), PATCH the order's BillingAddressID property instead. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Set a shipping address. Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the order's ShippingAddressID property instead. The address used will be populated on the ShippingAddress property of each LineItem. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Create a new shipment containing all items on an order. Check out the docs for more info

    Type Parameters

    • TOrder extends Order<any, any, any, TOrder>

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • shipment: Shipment<any, any, any>
    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrder>>

  • Split an order. Creates, but does not submit, 0 or more outgoing Orders to Suppliers, one for each unique Product.DefaultSupplierID on this Order. Check out the docs for more info

    Type Parameters

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TOrderSplitResult>>

  • Validate an order in its current state. Check out the docs for more info

    Parameters

    • direction: OrderDirection

      Direction of the order, from the current user's perspective. Possible values: incoming, outgoing, all.

    • orderID: string

      ID of the order.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

Generated using TypeDoc