---
title: "Create a customer"
method: POST
path: "/v1/customers"
tags: ["Customers"]
---

# Create a customer

`POST /v1/customers`

Create a new customer record. Customers can be associated with payments for tracking and recurring billing.

## Headers

- `X-Idempotency-Key` string, required

## Request body

- CreateCustomerRequest
  - `externalId` string — Your own customer ID.
  - `name` string
  - `email` string, email
  - `document` string — CPF or CNPJ number.
  - `documentType` 'CPF' | 'CNPJ'
  - `phone` string
  - `metadata` object

## Response `201`

Customer created.

- object
  - `customer` Customer
    - `customerId` string — Merchant-facing customer slug (e.g., `cus_ab12cd34ef`). Use this as the `{customerId}` path parameter in subsequent calls.
    - `name` string
    - `email` string
    - `document` string
    - `phone` string
    - `externalId` string
    - `isActive` boolean
    - `createdAt` string, date-time

## Other responses

- `400` — Validation error.
- `401` — Missing or invalid authentication token.
- `409` — Idempotency conflict. The key was already used with a different payload.

---

[API](https://skmtc.net/yuvexpay/apis/yuvexpay-api.md) · [All operations](https://skmtc.net/yuvexpay/apis/yuvexpay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/yuvexpay/yuvexpay-api/versions/0d036504e049/schema)
