Go Business Language. Core library and schemas.
Released under the Apache 2.0 LICENSE, Copyright 2021-2026 Invopop S.L..
Official GOBL documentation site.
GOBL, the Go Business Language library and tools, aim to:
credit-transfer instead of 30 (UNTDID4461 code for sender-initiated bank or wire transfer).For examples on what GOBL document data looks like, please see the examples directory.
The complexity around invoicing, particularly electronic invoicing, can quickly become overwhelming. Check out the following resources and get in touch:
GOBL makes it easy to create business documents, like invoices, but check out some of the companion projects that help create, use, and convert into other formats:
gobl CLI, HTTP API, MCP server, and WebAssembly builds.Conversion to local and international formats:
Addons adapt GOBL documents to a specific format or regulatory regime, adding the extensions, normalization, and validation rules identified by a versioned key under $addons (e.g. es-facturae-v3). Most addons are bundled with this library in the addons directory, but some live in their own Go modules and must be imported separately:
br-nfe-v4)br-nfse-v1)fr-ctc-flow2-v1, fr-ctc-flow6-v1, fr-ctc-flow10-v1)mx-cfdi-v4)pt-saft-v1)sa-zatca-v1)The GOBL.dev project bundles all of the approved external addons alongside this library, so its CLI and API support the full set out of the box. See the addons README for how external addons are registered and approved.
GOBL is primarily a Go library, so the following instructions assume you'd like to build documents from your own Go applications. See some of the links above if you'd like to develop in another language or use a CLI.
Run the following command to install the package:
go get github.com/invopop/gobl
There are many different ways to get data into GOBL, but for the following example, we're going to try to build an invoice in several steps.
First define a minimal or "partial" GOBL Invoice Document:
inv := &bill.Invoice{
Series: "F23",
Code: "00010",
IssueDate: cal.MakeDate(2023, time.May, 11),
Supplier: &org.Party{
TaxID: &tax.Identity{
Country: l10n.US.Tax(),
},
Name: "Provider One Inc.",
Alias: "Provider One",
Emails: []*org.Email{
{
Address: "billing@provideone.com",
},
},
Addresses: []*org.Address{
{
Number: "16",
Street: "Jessie Street",
Locality: "San Francisco",
Region: "CA",
Code: "94105",
Country: l10n.US.ISO(),
},
},
},
Customer: &org.Party{
Name: "Sample Customer",
Emails: []*org.Email{
{
Address: "email@sample.com",
},
},
},
Lines: []*bill.Line{
{
Quantity: num.MakeAmount(20, 0),
Item: &org.Item{
Name: "A stylish mug",
Price: num.NewAmount(2000, 2),
Unit: org.UnitHour,
},
Taxes: []*tax.Combo{
{
Category: tax.CategoryST,
Percent: num.NewPercentage(85, 3),
},
},
},
},
}
Notice that the are no sums or calculations yet. The next step involves "inserting" the invoice document into an "envelope". In GOBL, we use the concept of an envelope to hold data and provide functionality to guarantee that no modifications have been made to the payload.
Insert our previous Invoice into an envelope as follows:
// Prepare an "Envelope"
env := gobl.NewEnvelope()
if err := env.Insert(inv); err != nil {
panic(err)
}
The gobl CLI, the HTTP API handler, the MCP server, and the WebAssembly build now
live in gobl.dev, which composes this library
with the full addon set. Install the CLI with:
go install github.com/invopop/gobl.dev/cmd/gobl@latest
GOBL uses the go generate command to automatically generate JSON schemas, definitions, and some Go code output. After any changes, be sure to run:
go generate .
Go
100.0%
Go Business Language. Core library and schemas.
Released under the Apache 2.0 LICENSE, Copyright 2021-2026 Invopop S.L..
Official GOBL documentation site.
GOBL, the Go Business Language library and tools, aim to:
credit-transfer instead of 30 (UNTDID4461 code for sender-initiated bank or wire transfer).For examples on what GOBL document data looks like, please see the examples directory.
The complexity around invoicing, particularly electronic invoicing, can quickly become overwhelming. Check out the following resources and get in touch:
GOBL makes it easy to create business documents, like invoices, but check out some of the companion projects that help create, use, and convert into other formats:
gobl CLI, HTTP API, MCP server, and WebAssembly builds.Conversion to local and international formats:
Addons adapt GOBL documents to a specific format or regulatory regime, adding the extensions, normalization, and validation rules identified by a versioned key under $addons (e.g. es-facturae-v3). Most addons are bundled with this library in the addons directory, but some live in their own Go modules and must be imported separately:
br-nfe-v4)br-nfse-v1)fr-ctc-flow2-v1, fr-ctc-flow6-v1, fr-ctc-flow10-v1)mx-cfdi-v4)pt-saft-v1)sa-zatca-v1)The GOBL.dev project bundles all of the approved external addons alongside this library, so its CLI and API support the full set out of the box. See the addons README for how external addons are registered and approved.
GOBL is primarily a Go library, so the following instructions assume you'd like to build documents from your own Go applications. See some of the links above if you'd like to develop in another language or use a CLI.
Run the following command to install the package:
go get github.com/invopop/gobl
There are many different ways to get data into GOBL, but for the following example, we're going to try to build an invoice in several steps.
First define a minimal or "partial" GOBL Invoice Document:
inv := &bill.Invoice{
Series: "F23",
Code: "00010",
IssueDate: cal.MakeDate(2023, time.May, 11),
Supplier: &org.Party{
TaxID: &tax.Identity{
Country: l10n.US.Tax(),
},
Name: "Provider One Inc.",
Alias: "Provider One",
Emails: []*org.Email{
{
Address: "billing@provideone.com",
},
},
Addresses: []*org.Address{
{
Number: "16",
Street: "Jessie Street",
Locality: "San Francisco",
Region: "CA",
Code: "94105",
Country: l10n.US.ISO(),
},
},
},
Customer: &org.Party{
Name: "Sample Customer",
Emails: []*org.Email{
{
Address: "email@sample.com",
},
},
},
Lines: []*bill.Line{
{
Quantity: num.MakeAmount(20, 0),
Item: &org.Item{
Name: "A stylish mug",
Price: num.NewAmount(2000, 2),
Unit: org.UnitHour,
},
Taxes: []*tax.Combo{
{
Category: tax.CategoryST,
Percent: num.NewPercentage(85, 3),
},
},
},
},
}
Notice that the are no sums or calculations yet. The next step involves "inserting" the invoice document into an "envelope". In GOBL, we use the concept of an envelope to hold data and provide functionality to guarantee that no modifications have been made to the payload.
Insert our previous Invoice into an envelope as follows:
// Prepare an "Envelope"
env := gobl.NewEnvelope()
if err := env.Insert(inv); err != nil {
panic(err)
}
The gobl CLI, the HTTP API handler, the MCP server, and the WebAssembly build now
live in gobl.dev, which composes this library
with the full addon set. Install the CLI with:
go install github.com/invopop/gobl.dev/cmd/gobl@latest
GOBL uses the go generate command to automatically generate JSON schemas, definitions, and some Go code output. After any changes, be sure to run:
go generate .
Go
100.0%