KwitKwit Docs

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):

FieldTypeRequired
emailstringYes
externalIdstringNo
namestringNo
phonestringNo
addressobjectNo
currencystringNo
collectionMethod"CHARGE_AUTOMATICALLY" | "SEND_INVOICE"No
metadataobjectNo

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.

On this page