GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - smoltuna/gobl: Go Business Language

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

3,457 Commits
3,457 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
addons
addons
 
 
bill
bill
 
 
c14n
c14n
 
 
cal
cal
 
 
catalogues
catalogues
 
 
cbc
cbc
 
 
currency
currency
 
 
data
data
 
 
dsig
dsig
 
 
examples
examples
 
 
head
head
 
 
i18n
i18n
 
 
internal
internal
 
 
l10n
l10n
 
 
net
net
 
 
norm
norm
 
 
note
note
 
 
num
num
 
 
org
org
 
 
pay
pay
 
 
pkg
pkg
 
 
regimes
regimes
 
 
rules
rules
 
 
schema
schema
 
 
tax
tax
 
 
uuid
uuid
 
 
.gitignore
.gitignore
 
 
.golangci.yaml
.golangci.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
envelope.go
envelope.go
 
 
envelope_test.go
envelope_test.go
 
 
errors.go
errors.go
 
 
errors_test.go
errors_test.go
 
 
examples_test.go
examples_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
gobl.go
gobl.go
 
 
gobl_logo_black_rgb.svg
gobl_logo_black_rgb.svg
 
 
gobl_logo_white_rgb.svg
gobl_logo_white_rgb.svg
 
 
mage.go
mage.go
 
 
parse.go
parse.go
 
 
parse_test.go
parse_test.go
 
 
version.go
version.go
 
 
version_test.go
version_test.go
 
 

Repository files navigation

GOBL

GOBL Logo

GOBL Logo

Go Business Language. Core library and schemas.

Released under the Apache 2.0 LICENSE, Copyright 2021-2026 Invopop S.L..

Lint Test Go Go Report Card codecov GoDoc Latest Tag Ask DeepWiki Mentioned in Awesome Go

Official GOBL documentation site.

Introduction

GOBL, the Go Business Language library and tools, aim to:

  • Help developers build electronic business documents, especially invoices, anywhere in the world.
  • Define a set of open JSON Schema.
  • Build a global database of local tax categories and, whenever practical to do so, provide current and historical tax rates in code.
  • Validate business documents according to local requirements, including tax ID validation.
  • Define the algorithms used to make tax calculations while avoiding rounding errors.
  • Provide built-in support for signing documents using JSON Web Signatures.
  • Output simple and easy-to-read JSON documents that emphasize the use of keys instead of abstract codes, like credit-transfer instead of 30 (UNTDID4461 code for sender-initiated bank or wire transfer).
  • Be flexible enough to support extreme local complexity but produce output that is easily legible in other countries.
  • Build a global community of contributors tired of the complexity of current standards based on XML or EDI.

For examples on what GOBL document data looks like, please see the examples directory.

Community

The complexity around invoicing, particularly electronic invoicing, can quickly become overwhelming. Check out the following resources and get in touch:

  • Documentation contains details on how to use GOBL, and the schema.
  • Builder helps try out GOBL and quickly figure out what is possible, all from your browser.
  • Issues if you have a specific problem with GOBL related to code or usage.
  • Discussions for open discussions about the future of GOBL, complications with a specific country, or any open-ended issues.
  • Pull Requests are very welcome, especially if you'd like to see a new local country or features.
  • Slack for real-time chat about something specific or urgent. We always encourage you to use one of the other options, which are indexed and searchable, but if you'd like to bring something to attention quickly, this is a great resource.

Companion Projects

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:

  • Builder - Available to try at build.gobl.org, this tool makes it easy to build, test, and discover the features of GOBL using the wasm binary in the browser.
  • Generator - Ruby project to convert GOBL JSON Schema into libraries for other languages or documentation.
  • Docs - Content of the official GOBL Documentation Site docs.gobl.org.
  • GOBL for Ruby - Easily build or read GOBL documents in Ruby.

Conversion to local and international formats:

  • GOBL to HTML - generate printable versions of GOBL documents ready to be converted to PDF.
  • GOBL to FacturaE (Spain) - convert into the Spanish FacturaE format.
  • GOBL to CFDI (Mexico) - convert into the Mexican CFDI format.
  • GOBL to FatturaPA (Italy) - convert into the Italian FatturaPA format.
  • GOBL to FA_VAT / KSeF (Poland) - convert to the Polish FA_VAT format and send to KSeF
  • GOBL to TicketBAI (Spain/Euskadi) - convert into TicketBAI documents, required in the Euskadi (northern region of Spain)
  • GOBL to VERI*FACTU (Spain) - convert and send to the Spanish tax authorities.
  • GOBL UBL - convert to and from the OASIS Universal Business Language, including support for local and global profiles such as for Peppol and XRechnung (Germany)
  • GOBL CII - convert to and from the Cross Industry Invoice (CII) XML format, including regional variants including Factur-X (France), ZUGFeRD and XRechnung (Germany).
  • GOBL to Stripe - support for creating GOBL invoices from stripe API data.

Usage

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.

Installation

Run the following command to install the package:

go get github.com/invopop/gobl

Building an Invoice

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,
		},
		Name:  "Provider One Inc.",
		Alias: "Provider One",
		Emails: []*org.Email{
			{
				Address: "[email protected]",
			},
		},
		Addresses: []*org.Address{
			{
				Number:   "16",
				Street:   "Jessie Street",
				Locality: "San Francisco",
				Region:   "CA",
				Code:     "94105",
				Country:  l10n.US,
			},
		},
	},
	Customer: &org.Party{
		Name: "Sample Customer",
		Emails: []*org.Email{
			{
				Address: "[email protected]",
			},
		},
	},
	Lines: []*bill.Line{
		{
			Quantity: num.MakeAmount(20, 0),
			Item: &org.Item{
				Name:  "A stylish mug",
				Price: num.MakeAmount(2000, 2),
				Unit:  org.UnitHour,
			},
			Taxes: []*tax.Combo{
				{
					Category: common.TaxCategoryST,
					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)
}

CLI, HTTP API, MCP, and wasm

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

Development

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 .

About

Go Business Language

Resources

Readme
License

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.