Hierarchy

  • Addresses

Properties

impersonating: boolean = false

Methods

  • Description

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

    Example

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

    Returns Addresses

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

    • TAddress extends Address<any, TAddress>

    Parameters

    • buyerID: string

      ID of the buyer.

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TAddress>>

  • Delete an address. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • addressID: string

      ID of the address.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Delete an address assignment. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • addressID: string

      ID of the address.

    • listOptions: {
          userGroupID?: string;
          userID?: string;
      } = {}
      • Optional userGroupID?: string

        ID of the user group.

      • Optional userID?: string

        ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

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

    Type Parameters

    • TAddress extends Address<any, TAddress>

    Parameters

    • buyerID: string

      ID of the buyer.

    • addressID: string

      ID of the address.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TAddress>>

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

    Type Parameters

    • TAddress extends Address<any, TAddress>

    Parameters

    • buyerID: string

      ID of the buyer.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "AddressName" | "CompanyName" | "City" | "Street1" | "Street2" | "LastName" | "FirstName" | "State" | "Zip")[];
          sortBy?: ("ID" | "AddressName" | "CompanyName" | "City" | "Street1" | "Street2" | "LastName" | "FirstName" | "State" | "Zip" | "DateCreated" | "Country" | "Phone" | "!AddressName" | "!ID" | "!DateCreated" | "!CompanyName" | "!FirstName" | "!LastName" | "!Street1" | "!Street2" | "!City" | "!State" | "!Zip" | "!Country" | "!Phone")[];
      } = {}
      • 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" | "AddressName" | "CompanyName" | "City" | "Street1" | "Street2" | "LastName" | "FirstName" | "State" | "Zip")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "AddressName" | "CompanyName" | "City" | "Street1" | "Street2" | "LastName" | "FirstName" | "State" | "Zip" | "DateCreated" | "Country" | "Phone" | "!AddressName" | "!ID" | "!DateCreated" | "!CompanyName" | "!FirstName" | "!LastName" | "!Street1" | "!Street2" | "!City" | "!State" | "!Zip" | "!Country" | "!Phone")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TAddress>>>

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

    Type Parameters

    Parameters

    • buyerID: string

      ID of the buyer.

    • listOptions: {
          addressID?: string;
          isBilling?: boolean;
          isShipping?: boolean;
          level?: PartyType;
          page?: number;
          pageSize?: number;
          userGroupID?: string;
          userID?: string;
      } = {}
      • Optional addressID?: string

        ID of the address.

      • Optional isBilling?: boolean

        Is billing of the address assignment.

      • Optional isShipping?: boolean

        Is shipping of the address assignment.

      • Optional level?: PartyType

        Level of the address 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<TAddressAssignment>>>

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

    Type Parameters

    • TAddress extends Address<any, TAddress>

    Parameters

    • buyerID: string

      ID of the buyer.

    • addressID: string

      ID of the address.

    • address: Address<any>

      Required fields: Street1, City, State, Zip, Country

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TAddress>>

Generated using TypeDoc