Skip to content
Authorization<token>

Use a public key (pk./pk_test.) for payment initialization. Use a secret key (sk./sk_test.) for sensitive operations (transfers, refunds, balance), or a restricted key (rk./rk_test.) scoped to specific permissions. The _test. variant of any key selects the sandbox environment — there is no separate sandbox URL. Never expose your secret key in client-side code.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

type?"individual" | "business"
"individual""business"
email?string | null

This field is required when <code>phone</code> is not present. Must be a valid email address. Must not be greater than 255 characters.

phone?string | null

This field is required when <code>email</code> is not present. Must not be greater than 50 characters.

phone_country?string | null

Must be 2 characters.

name?string | null

Must not be greater than 255 characters.

company_name?string | null

Must not be greater than 255 characters.

first_name?string
last_name?string
date_of_birth?string | null

Must be a valid date. Must be a date before <code>today</code>.

gender?"male" | "female" | "other"
"male""female""other"
business_name?string | null

This field is required when <code>type</code> is <code>business</code>. Must not be greater than 255 characters.

business_type?string | null

Must not be greater than 128 characters.

business_registration_number?string | null

Must not be greater than 64 characters.

tax_id?string | null

Must not be greater than 64 characters.

legal_representative_name?string | null

Must not be greater than 255 characters.

legal_representative_title?string | null

Must not be greater than 128 characters.

description?string | null

Must not be greater than 1000 characters.

notes?string | null
currency?string | null

Must be 3 characters.

address?object | null
country?string | null

Must be 2 characters.

city?string | null

Must not be greater than 128 characters.

address_line1?string | null

Must not be greater than 255 characters.

state?string | null

Must not be greater than 128 characters.

postal_code?string | null

Must not be greater than 20 characters.

address_line2?string | null

Must not be greater than 255 characters.

billing?object | null
country?string | null

Must be 2 characters.

city?string | null

Must not be greater than 128 characters.

address_line1?string | null

Must not be greater than 255 characters.

state?string | null

Must not be greater than 128 characters.

postal_code?string | null

Must not be greater than 20 characters.

address_line2?string | null

Must not be greater than 255 characters.

preferred_language?string | null

Must not be greater than 10 characters.

preferred_currencies?array<string>

Must be 3 characters.

preferred_locales?array<string>

Must not be greater than 10 characters.

customer_group?string | null

Must not be greater than 64 characters.

tags?array<string>

Must not be greater than 50 characters.

metadata?object | null

Response Body

application/json

application/json

curl -X POST "https://example.com/customers" \  -H "Content-Type: application/json" \  -d '{}'
POST
/customers
{
  "code": 201,
  "status": "Created",
  "message": "Customer created",
  "customer": {
    "id": "cus_01JXXX",
    "email": "amina@example.com",
    "name": "Amina Diallo",
    "status": "active"
  }
}
{
  "code": 422,
  "errors": {
    "email": [
      "This customer already exists."
    ]
  }
}