Customers API
POST /v1/customers and customer usage endpoints
llms.txtPOST /v1/customers and customer usage endpoints
Create customer
POST /v1/customers
Body (validated by createCustomerSchema):
| Field | Type | Required |
|---|---|---|
email | string | Yes |
externalId | string | No |
name | string | No |
phone | string | No |
address | object | No |
currency | string | No |
collectionMethod | "CHARGE_AUTOMATICALLY" | "SEND_INVOICE" | No |
metadata | object | No |
Response 201 - customer object.
curl -X POST https://api.kwit.dev/v1/customers \
-H "Authorization: Bearer kwit_live_xxx" \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","name":"Jane Doe","externalId":"cus_123"}'Customer usage state
GET /v1/customers/:id/state
Returns aggregated meter usage state for billing. 404 if customer not found.
Grant meter credit
POST /v1/customers/:id/meter-credits
Body validated by grantMeterCreditSchema (includes customerId from path). Response 201 - credit grant record.