3 API3.6
3.6
Katalogabfrage: GET /catalogue/{code}
Einen Katalogcode nachschlagen.
- In der Sandbox
In einfachen Worten
Dieser Aufruf erklärt einen Fehlercode in einfachen Worten: was falsch ist, was zu tun ist und wer handelt.
GET /catalogue/{code} liefert den öffentlichen Teil eines Katalogeintrags. Jeder Befund in einem Bericht und jeder Fehler in einem 422 enthält einen dieser Codes. Der Aufruf braucht einen Schlüssel mit dem Scope read. Der Code kann auch einer seiner Aliase sein.
| Feld | Bedeutung |
|---|---|
id | Der Code. |
meaning | Was falsch ist. |
fix | Was dagegen zu tun ist. |
owner | Wer handelt: us oder eine der anderen Stellen unter Fehler und Katalog. |
severity | error, business, warning oder info. |
routes | Die Übermittlungswege, für die der Code gilt. ALL bedeutet jeden Übermittlungsweg. |
partner_message | Der Satz, den wir an den Kunden senden würden. Bei manchen Codes gibt es ihn in mehr als einer Sprache. |
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"
}Für einen Code, der nicht im Katalog steht, lautet die Antwort 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
}Antworten
| Status | Bedeutung |
|---|---|
200 | Der Eintrag. |
401 | Kein Schlüssel oder ein unbekannter Schlüssel. |
403 | Dem Schlüssel fehlt der Scope read. |
404 | Kein solcher Katalogeintrag. |
429 | Zu viele Anfragen für den Schlüssel. Warten Sie Retry-After Sekunden. |