Skip to main content
A customer holds a name, email and phone number. Pass a customer’s id when you create a payment intent and checkout is filled in for them. If they chose to save a payment method before, it’s offered too.

Create a customer

To create a customer, use the modempay.customers.create() method, which allows you to add key information like the customer’s name, email, phone number, and an optional starting balance. The distinct option, when set to true, checks for existing customers with matching fields (e.g., email) to avoid duplicate entries. If distinct is omitted or set to false, a new customer entry will be created without duplicate checks. Sample Request:
Sample Response:

Retrieve a customer

To fetch a customer’s details, use modempay.customers.retrieve(customerId). Replace customerId with the customer’s unique ID. Sample Request:
Sample Response:

Update a customer

Update a customer’s information using modempay.customers.update(customerId, params). Specify the customer ID and the fields to update. Sample Request:
Sample Response:

Delete a customer

Remove a customer from your records using modempay.customers.delete(customerId). This action is irreversible. Sample Request:

List customers

To view all customers, use modempay.customers.list(). This returns a list of customers, with pagination options if there are many entries. Sample Request:
Sample Response:

List a customer’s saved payment methods

To retrieve the payment methods associated with a specific customer, use their customer ID. This is useful to manage or display available payment methods during checkout. Sample Request:
Sample Response: