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
Create a customer
This API let’s you to create customers and corresponding accounts.
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
Payload to create customer
Customer identifier
50
Name of the Customer
3 - 255
Primary email of the customer
320
billing address of the customer
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Payload to create account
Identifier of the account
50
Name of the Account
3 - 255
Use ISO 4217 currency code in which the account must be invoiced.
For example: AED is the currency code for United Arab Emirates dirham.
3
Aliases are tags that are associated with an account. Multiple aliases are allowed for a single account.
Aliases which effective range
billing address of the customer
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Primary email of the account
320
Net term for the invoices of the account
Additional information associated with the account. Example: GSTN, VATN
Tag for accounts are stored in lowercase
Status of the created account defaults to ACTIVE
ACTIVE
, DRAFT
Response
Identifier of customer
50
Unique identifier of customer
Name of the Customer
3 - 255
Primary email of the customer
320
billing address of the customer
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Structure of an account
Identifier of the account
50
Unique identifier of the account
Unique identifier of the customer
Name of the Account
3 - 255
Identifier of the customer
Status of the account
ACTIVE
, DRAFT
, ARCHIVED
ISO_4217 code of the currency in which the account must be invoiced Defaults to Base currency.
3
list of aliases of the account
50
billing address of the customer
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Primary email of the customer
320
Invoice group details
320
billing address of the customer
Contact number
Address line 1 (eg. Street, PO Box, Company Name)
Address line 2 (eg. apartment, suite, unit or building)
ZIP or postal code
City, district, suburb, town or village
State, county, province or region
Two letter country code ISO-3166-1 Alpha-2
Additional information associated with the account. Example: GSTN, VATN
Tag for accounts are stored in lowercase
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"
}
]
}
}