Skip to main content
A customer (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.

Create a customer

Email must be unique per merchant per mode. billing_address and shipping are optional and can be added or updated after creation.

Request fields

Retrieve a customer

The retrieve endpoint returns the full customer object plus dashboard detail: all payment methods on file (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

All body fields are optional. Only fields present in the body are changed. Pass null for billing_address or shipping to remove the address. Updating a deleted customer returns 422.

Update fields

List customers

The list returns customers newest first. Each item includes a lifetime payment summary (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.
The list also accepts 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.
The method must be 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.
The payment_settings.default_payment_method field on the customer response always reflects the current default. Subscriptions and invoices use this method for automatic collection when no payment method is specified at creation time.

Delete and restore

Deleting a customer is a soft-delete. The record is retained with deleted: true and cannot be modified until restored.
To undo the deletion:
A customer.deleted webhook fires on deletion and a customer.restored webhook fires on restore. See webhook events for the full event catalog.
Pass include_deleted=true on the list endpoint to include soft-deleted customers in results. Deleted customers are excluded by default.

Operational guidance

  • Email must be unique per merchant per mode. A 409 with code CUSTOMER_EMAIL_ALREADY_EXISTS means a record already exists for that email. Use the search parameter on the list endpoint to locate it rather than creating a duplicate.
  • The metadata map 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_method requires 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-Key on every retry for create, update, and attach calls. A unique key per logical operation prevents duplicates from network retries.