ordercloud-javascript-sdk
    Preparing search index...

    Class LineItems

    Index
    • Returns this

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

      LineItems.As().List() // lists LineItems using the impersonated users' token
      
    • Create a line item Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItem: LineItem

        Required fields: ProductID

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TLineItem>>

    • Delete a line item Check out the docs for more info

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Retrieve a line item Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TLineItem>>

    • List line items Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • listOptions: {
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "ProductID")[];
            sortBy?: (
                "ID"
                | "ProductID"
                | "!ID"
                | "DateAdded"
                | "!DateAdded"
                | "!ProductID"
            )[];
        } = {}
        • Optionalfilters?: 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.???'

        • Optionalpage?: number

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

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "ProductID")[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: ("ID" | "ProductID" | "!ID" | "DateAdded" | "!DateAdded" | "!ProductID")[]

          Comma-delimited list of fields to sort by.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TLineItem>>>

    • List line item across orders Check out the docs for more info

      Type Parameters

      • TExtendedLineItem extends ExtendedLineItem<any, any, any, any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • listOptions: {
            buyerID?: string;
            filters?: Filters;
            from?: string;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "ProductID")[];
            searchType?: SearchType;
            sortBy?: (
                "ID"
                | "ProductID"
                | "!ID"
                | "DateAdded"
                | "!DateAdded"
                | "!ProductID"
            )[];
            supplierID?: string;
            to?: string;
        } = {}
        • OptionalbuyerID?: string

          ID of the buyer.

        • Optionalfilters?: 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.???'

        • Optionalfrom?: string

          Lower bound of date range that the order was created.

        • Optionalpage?: number

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

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: ("ID" | "ProductID")[]

          Comma-delimited list of fields to search on.

        • OptionalsearchType?: SearchType

          Type of search to perform.

        • OptionalsortBy?: ("ID" | "ProductID" | "!ID" | "DateAdded" | "!DateAdded" | "!ProductID")[]

          Comma-delimited list of fields to sort by.

        • OptionalsupplierID?: string

          ID of the supplier.

        • Optionalto?: string

          Upper bound of date range that the order was created.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TExtendedLineItem>>>

    • Partially update a line item shipping address Partially update the Shipping Address of the Line Item. Not allowed on unsubmitted Line Items 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

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • address: PartialDeep<Address>
      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TLineItem>>

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

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • lineItem: LineItem

        Required fields: ProductID

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TLineItem>>

    • Set a shipping address Set the Shipping Address of the Line Item. Appropriate only when the Address is not to be saved/reused. To use a Saved Address (i.e. from the Addresses resource), PATCH the Line Item's ShippingAddressID property instead. Check out the docs for more info

      Type Parameters

      • TLineItem extends LineItem<any, any, any, any, any>

      Parameters

      • direction: OrderDirection

        Direction of the order, from the current user's perspective.

      • orderID: string

        ID of the order.

      • lineItemID: string

        ID of the line item.

      • address: Address

        Required fields: Street1, City, Country

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TLineItem>>