Hierarchy

  • Categories

Properties

impersonating: boolean = false

Methods

  • Description

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

    Example

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

    Returns Categories

  • Create a new category. If ID is provided and an object with that ID already exists, a 409 (conflict) error is returned.

    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

    • TCategory extends Category<any, TCategory>

    Parameters

    • catalogID: string

      ID of the catalog.

    • category: Category<any>

      Required fields: Name

    • listOptions: {
          adjustListOrders?: boolean;
      } = {}
      • Optional adjustListOrders?: boolean

        Adjust list orders of the category.

    • requestOptions: RequestOptions = {}

    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 = {}

    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;
      } = {}
      • Optional buyerID?: string

        ID of the buyer.

      • Optional userGroupID?: string

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    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 = {}

    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 = {}

    Returns Promise<void>

  • Get a single category. Check out the docs for more info

    Type Parameters

    • TCategory extends Category<any, TCategory>

    Parameters

    • catalogID: string

      ID of the catalog.

    • categoryID: string

      ID of the category.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TCategory>>

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

    Type Parameters

    • TCategory extends Category<any, TCategory>

    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")[];
      } = {}
      • Optional depth?: string

        Depth of the category.

      • 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")[]

        Comma-delimited list of fields to search on.

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

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TCategory>>>

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

    Type Parameters

    Parameters

    • catalogID: string

      ID of the catalog.

    • listOptions: {
          buyerID?: string;
          categoryID?: string;
          level?: PartyType;
          page?: number;
          pageSize?: number;
          userGroupID?: string;
          userID?: string;
      } = {}
      • Optional buyerID?: string

        ID of the buyer.

      • Optional categoryID?: string

        ID of the category.

      • Optional level?: PartyType

        Level of the category assignment. Possible values: User, Group, Company.

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

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TCategoryAssignment>>>

  • Get a list of 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;
      } = {}
      • Optional bundleID?: string

        ID of the bundle.

      • Optional categoryID?: string

        ID of the category.

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

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TCategoryBundleAssignment>>>

  • Get a list of 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;
      } = {}
      • Optional categoryID?: string

        ID of the category.

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

        ID of the product.

    • requestOptions: RequestOptions = {}

    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

    • TCategory extends Category<any, TCategory>

    Parameters

    • catalogID: string

      ID of the catalog.

    • categoryID: string

      ID of the category.

    • category: PartialObjectDeep<Category<any>>
    • listOptions: {
          adjustListOrders?: boolean;
      } = {}
      • Optional adjustListOrders?: boolean

        Adjust list orders of the partial 1.

    • requestOptions: RequestOptions = {}

    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

    • TCategory extends Category<any, TCategory>

    Parameters

    • catalogID: string

      ID of the catalog.

    • categoryID: string

      ID of the category.

    • category: Category<any>

      Required fields: Name

    • listOptions: {
          adjustListOrders?: boolean;
      } = {}
      • Optional adjustListOrders?: boolean

        Adjust list orders of the category.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TCategory>>

Generated using TypeDoc