Introduction
APIs
- Authentication
- Customers
- Accounts
- Aliases
- Event Schemas
- Usage Meters
- AddOns
- Licenses
- Feature
- (Deprecated) Price Plans
- Price Plan V2
- Settings
- Price Experimentation
- Jobs
- Event Ingestion
- Entitlements
- Event Management
- Metrics
- Credits
- Invoices
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Customers
Create a customer
This API let’s you to create customers and corresponding accounts.
POST
/
customers
curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "ACC00001",
"name": "Primary Account",
"invoiceCurrency": "USD",
"aliases": [
"acme_primary",
"admin@example.com"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'
{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.dsvvre314.dcs314",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "G234DZZKBKACATFFGVGEMERFH",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account",
"invoiceCurrency": "USD",
"status": "ACTIVE",
"aliases": [
{
"alias": "G234DZZKBKACATFFGVGEMERFH",
"status": "ACTIVE"
}
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Payload to create customer
Response
201
application/json
Response for Create customer request
The response is of type object
.
curl --request POST \
--url https://api.togai.com/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "ACC00001",
"name": "Primary Account",
"invoiceCurrency": "USD",
"aliases": [
"acme_primary",
"admin@example.com"
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}'
{
"id": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.dsvvre314.dcs314",
"name": "ACME Enterprise",
"primaryEmail": "admin@example.com",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"settings": [
{
"id": "customerSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"account": {
"id": "G234DZZKBKACATFFGVGEMERFH",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "01BX5ZZKBKACTAV9WEVGEMMVRZ",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account",
"invoiceCurrency": "USD",
"status": "ACTIVE",
"aliases": [
{
"alias": "G234DZZKBKACATFFGVGEMERFH",
"status": "ACTIVE"
}
],
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
]
}
}
Assistant
Responses are generated using AI and may contain mistakes.