ordercloud-javascript-sdk
    Preparing search index...

    Class Addresses

    Index
    • Returns this

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

      Addresses.As().List() // lists Addresses using the impersonated users' token
      
    • Create an address Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • address: Address

        Required fields: Street1, City, Country

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      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 = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      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 } = {}
        • OptionaluserGroupID?: string

          ID of the user group.

        • OptionaluserID?: string

          ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>

    • Retrieve an address Check out the docs for more info

      Type Parameters

      Parameters

      • buyerID: string

        ID of the buyer.

      • addressID: string

        ID of the address.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TAddress>>

    • List addresses 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"
                | "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"
            )[];
        } = {}
        • Optionalfilters?: 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.???'

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • Optionalsearch?: string

          Word or phrase to search for.

        • OptionalsearchOn?: (
              | "ID"
              | "AddressName"
              | "CompanyName"
              | "City"
              | "Street1"
              | "Street2"
              | "LastName"
              | "FirstName"
              | "State"
              | "Zip"
          )[]

          Comma-delimited list of fields to search on.

        • OptionalsortBy?: (
              | "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 = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredObjectDeep<ListPage<TAddress>>>

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

          ID of the address.

        • OptionalisBilling?: boolean

          Is billing of the address assignment.

        • OptionalisShipping?: boolean

          Is shipping of the address assignment.

        • Optionallevel?: PartyType

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

        • Optionalpage?: number

          Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

        • OptionalpageSize?: number

          Number of results to return per page.

        • OptionaluserGroupID?: string

          ID of the user group.

        • OptionaluserID?: string

          ID of the user.

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      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

      Parameters

      • buyerID: string

        ID of the buyer.

      • addressID: string

        ID of the address.

      • address: Address

        Required fields: Street1, City, Country

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<RequiredDeep<TAddress>>

    • Create or update an address assignment Check out the docs for more info

      Parameters

      • buyerID: string

        ID of the buyer.

      • addressAssignment: AddressAssignment

        Required fields: AddressID

      • requestOptions: RequestOptions = {}
        • OptionalaccessToken?: string

          Alternative token to the one stored in the sdk instance (useful for impersonation).

        • OptionalcancelToken?: CancelToken

          Axios cancelToken that can be used to cancel the request.

        • OptionalrequestType?: string

          Identify the type of request. Useful for error logs.

      Returns Promise<void>