Hierarchy

  • Products

Properties

impersonating: boolean = false

Methods

  • Description

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

    Example

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

    Returns Products

  • Create a new product. 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

    • TProduct extends Product<any, TProduct>

    Parameters

    Returns Promise<RequiredDeep<TProduct>>

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

    Parameters

    • productID: string

      ID of the product.

    • requestOptions: RequestOptions = {}

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

        ID of the seller.

      • Optional userGroupID?: string

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Generate variants. Check out the docs for more info

    Type Parameters

    • TProduct extends Product<any, TProduct>

    Parameters

    • productID: string

      ID of the product.

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

        Overwrite existing of the product.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TProduct>>

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

    Type Parameters

    • TVariant extends Variant<any, TVariant>

    Parameters

    • productID: string

      ID of the product.

    • variantID: string

      ID of the variant.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TVariant>>

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

    Type Parameters

    • TProduct extends Product<any, TProduct>

    Parameters

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

        ID of the catalog.

      • Optional categoryID?: string

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

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

        Comma-delimited list of fields to sort by.

      • Optional supplierID?: string

        ID of the supplier.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPageWithFacets<TProduct, any>>>

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

    Type Parameters

    Parameters

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

        ID of the buyer.

      • Optional level?: PartyType

        Level of the product 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 priceScheduleID?: string

        ID of the price schedule.

      • Optional productID?: string

        ID of the product.

      • Optional userGroupID?: string

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TProductAssignment>>>

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

    Type Parameters

    • TSpec extends Spec<any, any, TSpec>

    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")[];
      } = {}
      • 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")[]

        Comma-delimited list of fields to search on.

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

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TSpec>>>

  • Get a list of 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")[];
      } = {}
      • 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")[]

        Comma-delimited list of fields to search on.

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

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TProductSupplier>>>

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

    Type Parameters

    • TVariant extends Variant<any, TVariant>

    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")[];
      } = {}
      • 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<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 = {}

    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

    • TProduct extends Product<any, TProduct>

    Parameters

    • productID: string

      ID of the product.

    • product: Product<any>

      Required fields: Name

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TProduct>>

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

        ID of the default price schedule.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

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

    Type Parameters

    • TVariant extends Variant<any, TVariant>

    Parameters

    • productID: string

      ID of the product.

    • variantID: string

      ID of the variant.

    • variant: Variant<any>
    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TVariant>>

Generated using TypeDoc