Overview
A billing account links to a Kill Bill account and stores company contact information, address, and tax registrations. Billing accounts are a prerequisite for:
-
Tax calculation — tax resolution uses the billing account’s tax registrations to determine applicable tax rates.
-
Quote workflows — quotes reference a billing account for pricing and invoicing.
-
Contract management — contracts are associated with billing accounts.
There is one billing account per Kill Bill account within a given tenant.
Prerequisites
-
The Aviate plugin installed and running.
-
A valid API token — see Aviate Authentication to obtain an
ID_TOKEN. -
A Kill Bill account already created via the Create Account API.
Step 1: Create a Billing Account
Use the POST /v1/ba endpoint to create a billing account linked to an existing Kill Bill account.
curl -v -X POST \
-H "Authorization: Bearer ${ID_TOKEN}" \
-H "X-Killbill-ApiKey: my-tenant" \
-H "X-Killbill-ApiSecret: my-secret" \
-H "Content-Type: application/json" \
-d '{
"kbAccountId": "e5d3d5b5-4415-4166-b57f-33ca00a59e88",
"companyName": "CloudSprout Inc.",
"contactName": "Jane Smith",
"email": "billing@cloudsprout.io",
"telephone": "+1-555-0100",
"currency": "USD",
"address": {
"addressLine1": "100 Main Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
},
"taxRegistrations": [
{
"name": "US Tax Registration",
"exempt": false,
"trn": "12-3456789",
"address": {
"addressLine1": "100 Main Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
}
}
]
}' \
http://127.0.0.1:8080/plugins/aviate-plugin/v1/ba
A successful request returns HTTP 201 Created with the billing account ID in the Location header.
Step 2: Retrieve a Billing Account by ID
Use the GET /v1/ba/{billingAccountId} endpoint:
curl -H "Authorization: Bearer ${ID_TOKEN}" \
-H "X-Killbill-ApiKey: my-tenant" \
-H "X-Killbill-ApiSecret: my-secret" \
http://127.0.0.1:8080/plugins/aviate-plugin/v1/ba/{billingAccountId}
Expected Response (HTTP 200)
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"kbAccountId": "e5d3d5b5-4415-4166-b57f-33ca00a59e88",
"companyName": "CloudSprout Inc.",
"contactName": "Jane Smith",
"email": "billing@cloudsprout.io",
"telephone": "+1-555-0100",
"currency": "USD",
"address": {
"addressLine1": "100 Main Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
},
"taxRegistrations": [
{
"name": "US Tax Registration",
"exempt": false,
"trn": "12-3456789",
"address": {
"addressLine1": "100 Main Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
}
}
]
}
Step 3: Retrieve by Kill Bill Account ID
If you have the Kill Bill account ID but not the billing account ID, use the GET /v1/ba/forKbAccountId/{kbAccountId} endpoint:
curl -H "Authorization: Bearer ${ID_TOKEN}" \
-H "X-Killbill-ApiKey: my-tenant" \
-H "X-Killbill-ApiSecret: my-secret" \
http://127.0.0.1:8080/plugins/aviate-plugin/v1/ba/forKbAccountId/{kbAccountId}
The response format is the same as Step 2: Retrieve a Billing Account by ID.
Billing Account Fields Reference
BillingAccount
| Field | Type | Required | Description |
|---|---|---|---|
|
UUID |
Yes |
The linked Kill Bill account ID. |
|
string |
No |
Company or organization name. |
|
string |
No |
Primary contact name. |
|
string |
No |
Contact email address. |
|
string |
No |
Contact phone number. |
|
string |
No |
Default currency code (e.g., |
|
Address |
No |
Company address. See Address below. |
|
TaxRegistration[] |
No |
Tax registration entries. See Tax Registrations below. |
Address
| Field | Type | Description |
|---|---|---|
|
string |
Primary street address. |
|
string |
Secondary address line (suite, unit, etc.). |
|
string |
City name. |
|
string |
State or province. |
|
string |
ISO 3166-1 alpha-2 country code (e.g., |
|
string |
ZIP or postal code. |
Tax Registrations
The taxRegistrations array holds one or more tax registration entries for the billing account. Each entry associates a tax identity (such as a VAT number or EIN) with a specific address and country.
Tax registrations are used during tax resolution to determine which tax codes apply to invoice items. The country field in the registration is matched against the country field in configured tax codes.
TaxRegistration Fields
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
No |
A descriptive name for the registration (e.g., "US Tax Registration"). |
|
boolean |
No |
Set to |
|
string |
No |
Tax Registration Number — e.g., EIN (US), VAT number (EU), GST number (AU). |
|
Address |
No |
Address associated with the tax registration. |
Example: Standard Tax Registration
{
"taxRegistrations": [
{
"name": "US Tax Registration",
"exempt": false,
"trn": "12-3456789",
"address": {
"addressLine1": "100 Main Street",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94105"
}
}
]
}
Example: Tax-Exempt Entity
Set exempt to true for organizations that are exempt from tax (e.g., non-profits, government entities):
{
"taxRegistrations": [
{
"name": "Non-Profit Exemption",
"exempt": true,
"trn": "98-7654321",
"address": {
"addressLine1": "200 Charity Lane",
"city": "Boston",
"state": "MA",
"country": "US",
"postalCode": "02101"
}
}
]
}
API Reference
| Method | Path | Auth | Description |
|---|---|---|---|
|
|
Bearer token |
Create a new billing account. |
|
|
Bearer token |
Retrieve a billing account by its ID. |
|
|
Bearer token |
Retrieve a billing account by the linked Kill Bill account ID. |
Common Pitfalls
| Pitfall | Details |
|---|---|
Creating a subscription before creating a billing account |
If a subscription is created for a Kill Bill account that does not yet have a billing account, tax will not be calculated for that subscription’s invoices. Always create the billing account first. |
Missing country in tax registration |
Tax resolution matches the |
Billing accounts are per-tenant |
Each billing account belongs to the tenant specified by |
|
Important
|
Always create the billing account before creating subscriptions for the corresponding Kill Bill account. Otherwise, invoices generated for those subscriptions will not include tax items. |
Further Reading
-
Aviate Authentication — obtain the
ID_TOKENrequired by all endpoints -
Aviate Tax — configure tax codes and tax resolution
-
Aviate Tax Tutorial — end-to-end tax setup walkthrough