Accounts
Create an account
Introduction
APIs
- Authentication
- Customers
- Accounts
- GETList accounts of customer
- POSTCreate an account
- GETGet an account
- DELDelete an account
- PATCHUpdate an account
- Account Aliases
- (Deprecated) Plan Associations
- (Deprecated) Purchases
- (Deprecated) Proposals
- Schedules
- GET
- 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
Accounts
Create an account
This API let’s you to create an account for a customer using customer_id.
POST
/
accounts
curl --request POST \
--url https://api.togai.com/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "ACC00001",
"name": "Primary Account",
"customerId": "C1234qwd",
"aliases": [
"acme_primary",
"acme_1"
],
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"netTermDays": 45
}'
{
"id": "G234DZZKBKACATFFGVGEMERFI",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "ACME",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account2",
"invoiceCurrency": "USD",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"billingInformation": {
"emailRecipients": [
"admin@example.com",
"acme@acme.com",
"acmeacme@acme.com"
],
"additionalEmailRecipients": [
"admin@acme.com"
]
},
"aliases": [
{
"alias": "account2@acme.com"
},
{
"alias": "+1234567890"
}
],
"status": "ACTIVE"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Payload to create account
Response
201
application/json
Response for Create and Get account requests
Structure of an account
curl --request POST \
--url https://api.togai.com/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "ACC00001",
"name": "Primary Account",
"customerId": "C1234qwd",
"aliases": [
"acme_primary",
"acme_1"
],
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"settings": [
{
"id": "accountSettingId",
"value": "INR",
"namespace": "USER",
"name": "Settings Name",
"dataType": "STRING"
}
],
"netTermDays": 45
}'
{
"id": "G234DZZKBKACATFFGVGEMERFI",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "ACME",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account2",
"invoiceCurrency": "USD",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"billingInformation": {
"emailRecipients": [
"admin@example.com",
"acme@acme.com",
"acmeacme@acme.com"
],
"additionalEmailRecipients": [
"admin@acme.com"
]
},
"aliases": [
{
"alias": "account2@acme.com"
},
{
"alias": "+1234567890"
}
],
"status": "ACTIVE"
}