Customers API

await accend.customers.create({
  externalId: "user_123",
  email: "owner@example.com"
});

Endpoints

  • POST /v1/customers
  • GET /v1/customers
  • GET /v1/customers/{customerId}
  • PATCH /v1/customers/{customerId}

POST /v1/customers

Scopes: write
Idempotency-Key: required
{
  "externalId": "user_9001",
  "name": "Joao Silva",
  "email": "joao@exemplo.com",
  "metadata": { "plan": "pro" }
}
  • externalId string optional (must be unique)
  • name string optional
  • email string optional
  • metadata object optional (max 50 keys)
Response 201
{
  "data": {
    "id": "cus_abc123",
    "externalId": "user_9001",
    "name": "Joao Silva",
    "email": "joao@exemplo.com",
    "metadata": { "plan": "pro" },
    "createdAt": "2025-01-15T10:00:00Z"
  },
  "error": null,
  "success": true
}
Error:
  • 409 externalId_conflict a customer with this externalId already exists

GET /v1/customers

Scopes: read Query params:
  • externalId string optional
  • limit int (default 100, max 500)
  • before string (cursor)
Response 200
{
  "data": {
    "items": [
      {
        "id": "cus_abc123",
        "externalId": "user_9001",
        "name": "Joao Silva",
        "email": "joao@exemplo.com",
        "createdAt": "2025-01-15T10:00:00Z"
      }
    ],
    "hasMore": false,
    "nextCursor": null
  },
  "error": null,
  "success": true
}

GET /v1/customers/

Scopes: read Response 200
{
  "data": {
    "id": "cus_abc123",
    "externalId": "user_9001",
    "name": "Joao Silva",
    "email": "joao@exemplo.com",
    "metadata": {},
    "createdAt": "2025-01-15T10:00:00Z"
  },
  "error": null,
  "success": true
}

PATCH /v1/customers/

Scopes: write
Idempotency-Key: required
{
  "name": "Joao Silva Jr.",
  "metadata": null
}
  • name string or null optional (null clears)
  • email string or null optional (null clears)
  • metadata object or null optional (null clears)
Response 200: full updated customer.