Error codes

The API uses traditional HTTP response codes to indicate if an API request succeeded or failed.

Codes in the 2xx range indicate success.

Codes in the 4xx range indicate an error that failed given the data provided

Codes in the 5xx range indicate an error with the API.

Additional error codes will be returned to the client if the given data doesn't pass validation but only when validating and submitting invoices.

Error codes for array elements will be formatted using the dot notation syntax(0 indexed).

Error code summary

Error Code Meaning
1000 invoice_number is missing.
1001 invoice_number must be of type integer.
1002 invoice_number The invoice already exists.
This is calculated by creating a checksum of the request data invoice+treatments(if any) and comparing it to the already found invoice(by invoice_number).
You can override an invoice using the override_invoice attribute but only for the current day.
2000 cpr is missing.
2001 cpr must be numeric.
2002 cpr must be 10 digits.
2003 cpr must start with a valid date in format dmy.
3000 payment_date is missing.
3001 payment_date must be a valid date in format Y-m-d.
4000 payment_by_provider is missing.
4001 payment_by_provider must be of type boolean.
5000 use_grant is missing.
5001 use_grant must be of type boolean.
6000 fi_code must be a string.
6001 fi_code must start with one of the following '+01', '+04', '+15', '+71', '+73', '+75'.
7000 treatments must be of type array.
8000 treatments[start_date] is missing.
8001 treatments[start_date] must be a valid date in format Y-m-d.
9000 treatments[end_date] is missing.
9001 treatments[end_date] must be a valid date in format Y-m-d.
9002 treatments[end_date] must be greater than or equal to 3 years ago from today.
10000 treatments[treatment_type_number] is missing.
10001 treatments[treatment_type_number] must be a integer.
10002 treatments[treatment_type_number] the provided treatment_type_number doesn't exists.
10003 treatments[treatment_type_number] the provided treatment_type_number is not valid within the given start and end date.
11000 treatments[number_of_treatments] is missing.
11001 treatments[number_of_treatments] must be a integer.
12000 treatments[user_expense] is missing.
12001 treatments[user_expense] must be a integer.
13000 treatments[correction_code] is missing.
13001 treatments[correction_code] must be a integer.
13002 treatments[correction_code] must be one of the following 0, 1, 2, 3, 4.
14000 provider_id is missing. As a data provider you are required to specify your customer's provider_id.
14001 provider_id must be a integer.

Optician treatment codes

Error codes in the range 16000-38999 are related to input validation issues in the treatments list for optician invoices
Currently, the first 2 digits specify which field errored, and the last digit what went wrong:

Error Code Meaning
xxxx0 A required field is missing.
xxxx1 Field had the wrong type, e.g. string instead of integer.
xxxx2 Value was not in the allowed range
xxxx3 Field expects a Quarter Dioptre but the given value was invalid.
Error Code Errored field
16xxx product
17xxx product_type
18xxx sphere_component_right
19xxx cylinder_component_right
20xxx axis_right
21xxx addition_component_right
22xxx prism_right
23xxx basis_right
24xxx radius1_right
25xxx radius2_right
26xxx sphere_component_left
27xxx cylinder_component_left
28xxx axis_left
29xxx addition_component_left
30xxx prism_left
31xxx basis_left
32xxx radius1_left
33xxx radius2_left
34xxx color_percentage
35xxx eye_examination_date
36xxx correction_code_optician
37xxx service_code
38xxx number_of_lenses
39xxx is_subscription

Example response:

"error_codes": [