ordercloud-javascript-sdk
    Preparing search index...

    Class Products

    Index
    • Returns this

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

      Products.As().List() // lists Products using the impersonated users' token
      
    • Delete a product Check out the docs for more info

      Parameters

      • productID: string

        ID of the product.

      • 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>

    • Delete a product assignment Check out the docs for more info

      Parameters

      • productID: string

        ID of the product.

      • buyerID: string

        ID of the buyer.

      • listOptions: { sellerID?: string; userGroupID?: string; userID?: string } = {}
        • OptionalsellerID?: string

          ID of the seller.

        • OptionaluserGroupID?: string

          ID of the user group.

        • OptionaluserID?: string

          ID of the user.

      • 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>

    • Generate variants Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • variantOverrides: VariantOverrides
      • listOptions: { overwriteExisting?: boolean } = {}
        • OptionaloverwriteExisting?: boolean

          Overwrite existing of the product.

      • 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<TProduct>>

    • Retrieve a product Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • 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<TProduct>>

    • Retrieve a product variant Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • variantID: string

        ID of the variant.

      • 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<TVariant>>

    • List products Check out the docs for more info

      Type Parameters

      Parameters

      • listOptions: {
            catalogID?: string;
            categoryID?: string;
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: string[];
            searchType?: SearchType;
            sortBy?: string[];
            supplierID?: string;
        } = {}
        • OptionalcatalogID?: string

          ID of the catalog.

        • OptionalcategoryID?: string

          ID of the category.

        • 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?: string[]

          Comma-delimited list of fields to search on.

        • OptionalsearchType?: SearchType

          Type of search to perform.

        • OptionalsortBy?: string[]

          Comma-delimited list of fields to sort by.

        • OptionalsupplierID?: string

          ID of the supplier.

      • 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<ListPageWithFacets<TProduct, any>>>

    • List product assignments Check out the docs for more info

      Type Parameters

      Parameters

      • listOptions: {
            buyerID?: string;
            level?: "Group" | "Company";
            page?: number;
            pageSize?: number;
            priceScheduleID?: string;
            productID?: string;
            userGroupID?: string;
        } = {}
        • OptionalbuyerID?: string

          ID of the buyer.

        • Optionallevel?: "Group" | "Company"

          Level of the product assignment. Possible values: Group, Company, BuyerGroup.

        • 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.

        • OptionalpriceScheduleID?: string

          ID of the price schedule.

        • OptionalproductID?: string

          ID of the product.

        • OptionaluserGroupID?: string

          ID of the user group.

      • 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<TProductAssignment>>>

    • List product specs Check out the docs for more info

      Type Parameters

      • TSpec extends Spec<any, any>

      Parameters

      • productID: string

        ID of the product.

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

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: ("ID" | "Name" | "!ID" | "!Name" | "ListOrder" | "!ListOrder")[]

          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<TSpec>>>

    • List product suppliers Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

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

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: ("ID" | "Name" | "DateCreated" | "!ID" | "!DateCreated" | "!Name")[]

          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<TProductSupplier>>>

    • List product variants Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

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

          Comma-delimited list of fields to search on.

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

          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<TVariant>>>

    • Partially update a product variant Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • variantID: string

        ID of the variant.

      • variant: PartialDeep<Variant>
      • 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<TVariant>>

    • Remove a product supplier Check out the docs for more info

      Parameters

      • productID: string

        ID of the product.

      • supplierID: string

        ID of the supplier.

      • 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>

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

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • product: Product

        Required fields: Name

      • 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<TProduct>>

    • Create or update a product assignment Check out the docs for more info

      Parameters

      • productAssignment: ProductAssignment

        Required fields: ProductID, BuyerID

      • 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>

    • Create or update a product supplier Check out the docs for more info

      Parameters

      • productID: string

        ID of the product.

      • supplierID: string

        ID of the supplier.

      • listOptions: { defaultPriceScheduleID?: string } = {}
        • OptionaldefaultPriceScheduleID?: string

          ID of the default price schedule.

      • 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>

    • Update a product variant Update a product variant. Check out the docs for more info

      Type Parameters

      Parameters

      • productID: string

        ID of the product.

      • variantID: string

        ID of the variant.

      • variant: Variant
      • 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<TVariant>>