Hierarchy

  • Promotions

Properties

impersonating: boolean = false

Methods

  • Description

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

    Example

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

    Returns Promotions

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

    • TPromotion extends Promotion<any, TPromotion>

    Parameters

    Returns Promise<RequiredDeep<TPromotion>>

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

    Parameters

    • promotionID: string

      ID of the promotion.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete a promotion assignment. Check out the docs for more info

    Parameters

    • promotionID: string

      ID of the promotion.

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

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

    Type Parameters

    • TPromotion extends Promotion<any, TPromotion>

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "Name" | "Description" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[];
          sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[];
      } = {}
      • 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" | "Code" | "FinePrint" | "EligibleExpression" | "ValueExpression")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "Name" | "ExpirationDate" | "Code" | "EligibleExpression" | "ValueExpression" | "!ID" | "!Name" | "!ExpirationDate" | "StartDate" | "CanCombine" | "AutoApply" | "Active" | "Priority" | "!Code" | "!StartDate" | "!EligibleExpression" | "!ValueExpression" | "!CanCombine" | "!AutoApply" | "!Active" | "!Priority")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TPromotion>>>

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

    Type Parameters

    Parameters

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

        ID of the buyer.

      • Optional level?: PartyType

        Level of the promotion 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 promotionID?: string

        ID of the promotion.

      • Optional userGroupID?: string

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TPromotionAssignment>>>

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

    Type Parameters

    • TPromotion extends Promotion<any, TPromotion>

    Parameters

    • promotionID: string

      ID of the promotion.

    • promotion: Promotion<any>

      Required fields: Code, EligibleExpression

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TPromotion>>

Generated using TypeDoc