go-choruspro is a Go client library for accessing the ChorusPro API.
Chorus Pro is the shared invoicing solution that has been set up for all suppliers (private or public) in the public sector (State, local authorities, etc.) to meet the legal requirements for electronic invoicing. (translated from economie.gouv.fr)
See the Chorus Pro Community for more information (documentation, support, status, etc.)
go get github.com/antoine2116/go-choruspro
import "github.com/antoine2116/go-choruspro"
Construct a new ChorusPro client. You must provide the following parameters:
cfg := &choruspro.ClientConfig{
BaseUrl: "<piste_url>",
AuthUrl: "<piste_oauth_url>",
ClientId: "<piste_client_id>",
ClientSecret: "<piste_client_secret>",
Login: "<chorus_pro_technical_credentials>",
}
c, err := choruspro.NewClient().WithConfig(cfg)
res, err := c.Transverses.RecupererDevises(context.Background(), choruspro.CodeLangueFr)
invoice := SoumettreFactureOptions{
NumeroFactureSaisi: "123456",
LignesPoste: &[]SoumettreFactureLignePoste{
{
Quantite: 1,
PrixUnitaire: 100,
Designation: "Test",
CodeTVA: "TVA20",
},
},
}
res, err := c.Factures.SoumettreFacture(context.Background(), invoice)
For now, only the following services are available:
- ✅ Factures
- ✅ Structures
- ✅ Transverses
- ✅ Utilisateurs
- ❌ Engagements
- ❌ FacturesTravaux
The other services will be added soon (PRs are welcome!)
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details
This project is not affiliated with the Chorus Pro project or the French government.