Care (failed invoices)
Permanent rejections and who acts on them.
- In the sandbox
In plain words
The care list holds the invoices a country route rejected for good or that failed every retry, with what is wrong and who acts. It is where the monthly Rejection Care service works. We never send a rejected file again as it is: the client or partner fixes the data in the ERP, and a corrected invoice is submitted.
An invoice lands on the care list when the route rejects it for good, or when transient failures use up their retries. The list says what is wrong and who acts. We never send a rejected file again as it is: fix the data in the ERP and submit a corrected invoice. Rejection Care, the monthly retainer, works from these three calls. The service level is in the contract, not here.
A client's key with the read scope reads its own client's rows. Marking a row handled is Rejection Care's work, so a client's key gets 403 on that call.
The list
GET /care returns one row per invoice.
| Field | Meaning |
|---|---|
invoice_id | The invoice's id. |
invoice_ref | The partner's own reference. |
client, route | The client and the route of the invoice. |
catalogue_code | The code that explains the rejection (see errors). |
who_acts | The code's owner: erp, us, business, client, buyer or route. |
field | A place in the canonical model, such as invoice.buyer_reference. Never a value. |
fix_hint | What to change, from the rejection or the catalogue entry. |
age_seconds | How long the invoice has been on the list. |
deadline_at | The invoice's indicative deadline, when it has one (see read an invoice). |
handled | Whether someone has marked it handled. |
handled_at | When it was marked. Present only when handled is true. |
The status query parameter picks open, handled or all (the default). A client's key gets at most its newest 200 rows, and truncated: true says when there are more. It may list 30 times a minute.
Note
The list holds no invoice body, and neither does the log.
curl "https://api-sandbox-eu.eurinvoice.com/care" \
-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/care"))
.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/care', {
headers: {
Authorization: 'Bearer <your-api-key>',
},
});
console.log(response.status);
console.log(await response.text());{
"data": []
}Mark it handled
POST /care/{id}/handled marks a row handled and answers with that row. Calling it again keeps the first handled_at. An invoice that is not on the list answers 404. Only the operator's key may call it.
curl -X POST "https://api-sandbox-eu.eurinvoice.com/care/inv_unknown/handled" \
-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/care/inv_unknown/handled"))
.header("Authorization", "Bearer <your-api-key>")
.POST(HttpRequest.BodyPublishers.noBody())
.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/care/inv_unknown/handled', {
method: 'POST',
headers: {
Authorization: 'Bearer <your-api-key>',
},
});
console.log(response.status);
console.log(await response.text());{
"type": "https://eurinvoice.com/problems/not-found",
"title": "This invoice is not on the care list",
"status": 404
}Export the evidence
GET /care/{id}/evidence returns the files stored for the invoice: invoice_id and a files list, each with its kind, its sha256 and the file itself as file_base64. The file is the stored original, so the body is in this answer and not in the list. An invoice that is not on the list answers 404, and so does another client's invoice. A client's key with the read scope may call it 10 times a minute. Files over 8 MiB in all answer 413 (evidence-too-large); read them one by one with GET /invoices/{id}/documents/{kind}.
curl "https://api-sandbox-eu.eurinvoice.com/care/inv_unknown/evidence" \
-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/care/inv_unknown/evidence"))
.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/care/inv_unknown/evidence', {
headers: {
Authorization: 'Bearer <your-api-key>',
},
});
console.log(response.status);
console.log(await response.text());{
"type": "https://eurinvoice.com/problems/not-found",
"title": "This invoice is not on the care list",
"status": 404
}Answers
| Status | Meaning |
|---|---|
200 | The list, the marked row, or the evidence. |
401 | No key, or an unknown key. |
403 | The key lacks the read scope, or a client's key tried to mark a row handled. |
404 | The invoice is not on the care list. |
413 | The evidence is over 8 MiB in all (evidence-too-large). |
429 | Too many requests for the key. Wait for Retry-After seconds. |