Formats API
Retrieve all supported countries and e-invoice formats. Ideal for dynamic UI components like dropdown menus or for validating user inputs.
/api/v1/invoice/formats/api/v1/invoice/{countryCode}/formatsThe call only works with a valid bearer key. It is not metered against your quota, but it is refused with 429 once the quota is exhausted. Cache the response if you need it often.
Endpoints
/api/v1/invoice/formatsReturns all supported countries with their available e-invoice formats. Ideal for discovery and dynamic UI components.
Use Cases: Dropdown menus for country selection, format picker, generate documentation
/api/v1/invoice/{countryCode}/formatsReturns the available e-invoice formats for a specific country. Use this endpoint when you already know the country.
Path Parameters
countryCodeISO 3166-1 alpha-2 country code (e.g. DE, AT, FR)
Germany
/api/v1/invoice/de/formatsAustria
/api/v1/invoice/at/formatsFrance
/api/v1/invoice/fr/formatsCode Examples
1curl -X GET 'https://service.invoice-api.xhub.io/api/v1/invoice/formats' \2 -H 'Authorization: Bearer sk_test_xxx'Response
/api/v1/invoice/formats
200 OK1{2 "countries": [3 {4 "code": "DE",5 "name": "Germany",6 "label": "Germany (DE)",7 "formats": [8 "pdf",9 "xrechnung",10 "zugferd"11 ],12 "formatDetails": [13 {14 "code": "pdf",15 "label": "PDF",16 "kind": "pdf"17 },18 {19 "code": "zugferd",20 "label": "ZUGFeRD 2.3/2.4/2.5",21 "kind": "einvoice"22 },23 {24 "code": "xrechnung",25 "label": "XRechnung 3.0/3.0.2",26 "kind": "einvoice"27 }28 ]29 },30 {31 "code": "AT",32 "name": "Austria",33 "label": "Austria (AT)",34 "formats": [35 "pdf",36 "ebinterface",37 "ubl"38 ],39 "formatDetails": [40 {41 "code": "pdf",42 "label": "PDF",43 "kind": "pdf"44 },45 {46 "code": "ebinterface",47 "label": "ebInterface",48 "kind": "einvoice"49 },50 {51 "code": "ubl",52 "label": "UBL (Peppol BIS 3.0)",53 "kind": "einvoice"54 }55 ]56 }57 ]58}Truncated to two countries — the real response contains all 37 countries.
/api/v1/invoice/{countryCode}/formats
200 OK1{2 "code": "DE",3 "name": "Germany",4 "label": "Germany (DE)",5 "formats": [6 "pdf",7 "xrechnung",8 "zugferd"9 ],10 "formatDetails": [11 {12 "code": "pdf",13 "label": "PDF",14 "kind": "pdf"15 },16 {17 "code": "zugferd",18 "label": "ZUGFeRD 2.3/2.4/2.5",19 "kind": "einvoice"20 },21 {22 "code": "xrechnung",23 "label": "XRechnung 3.0/3.0.2",24 "kind": "einvoice"25 }26 ]27}Error Response
404 Not FoundReturned when an invalid country code is specified.
1{2 "error": "Not Found",3 "message": "Country XX is not supported"4}Response Schema
Country Object
| Field | Type | Description |
|---|---|---|
countries | array | List of all supported countries (only for /formats) |
code | string | ISO 3166-1 alpha-2 country code |
name | string | Country name in English, e.g. "Germany" |
label | string | The service’s display label, e.g. "Germany (DE)" |
formats | string[] | The country’s format ids, PDF first (e.g. "pdf", "xrechnung") |
formatDetails | array | The same formats with display label and kind |
Format Object
| Field | Type | Description |
|---|---|---|
code | string | Format id for the endpoint path (e.g. xrechnung) |
label | string | Display label of the format, e.g. "XRechnung 3.0/3.0.2" |
kind | "pdf" | "einvoice" | "pdf" for PDF output, "einvoice" for an e-invoice format |
Supported Countries & Formats
DEGermanyATAustriaCHSwitzerlandFRFranceITItalyESSpainNLNetherlandsBEBelgiumPLPolandPTPortugalAEUnited Arab EmiratesAUAustraliaBGBulgariaCYCyprusCZCzech RepublicDKDenmarkEEEstoniaFIFinlandGBUnited KingdomGRGreeceHRCroatiaHUHungaryIEIrelandISIcelandJPJapanLILiechtensteinLTLithuaniaLULuxembourgLVLatviaMTMaltaNONorwayNZNew ZealandOMOmanRORomaniaSESwedenSISloveniaSKSlovakia= Available
Use Cases
Dynamic UI
Use the API to dynamically populate dropdown menus for country and format selection. This keeps your UI components always up to date.
Validation
Validate user inputs before calling the Creator or Converter API. Prevent invalid country-format combinations.
Documentation
Automatically generate documentation for your application with currently supported formats and countries.
Using Format IDs
The code from the response (e.g. xrechnung, zugferd) is used as the formatparameter in the other APIs, e.g. /api/v1/invoice/de/xrechnung/generate.