ordercloud-javascript-sdk
    Preparing search index...

    Class Categories

    Index
    • Returns this

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

      Categories.As().List() // lists Categories using the impersonated users' token
      
    • Create a category Setting adjustListOrders to true will increase ListOrder for all categories with the same or higher ListOrder. Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • category: Category

        Required fields: Name

      • listOptions: { adjustListOrders?: boolean } = {}
        • OptionaladjustListOrders?: boolean

          Adjust list orders of the category.

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

    • Delete a category Deleting a parent category will also delete all of that category's children. Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

      • 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 category assignment Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

      • listOptions: { buyerID?: string; userGroupID?: string; userID?: string } = {}
        • OptionalbuyerID?: string

          ID of the buyer.

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

    • Delete a category bundle assignment Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

      • bundleID: string

        ID of the bundle.

      • 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 category product assignment Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

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

    • Retrieve a category Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

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

    • List categories Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • listOptions: {
            depth?: string;
            filters?: Filters;
            page?: number;
            pageSize?: number;
            search?: string;
            searchOn?: ("ID" | "Name" | "Description")[];
            sortBy?: ("ID" | "Name" | "!ID" | "!Name")[];
        } = {}
        • Optionaldepth?: string

          Depth 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?: ("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<TCategory>>>

    • List category assignments Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

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

          ID of the buyer.

        • OptionalcategoryID?: string

          ID of the category.

        • Optionallevel?: "Group" | "Company"

          Level of the category 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.

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

    • List category bundle assignments Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • listOptions: { bundleID?: string; categoryID?: string; page?: number; pageSize?: number } = {}
        • OptionalbundleID?: string

          ID of the bundle.

        • OptionalcategoryID?: string

          ID of the category.

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

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

    • List category product assignments Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • listOptions: { categoryID?: string; page?: number; pageSize?: number; productID?: string } = {}
        • OptionalcategoryID?: string

          ID of the category.

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

        • OptionalproductID?: 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<RequiredObjectDeep<ListPage<TCategoryProductAssignment>>>

    • Partially update a category Setting adjustListOrders to true will increase ListOrder for all categories with the same or higher ListOrder. Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

      • category: PartialDeep<Category>
      • listOptions: { adjustListOrders?: boolean } = {}
        • OptionaladjustListOrders?: boolean

          Adjust list orders of the partial 1.

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

    • Create or update a category If an object with the same ID already exists, it will be overwritten.

      Setting adjustListOrders to true will increase ListOrder for all categories with the same or higher ListOrder. Check out the docs for more info

      Type Parameters

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryID: string

        ID of the category.

      • category: Category

        Required fields: Name

      • listOptions: { adjustListOrders?: boolean } = {}
        • OptionaladjustListOrders?: boolean

          Adjust list orders of the category.

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

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

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryAssignment: CategoryAssignment

        Required fields: CategoryID, 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 category bundle assignment Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryBundleAssignment: CategoryBundleAssignment

        Required fields: CategoryID, BundleID

      • 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 category product assignment Check out the docs for more info

      Parameters

      • catalogID: string

        ID of the catalog.

      • categoryProductAssignment: CategoryProductAssignment

        Required fields: CategoryID, 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<void>