3 API3.6
3.6
Catalogus raadplegen: GET /catalogue/{code}
Eén cataloguscode opzoeken.
- In de sandbox
In gewone woorden
Deze aanroep legt één foutcode in gewone woorden uit: wat er mis is, wat u moet doen en wie handelt.
GET /catalogue/{code} geeft het openbare deel van één catalogusitem terug. Elke bevinding in een rapport, en elke fout in een 422, bevat een van deze codes. De aanroep vereist een sleutel met de scope read. De code kan ook een van zijn aliassen zijn.
| Veld | Betekenis |
|---|---|
id | De code. |
meaning | Wat er mis is. |
fix | Wat u eraan moet doen. |
owner | Wie handelt: us of een van de andere partijen op fouten en de catalogus. |
severity | error, business, warning of info. |
routes | De verzendkanalen waarvoor de code geldt. ALL betekent elk verzendkanaal. |
partner_message | De zin die we naar de eindklant zouden sturen. Voor sommige codes bestaat hij in meer dan één taal. |
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"
}Een code die niet in de catalogus staat, geeft 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
}Antwoorden
| Status | Betekenis |
|---|---|
200 | Het item. |
401 | Geen sleutel, of een onbekende sleutel. |
403 | De sleutel mist de scope read. |
404 | Dit catalogusitem bestaat niet. |
429 | Te veel aanvragen voor de sleutel. Wacht het aantal seconden in Retry-After. |