Skip to content

antoine2116/go-choruspro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-choruspro

tests codecov License: MIT

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.)

Installation

go get github.com/antoine2116/go-choruspro

Usage

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)

Examples

Get the list of currencies available

res, err := c.Transverses.RecupererDevises(context.Background(), choruspro.CodeLangueFr)

Upload an invoice

invoice := SoumettreFactureOptions{
  NumeroFactureSaisi: "123456",
  LignesPoste: &[]SoumettreFactureLignePoste{
    {
      Quantite: 1,
      PrixUnitaire: 100,
      Designation: "Test",
      CodeTVA: "TVA20",
    },
  },
}

res, err := c.Factures.SoumettreFacture(context.Background(), invoice)

Services available

For now, only the following services are available:

  • ✅ Factures
  • ✅ Structures
  • ✅ Transverses
  • ✅ Utilisateurs
  • ❌ Engagements
  • ❌ FacturesTravaux

The other services will be added soon (PRs are welcome!)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details

Disclaimer

This project is not affiliated with the Chorus Pro project or the French government.