cus_…) is a stable identity stored under your merchant account. Attach payment methods to a customer to enable off-session charges, subscriptions, and invoice delivery from a single profile.
On Node, npm install @ionicfi/sdk gives you typed calls for every request
below; the server SDK guide has details. Each example also
shows raw curl.
Customers on a Connect platform
A customer belongs to one merchant and one mode. To create or retrieve a connected account’s customer, sendIonic-Account with your platform secret
key, or pass the server SDK’s { account: connectedMerchantId } request option.
The platform key and the merchant’s connection both need customers:write to
create and customers:read to retrieve.
Store the merchant ID alongside the customer’s Ionic ID, and select the same
merchant when accepting a payment or
saving a card for that customer.
Create a customer
billing_address and shipping are optional and can be added or updated after creation.
Request fields
Retrieve a customer
payment_methods), recent payments (recent_payments), and a lifetime spend summary (summary) with counts and amounts by currency. Use the section_size query parameter to cap the number of items returned in payment_methods and recent_payments (1–100).
Update a customer
null for billing_address or shipping to remove the address. Updating a deleted customer returns 422.
Update fields
List customers
summary), the customer’s default payment method, and their most recent payment. Full payment_methods and recent_payments arrays are not included in list items — use the retrieve endpoint for those.
When has_more is true, the response includes next_cursor, the last
returned customer’s id. Pass it as starting_after to fetch the next page;
iterating the SDK’s list with for await does this automatically.
offset for offset-based pagination, search to filter by email or name prefix, created_gte and created_lte as RFC 3339 timestamps, and include_deleted=true to include soft-deleted records.
Attach a payment method
Attach a vaulted payment method to a customer to make it available for off-session charges and subscriptions.active and not already attached to a customer. Attachment is write-once. The customer field on the payment method response reflects the attached customer id after the call.
To make the attached method the customer’s default, set it explicitly. Pass
null for default_payment_method to clear the default.
payment_settings.default_payment_method field on the customer response always reflects the current default. An invoice that collects automatically uses this method when it is created without one. A subscription that collects automatically sets its own default_payment_method.
Delete and restore
Deleting a customer is a soft-delete. The record is retained withdeleted: true and cannot be modified until restored.
customer.deleted webhook fires on deletion and a customer.restored webhook fires on restore. See webhook events for the full event catalog.
Operational guidance
- Email must be unique per merchant per mode. A
409with codeCUSTOMER_EMAIL_ALREADY_EXISTSmeans a record already exists for that email. Use thesearchparameter on the list endpoint to locate it rather than creating a duplicate. - The
metadatamap is replaced in full on every update. Read the current values before writing if you need to preserve existing keys. - Attach a payment method before creating subscriptions or off-session payment intents. An operation that targets
payment_settings.default_payment_methodrequires the attachment to be in place at the time of the call. - Soft-delete customers instead of abandoning records. Deleted customers retain their payment method and invoice history and can be restored when a customer reactivates.
- Use the same
Idempotency-Keyon every retry for create, update, and attach calls. A unique key per logical operation prevents duplicates from network retries.
What’s next
Save a card for later
Collect a payment method with Ionic Blocks and attach it to a customer.
Start a subscription
Bill a customer automatically each period.
Manage customers on a platform
Create and retrieve customers for connected accounts.

