Customer Matching

When you use .tokenize() OR .pay(), the API will attempt to find matching customer information according to these groups of demographics:

  • customer_id
  • email
  • company, address_1, address_city
  • firstname, phone
  • firstname, lastname, address_1, address_zip
  • lastname, phone
📘

A match is found when each field exists, and an exact match is found.


Examples

EX1:

Bob Smith at 123 North Way 32801 would not match Bobby Smith at 123 Noth Way 32801.

EX2:

If a match is found based on the provided demographics, the existing customer will be linked to the new payment method and transaction, and any additional demographics will not be stored.

For example, if a match is found for [email protected], but you also passed data like Address Line 1, and the existing Bob Smith didn’t have an address, then the new address will not be saved.

EX3:

If the matched customer has an email, that email address will receive the receipt.

Disabling Customer Matching

To disable matching pass,

match_customer: false

(as boolean false) with the rest of the fields when calling .pay() or`.tokenize()``

Using an existing customer_id

You are welcome to create a customer first using the POST/customer endpoint and then use the resulting customer_id in your Stax.js integration.

Both .pay() and .tokenize() accept a customer_id. When this value is passed, the customer will not be created, but instead the existing customer with the specified ID will be used for the new payment method (and invoice, payment if using .pay())

This also provides you with the ability to implement your customer matching and then specify the exact ID.