> ## Documentation Index
> Fetch the complete documentation index at: https://docs.transaction.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer

> Create a new customer

Create a new customer for payment processing.

<ParamField path="email" type="string" required>
  Customer email address
</ParamField>

<ParamField path="metadata" type="object">
  Additional customer metadata
</ParamField>

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data.id" type="string">
  Customer ID
</ResponseField>

<ResponseField name="data.email" type="string">
  Customer email
</ResponseField>

<ResponseField name="data.metadata" type="object">
  Customer metadata
</ResponseField>

<ResponseField name="data.createdAt" type="string">
  Creation timestamp
</ResponseField>

## Example Request

```bash theme={null}
curl -X POST https://api.transaction.gg/merchant/customer/create \
  -H "Authorization: Bearer jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com",
    "metadata": {
      "name": "John Doe",
      "phone": "+1234567890"
    }
  }'
```

## Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "id": "cus_V6n6SN2KnsIFCuQU",
    "email": "customer@example.com",
    "metadata": {
      "name": "John Doe",
      "phone": "+1234567890"
    },
    "createdAt": "2024-01-01T00:00:00Z"
  }
}
```

## Error Responses

<ResponseExample name="Email Already Exists">
  ```json theme={null}
  {
    "success": false,
    "error": {
      "status": 400,
      "code": "DUPLICATE_ENTRY",
      "message": "Customer with this email already exists"
    },
    "data": null
  }
  ```
</ResponseExample>
