Skip to content
Merxian

Core concepts

Customers

A customer is a reusable profile of a buyer. A transaction can refer to it, so you do not send the buyer details again for each sale.

On this page

What a customer is#

A customer holds the details of a buyer who buys from you more than once: email, name, phone, country, and preferred language. A customer ID starts with cus_, for example cus_2Lp7XcN4vB8mQ1tKd.

You manage customers in the dashboard. The API has no customer endpoints.

Customers and transactions#

  • Set customerId on a transaction to use a stored customer.
  • Set buyer to give the buyer details for one transaction only. The fields in buyer override the stored customer values for that transaction.
  • When a transaction is finalized, Merxian freezes the buyer details with it. A later change to the customer does not change the transaction.

List the transactions of one customer with the customerId filter of List transactions.

Customer events#

Event Meaning
customer.created A customer was added to your account.
customer.updated A customer changed. data.previous_attributes holds the old values.

These events are opt-in. A new webhook endpoint does not receive them until you select them.

What to build#

  • Store the customer ID with your own user record.
  • To keep a copy of your customers, subscribe to the customer events.

Try refund, payment.succeeded,POST /v1/transactions, orIdempotency-Key.