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
- GETList invoices
- GETGet an invoice
- GETList pricing rule logs
- PUTAdd or update miscellaneous charges in Invoice
- PUTAdd or update miscellaneous charges in upcoming Invoice for a account
- POSTCreate a custom invoice for an account
- DELDelete a custom invoice in DRAFT state
- GETList invoices eligible for bill run
- POSTCreate a bill run job request
- GET
- Payments
- Wallet
- InvoiceGroups
- Alerts
- Reports
Invoices
Get an invoice
Get invoice
GET
/
invoices
/
{invoice_id}
curl --request GET \
--url https://api.togai.com/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>'
{
"id": "inv.hkgkgyh.ghg",
"sequenceId": "2020-07-2958",
"customerId": "7VcRw9xZDIqsC5E",
"ownerId": "ACC001",
"usageInfo": [
{
"description": "rides - local",
"type": "USAGE_METER_USAGE",
"value": 15,
"units": "USAGE_UNITS"
},
{
"description": "rides - pro",
"type": "USAGE_METER_USAGE",
"value": 5,
"units": "USAGE_UNITS"
}
],
"revenueInfo": {
"description": "Grand Total Amount",
"type": "GRAND_TOTAL_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Total Amount",
"type": "TOTAL_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Total amount due",
"type": "NET_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Sum Total",
"type": "GROSS_AMOUNT",
"units": "USD",
"value": 981.94,
"lineItems": [
{
"description": "Payout_NEFT",
"type": "USAGE_RATE_CARD_AMOUNT",
"units": "USD",
"value": 392.1,
"lineItems": [
{
"description": "Slab 1",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
},
{
"description": "Slab 2",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
}
]
},
{
"description": "Payout IMPS",
"type": "USAGE_RATE_CARD_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 32109,
"units": "USD",
"value": 589.94,
"lineItems": [
{
"description": "Slab 1",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
},
{
"description": "Slab 2",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
}
]
}
]
}
]
}
]
}
]
},
"invoiceDetails": {
"customer": {
"name": "John Doe",
"primaryEmail": "john@togai.com",
"address": {
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
}
},
"account": {
"name": "Togai",
"address": {
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "john@togai.com",
"invoiceCurrency": "USD"
},
"pricePlanName": "Togai Basic"
},
"totalAmount": 881.94,
"paidAmount": 0,
"invoiceClass": "INVOICE",
"invoiceType": "STANDARD",
"status": "DUE",
"finalizingStatus": "FINALIZED",
"startDate": "2020-07-04T12:00:00.000Z",
"endDate": "2020-08-04T12:00:00.000Z",
"invoiceDate": "2020-08-04T12:00:00.000Z",
"generatedAt": "2020-08-04T12:00:00.000Z",
"updatedAt": "2020-08-04T12:00:00.000Z"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Example:
"ACC001"
Response
200
application/json
Response for Get invoice requests
Structure of invoice
curl --request GET \
--url https://api.togai.com/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>'
{
"id": "inv.hkgkgyh.ghg",
"sequenceId": "2020-07-2958",
"customerId": "7VcRw9xZDIqsC5E",
"ownerId": "ACC001",
"usageInfo": [
{
"description": "rides - local",
"type": "USAGE_METER_USAGE",
"value": 15,
"units": "USAGE_UNITS"
},
{
"description": "rides - pro",
"type": "USAGE_METER_USAGE",
"value": 5,
"units": "USAGE_UNITS"
}
],
"revenueInfo": {
"description": "Grand Total Amount",
"type": "GRAND_TOTAL_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Total Amount",
"type": "TOTAL_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Total amount due",
"type": "NET_AMOUNT",
"units": "USD",
"value": 881.94,
"lineItems": [
{
"description": "Sum Total",
"type": "GROSS_AMOUNT",
"units": "USD",
"value": 981.94,
"lineItems": [
{
"description": "Payout_NEFT",
"type": "USAGE_RATE_CARD_AMOUNT",
"units": "USD",
"value": 392.1,
"lineItems": [
{
"description": "Slab 1",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
},
{
"description": "Slab 2",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
}
]
},
{
"description": "Payout IMPS",
"type": "USAGE_RATE_CARD_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 32109,
"units": "USD",
"value": 589.94,
"lineItems": [
{
"description": "Slab 1",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
},
{
"description": "Slab 2",
"type": "USAGE_RATE_CARD_SLAB_AMOUNT",
"valuePerQuantity": 0.001,
"quantity": 10000,
"units": "USD",
"value": 10
}
]
}
]
}
]
}
]
}
]
},
"invoiceDetails": {
"customer": {
"name": "John Doe",
"primaryEmail": "john@togai.com",
"address": {
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
}
},
"account": {
"name": "Togai",
"address": {
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "john@togai.com",
"invoiceCurrency": "USD"
},
"pricePlanName": "Togai Basic"
},
"totalAmount": 881.94,
"paidAmount": 0,
"invoiceClass": "INVOICE",
"invoiceType": "STANDARD",
"status": "DUE",
"finalizingStatus": "FINALIZED",
"startDate": "2020-07-04T12:00:00.000Z",
"endDate": "2020-08-04T12:00:00.000Z",
"invoiceDate": "2020-08-04T12:00:00.000Z",
"generatedAt": "2020-08-04T12:00:00.000Z",
"updatedAt": "2020-08-04T12:00:00.000Z"
}
Assistant
Responses are generated using AI and may contain mistakes.