Manage Billing Details with Terraform

Your organisation's billing details — the legal name, postal address, country, tax registration and invoice reference printed in the Bill To block of your invoices — can be managed declaratively with the bahriyabillingdetails resource.

Updated 11 Aug 20262 min read

Your organisation's billing details — the legal name, postal address, country, tax registration and invoice reference printed in the Bill To block of your invoices — can be managed declaratively with the bahriya_billing_details resource.

Each organisation has exactly one set of billing details, so declare at most one of these resources. Creating it writes your declared identity; destroying it clears every declared field. The billing email is the one exception: it is never cleared, and omitting email leaves the current address unchanged.

Fields

All fields are optional — invoices are issued either way. The computed complete attribute tells you whether the identity is invoice-ready.

FieldTypeDescription
legal_namestringRegistered legal entity name, printed on invoices. Falls back to your organisation display name when unset.
emailstringThe billing email all organisation email goes to. Omitting it leaves the current address unchanged.
entity_typestringindividual or company.
address_line1stringFirst line of the postal address.
address_line2stringSecond line of the postal address.
citystringCity.
statestringState, province or emirate.
postcodestringPostal code — not required everywhere, deliberately optional.
countrystringISO 3166-1 alpha-2 country code, e.g. AE or DE. Unrelated to deployment regions.
tax_idstringTax registration number. Requires tax_id_type.
tax_id_typestringvat, trn, gst, abn, ein or other — drives the label the invoice prints.
registration_numberstringCompany registration or trade licence number.
billing_referencestringA PO number or cost centre printed on invoices.

Example

resource "bahriya_billing_details" "this" {
  entity_type = "company"
  legal_name  = "Acme Trading LLC"
  email       = "accounts@acme.example"
 
  address_line1 = "Office 402, Al Majaz Tower"
  address_line2 = "Corniche Street"
  city          = "Sharjah"
  state         = "Sharjah"
  country       = "AE"
 
  tax_id      = "100123456789003"
  tax_id_type = "trn"
 
  registration_number = "1234567"
  billing_reference   = "PO-4471"
}

An individual needs far less:

resource "bahriya_billing_details" "this" {
  entity_type   = "individual"
  address_line1 = "12 Harbour Lane"
  city          = "Istanbul"
  country       = "TR"
}

Importing existing details

The details are a singleton in the provider's configured organisation. By convention, import with your organisation UUID:

terraform import bahriya_billing_details.this <organisation-uuid>

Invoices are snapshots

Each invoice records your billing details as they were on the day it was issued. Applying a change updates future invoices only — already-issued invoices never change.

See also: Billing Details in the console, Reis CLI flag mode, Terraform provider overview.