canCheckout()

canCheckout() determines whether a consumer is eligible to use Paze by checking if the provided lookup key (email address or mobile number) is associated with a Paze wallet. If both an email address and a mobile number are provided, the mobile number takes precedence. The SDK hashes the lookup key before transmission.

Request Parameters

emailAddress string conditional
emailAddress as customer identity must conform to the RFC 5322 address-spec syntax (lowercase).

Max: 128 characters
Condition: Required if a mobileNumber is not provided. mobileNumber takes precedence if both are provided.


mobileNumber string conditional
mobileNumber as customer identity is only supported as US based phone numbers. Formatting can include hyphens and country codes such as:

  • 5125555555
  • 512-555-5555
  • 15125555555
  • 1-512-555-5555

mobileNumber value MUST conform to the E.164 format without the plus sign.

Max: 15 characters
Condition: mobileNumber is required if emailAddress is not provided. mobileNumber takes precedence if both are provided.


Response Attributes

Response Fields

consumerPresent boolean required
consumerPresent is a boolean indicater if a Paze wallet exists for the lookup key in emailAddress or mobileNumber and has at least one card. Suspended wallets return true.


Promise – Resolve and Reject

resolve()
This is the JS Promise (fulfilled) call when the request is successfully processed by the Paze SDK.


reject()
This is the JS Promise call when there is an error. The object passed in is an error object as defined in the Errors section.


Code Example

await canCheckout({
  emailAddress: "[email protected]" // string (conditional) — required if mobileNumber not provided
  // mobileNumber: "15125555555",      // string (conditional) — required if emailAddress not provided
});

Response

{
  consumerPresent: true // boolean
}