The Customer Object

Customers represent businesses or individuals you sell to. Storing their GSTIN enables automated tax determination.

POST/v1/customers

Create a customer

Creates a new customer in your directory.

Parameters

namestringRequired
Customer's full name.
emailstring
Customer's email address.
phonestring
Customer's phone number.
gstinstring
Customer's GSTIN.
statestring
State code (e.g. '29').
curl -X POST https://api.vylot.workers.dev/v1/customers -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"name": "Acme Corp", "gstin": "29ABCDE1234F1Z5"}'
Response
{ "success": true, "data": { "id": "cust_828f2", "name": "Acme Corp" } }
GET/v1/customers

List customers

Retrieves a list of your customers.

curl -X GET https://api.vylot.workers.dev/v1/customers -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": [ { "id": "cust_828f2", "name": "Acme Corp" } ] }
GET/v1/customers/:id

Retrieve a customer

Retrieves the details of an existing customer.

curl -X GET https://api.vylot.workers.dev/v1/customers/cust_828f2 -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true, "data": { "id": "cust_828f2", "name": "Acme Corp" } }
PATCH/v1/customers/:id

Update a customer

Updates the specified customer. Only provided fields are updated.

Parameters

namestring
Customer's full name.
emailstring
Customer's email address.
gstinstring
Customer's GSTIN.
curl -X PATCH https://api.vylot.workers.dev/v1/customers/cust_828f2 -H "Authorization: Bearer vk_live_abc123..." -H "Content-Type: application/json" -d '{"email": "new@acme.com"}'
Response
{ "success": true }
DELETE/v1/customers/:id

Delete a customer

Permanently deletes a customer.

curl -X DELETE https://api.vylot.workers.dev/v1/customers/cust_828f2 -H "Authorization: Bearer vk_live_abc123..."
Response
{ "success": true }