Skip to main content
POST
Create a customer

Authorizations

Authorization
string
header
required

A secret key, sk_test_... or sk_live_...; a publishable key (pk_...) on the browser routes only

Body

application/json
reference
string

Your own id for the customer, such as your user id, unique in the workspace. When a customer already has it, that customer is returned (200) and nothing is created or changed, so the call is safe to repeat.

Required string length: 1 - 100
Example:

"user_48213"

name
string
Required string length: 1 - 200
Example:

"Ada Lovelace"

email
string<email>

Where Payra sends this customer's payment receipts, when the workspace sends them.

Maximum string length: 254
phone
string

E.164.

Pattern: ^\+[1-9]\d{9,14}$/u
Example:

"+15555550123"

Response

A customer already had this reference

object
enum<string>
required
Available options:
customer
id
string<uuid>
required

Pass it as customer on a payment method session, a checkout session or a payment.

Example:

"019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30"

reference
string | null
required

Your own id for the customer; null for customers created in the Payra dashboard or by an ERP.

Example:

"user_48213"

name
string | null
required

The name shown in the Payra dashboard: the email, or the reference, when created without one.

Example:

"Ada Lovelace"

email
string | null
required
phone
string | null
required
Example:

"+15555550123"

created_at
string<date-time>
required
Example:

"2026-09-29T14:00:00.000Z"