3 API3.6
3.6
Catalogue lookup: GET /catalogue/{code}
Look up one catalogue code.
- In the sandbox
In plain words
This call explains one error code in plain terms: what is wrong, what to do and who acts.
GET /catalogue/{code} returns the public part of one catalogue entry. Every finding in a report, and every error in a 422, carries one of these codes. The call needs a key with the read scope. The code can also be one of its aliases.
| Field | Meaning |
|---|---|
id | The code. |
meaning | What is wrong. |
fix | What to do about it. |
owner | Who acts: us or one of the others on errors and the catalogue. |
severity | error, business, warning or info. |
routes | The routes the code applies to. ALL means every route. |
partner_message | The sentence we would send to the client. For some codes it comes in more than one language. |
curl "https://api-sandbox-eu.eurinvoice.com/catalogue/EI-SCHEMA" \
-H "Authorization: Bearer <your-api-key>"import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api-sandbox-eu.eurinvoice.com/catalogue/EI-SCHEMA"))
.header("Authorization", "Bearer <your-api-key>")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}const response = await fetch('https://api-sandbox-eu.eurinvoice.com/catalogue/EI-SCHEMA', {
headers: {
Authorization: 'Bearer <your-api-key>',
},
});
console.log(response.status);
console.log(await response.text());{
"severity": "error",
"owner": "us",
"routes": [
"ALL"
],
"partner_message": "We could not read this invoice from your export. We are correcting our mapping; if a field is missing in the ERP we will tell you which one.",
"fix": "Read the JSON path in the error and correct the client mapping.",
"meaning": "The invoice JSON does not match the canonical model: a missing or unknown field, a wrong type or code, or a route rule on structure.",
"id": "EI-SCHEMA"
}A code that is not in the catalogue answers 404.
curl "https://api-sandbox-eu.eurinvoice.com/catalogue/NO-SUCH-CODE" \
-H "Authorization: Bearer <your-api-key>"import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api-sandbox-eu.eurinvoice.com/catalogue/NO-SUCH-CODE"))
.header("Authorization", "Bearer <your-api-key>")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}const response = await fetch('https://api-sandbox-eu.eurinvoice.com/catalogue/NO-SUCH-CODE', {
headers: {
Authorization: 'Bearer <your-api-key>',
},
});
console.log(response.status);
console.log(await response.text());{
"detail": "NO-SUCH-CODE",
"type": "https://eurinvoice.com/problems/not-found",
"title": "No such catalogue entry",
"status": 404
}Answers
| Status | Meaning |
|---|---|
200 | The entry. |
401 | No key, or an unknown key. |
403 | The key lacks the read scope. |
404 | No such catalogue entry. |
429 | Too many requests for the key. Wait for Retry-After seconds. |