Skip to main content
POST
Enroll a customer

Authorizations

Authorization
string
header
required

Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.

Headers

Idempotency-Key
string

A unique key per operation (a UUID works). Retrying with the same key returns the original response.

Path Parameters

productID
string<uuid>
required

Product ID.

Body

application/json
externalId
string
required

This customer's id in your own system (for example, your app's user id). Required; sending the same value again returns the same customer.

name
string | null

Customer name.

email
string | null

Customer email.

taxId
string | null

CPF or CNPJ.

pspRef
string | null

The customer's reference with the payment processor, if you already have one. Usually not needed.

metadata
object

Your own free-form JSON data. Stored on the enrollment.

Response

Enrollment created

An enrollment: this customer in this product. The id is the enrollment ID that subscriptions, invoices, usage and balances reference.

id
string<uuid>

Enrollment ID. This is the one billing and usage calls expect.

customerId
string<uuid>

Customer ID. Do not use it for billing and usage calls; use id.

productId
string<uuid>
externalId
string

The customer's id in your own system.

name
string | null
email
string | null
taxId
string | null

CPF or CNPJ.

pspRef
string | null

The customer's reference with the payment processor, when there is one.

metadata
object

The free-form data sent at enrollment.

creditAlertSent
boolean

Whether the low-balance alert has already been sent for this enrollment.

createdAt
string<date-time>