Skip to content

Customers

customers : object

Customer account functions.

Kind: global namespace

customers.getCustomerAccountInfo() ⇒ global.apis.shipping.Address | boolean

Get information about the active customer account.

Kind: static method of customers
Returns: global.apis.shipping.Address | boolean - An Address object with the customer's data, or false if no customer account associated with the transaction.

customers.getCustomerInfoByUUID(uuid) ⇒ global.apis.shipping.Address | boolean

Get information about a customer account using their UUID.

Kind: static method of customers
Returns: global.apis.shipping.Address | boolean - An Address object with the customer's data, or false if no customer exists with that UUID.

Param Type Description
uuid String Customer account UUID

customers.searchCustomerAccount(query, name, company, email, phone, state, country, zipcode) ⇒ Promise.<Array.<global.apis.shipping.Address>>

Search for a customer account. Fuzzy matches on name and company to allow typos/misspellings. Multiple fields can be used for better matches, except if query is present, the others are ignored.

Kind: static method of customers

Param Type Description
query String | null Freeform text to search by; can be a name, email, phone, UUID, etc.
name String | null Customer name or start of their name.
company String | null Customer business name.
email String | null
phone String | null
state String | null State abbrevation (NY, MT, DC, etc). For non-US states, use ISO 3166-2 code without the leading country code.
country String | null Two-letter ISO 3166 country code.
zipcode String | null Postal code.

Example

await searchCustomerAccount({query: "4067474477"});
  await searchCustomerAccount({name: "john doe", state: "MT"});

customers.setCustomerAccount(uuid) ⇒ Promise.<Array.<global.apis.shipping.Address>>

Set the customer for the current transaction.

Kind: static method of customers

Param Type Description
uuid String Customer account UUID.