Customers & B2B
Identity, addresses, tax fields, and how customers get created.
A Customer ties a person (or business) to their saved cards, payment history, and billing defaults.
Identity is required
email and name are required at create — the card networks need both on every authorization, so we enforce it up front. Creating a customer without them returns 400.
1curl -X POST https://api.cxpay.net/v1/customers \2 # ...HMAC headers...3 -d '{ "email": "avery@example.com", "name": "Avery Lin" }'
B2B fields
is_company— mark the customer as a business. Affects receipt copy, VAT/invoice handling, and corporate-card SCA exemption eligibility.tax_id— VAT number, EIN, ABN, etc. Free-form; store whatever your jurisdiction needs.
Provenance
source records which surface minted the customer — api, merchant_dashboard, or checkout_session. It's server-controlled and immutable; source_id points at the parent (e.g. the cs_… for checkout-minted customers). Useful for auditing where a record came from.
Auto-minting at checkout
If you create a Checkout Session with customer_email (and customer_name) but no customer, we mint one for you with source: "checkout_session". Pass an existing customer id instead to attach the session to a known record.
Billing defaults
invoice_settings.default_payment_method and default_mandate set which saved card and mandate to use for recurring charges. Set them after saving a card.