Recaudo Docs

Payments & customers

Customers

Customers represent your end users. You can attach payment methods and subscriptions to them and charge them.

POST /v1/customers

Create customer

Creates a new customer in your account.

Parameters

Parameter Type Required Description
email string Yes Customer email
name string Yes Full name
phone string No Phone
external_id string No Customer ID in your system
tax_id string No Tax ID (RFC)
address string No Address (street and number). Required for AMEX
city string No Ciudad. Required for AMEX
state string No State or province. Required for AMEX
postal_code string No Postal code. Required for AMEX
country string No ISO 3166-1 alpha-2 country code (e.g. MX, US, CO). Required for AMEX
metadata object No Additional data (max 50 keys)
curl -X POST https://recaudo.app/api/v1/customers \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "cliente@ejemplo.com",
    "name": "Juan Pérez",
    "phone": "+52 55 1234 5678",
    "address": "Av. Reforma 123, Col. Centro",
    "city": "Ciudad de México",
    "state": "CDMX",
    "postal_code": "06600",
    "country": "MX",
    "tax_id": "XAXX010101000",
    "metadata": {
      "user_id": "usr_123"
    }
  }'
$response = $client->post('/api/v1/customers', [
    'json' => [
        'email' => 'cliente@ejemplo.com',
        'name' => 'Juan Pérez',
        'phone' => '+52 55 1234 5678',
        'address' => 'Av. Reforma 123, Col. Centro',
        'city' => 'Ciudad de México',
        'state' => 'CDMX',
        'postal_code' => '06600',
        'country' => 'MX',
        'tax_id' => 'XAXX010101000',
        'metadata' => ['user_id' => 'usr_123']
    ]
]);
const customer = await fetch('/api/v1/customers', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_xxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'cliente@ejemplo.com',
    name: 'Juan Pérez',
    phone: '+52 55 1234 5678',
    address: 'Av. Reforma 123, Col. Centro',
    city: 'Ciudad de México',
    state: 'CDMX',
    postal_code: '06600',
    country: 'MX',
    tax_id: 'XAXX010101000',
    metadata: { user_id: 'usr_123' }
  })
});
response = requests.post(
    'https://recaudo.app/api/v1/customers',
    headers={'Authorization': 'Bearer sk_live_xxx'},
    json={
        'email': 'cliente@ejemplo.com',
        'name': 'Juan Pérez',
        'phone': '+52 55 1234 5678',
        'address': 'Av. Reforma 123, Col. Centro',
        'city': 'Ciudad de México',
        'state': 'CDMX',
        'postal_code': '06600',
        'country': 'MX',
        'tax_id': 'XAXX010101000',
        'metadata': {'user_id': 'usr_123'}
    }
)
Response 201
{
  "object": "customer",
  "data": {
    "id": "8e250c25-9d84-4892-98ec-d71fc1fcd3c7",
    "email": "cliente@ejemplo.com",
    "name": "Juan Pérez",
    "phone": "+52 55 1234 5678",
    "address": "Av. Reforma 123, Col. Centro",
    "city": "Ciudad de México",
    "state": "CDMX",
    "postal_code": "06600",
    "country": "MX",
    "tax_id": "XAXX010101000",
    "metadata": { "user_id": "usr_123" },
    "created_at": "2024-01-15T10:30:00Z"
  }
}
GET /v1/customers

List customers

Gets a paginated list of all customers.

Request
curl https://recaudo.app/api/v1/customers?limit=10 \
  -H "Authorization: Bearer sk_live_xxx"
Response 200
{
  "object": "list",
  "data": [
    {
      "id": "8e250c25-9d84-4892-98ec-d71fc1fcd3c7",
      "object": "customer",
      "email": "cliente@ejemplo.com",
      "name": "Juan Perez",
      ...
    }
  ],
  "has_more": true,
  "total_count": 150
}
GET /v1/customers/:id

Get customer

Gets the details of an existing customer.

PATCH /v1/customers/:id

Update customer

Updates a customer's data. Only the fields sent are changed.

DELETE /v1/customers/:id

Delete customer

Deletes a customer and its associated data. This cannot be undone.

Was this page helpful? Thanks for letting us know.
Esc