Hierarchy

  • ApprovalRules

Properties

impersonating: boolean = false

Methods

  • Description

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

    Example

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

    Returns ApprovalRules

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

    Parameters

    • buyerID: string

      ID of the buyer.

    • approvalRule: ApprovalRule<any>

      Required fields: ApprovingGroupID, RuleExpression

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TApprovalRule>>

  • Delete an approval rule. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • approvalRuleID: string

      ID of the approval rule.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

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

    Type Parameters

    Parameters

    • buyerID: string

      ID of the buyer.

    • approvalRuleID: string

      ID of the approval rule.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TApprovalRule>>

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

    Type Parameters

    Parameters

    • buyerID: string

      ID of the buyer.

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

        Comma-delimited list of fields to search on.

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

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TApprovalRule>>>

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

    Type Parameters

    Parameters

    • buyerID: string

      ID of the buyer.

    • approvalRuleID: string

      ID of the approval rule.

    • approvalRule: ApprovalRule<any>

      Required fields: ApprovingGroupID, RuleExpression

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TApprovalRule>>

Generated using TypeDoc