Skip to main content

Accounts

Manage FiscalAPI accounts. Each account receives an API key for authenticating subsequent requests.

Create an account

POST /v1/accounts

Creates a new account and generates the first API key (test environment). This is a public endpoint -- no authentication required.

Request body

FieldTypeRequiredDescription
namestringYesAccount display name (1-100 chars)
billing_emailstringYesBilling contact email (must be unique)

Example

curl -X POST https://api.fiscalapi.com/v1/accounts \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"billing_email": "admin@acme.com"
}'

Response 201 Created

{
"account": {
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Acme Corp",
"billing_email": "admin@acme.com",
"status": "active",
"created_at": "2026-03-08T12:00:00Z"
},
"api_key": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"key_prefix": "fsk_test_",
"key": "fsk_test_abc123def456...",
"environment": "test",
"created_at": "2026-03-08T12:00:00Z"
}
}
caution

The api_key.key field is returned only on creation. Store it securely -- it cannot be retrieved again.

Errors

StatusErrorCause
400Key: 'CreateRequest.Name' Error:Field validation for 'Name' failed on the 'required' tagMissing name field
400Key: 'CreateRequest.BillingEmail' Error:Field validation for 'BillingEmail' failed on the 'email' tagInvalid email format
409an account with this billing email already existsDuplicate email

Account object

FieldTypeDescription
iduuidUnique account identifier
namestringAccount display name
billing_emailstringBilling contact email
statusstringactive, suspended, or cancelled
created_atdatetimeAccount creation timestamp

API key object

FieldTypeDescription
iduuidKey identifier
key_prefixstringKey prefix for identification (e.g., fsk_test_)
keystringFull plaintext API key (shown once)
environmentstringtest or live
created_atdatetimeKey creation timestamp