API reference
Customers
A Customer represents the person or company you're billing. Attach customers to payments, invoices, and subscriptions to mirror your CRM and unlock per-customer dashboards. B2B fields (legal name, tax ID, tax office) live alongside personal fields so the same row works for both audiences.
Create a customer
POST
/v1/customersscope: customers:writeAt least one of email, phoneE164, or name is required. Email is the de-facto unique identifier — duplicates by email are allowed but the dashboard surfaces them with a warning chip.
Body parameters
namestring | Display name. Required when neither email nor phone is set. |
emailstring | Lowercased before storage; counts as a unique identifier in deduplication queries. |
phoneE164string | Must match `^\+[1-9]\d{6,14}$`. Validated against libphonenumber.isPossible() rules. |
countrystring | ISO-3166 alpha-2 country code. |
citystring | Free-form. Max 120 chars. |
legalNamestring | B2B field. Company's registered legal name. Shown on invoices alongside `name`. |
taxIdstring | B2B field. VAT / EIN / vergi numarası. Free-form, max 60 chars. |
taxOfficestring | B2B field. Local tax authority (e.g. TR vergi dairesi). Max 120 chars. |
metadataobject | Arbitrary JSON, max 16KB serialized. Echoed back on every retrieve. |
curl https://baynoy.com/api/v1/customers \
-H "Authorization: Bearer sk_live_…" \
-H "Idempotency-Key: cus-7f9b3d2c" \
-d '{
"email": "[email protected]",
"name": "Acme Industries",
"legalName": "Acme Industries Ltd.",
"taxId": "GB123456789",
"country": "GB"
}'Response
{
"ok": true,
"data": {
"id": "8f7e6d5c-4b3a-2918-7654-3210fedcba98",
"merchantId": "1a2b3c4d-...",
"name": "Acme Industries",
"email": "[email protected]",
"phoneE164": null,
"country": "GB",
"city": null,
"legalName": "Acme Industries Ltd.",
"taxId": "GB123456789",
"taxOffice": null,
"metadata": null,
"createdAt": "2026-05-27T12:34:56.789Z",
"updatedAt": "2026-05-27T12:34:56.789Z",
"deletedAt": null
}
}List customers
GET
/v1/customersscope: customers:readCursor-paginated. Pass cursorfrom the previous response's nextCursor to fetch the next page. Search by free-form q across name, legalName, email, phoneE164 and taxId.
Query parameters
qstring | Free-text search (case-insensitive). |
cursorstring | Pagination cursor from a previous response. |
pageSizenumber | 1–100. Default 25. |
curl "https://baynoy.com/api/v1/customers?q=acme&pageSize=10" \ -H "Authorization: Bearer sk_live_…"
Response
{
"ok": true,
"data": {
"items": [
{
"id": "8f7e6d5c-...",
"name": "Acme Industries",
"email": "[email protected]",
"legalName": "Acme Industries Ltd.",
"createdAt": "2026-05-27T12:34:56.789Z"
}
],
"nextCursor": "eyJpZCI6IjhmN2U2ZDVjLi4ufQ==",
"hasMore": false
}
}