Naar de inhoud

API-documentatie

Foutcodes

Elke fout van de API's heeft een vaste code. Die staat in het veld code van de foutmelding; het veld type linkt naar de uitleg hier. Een code verandert nooit van betekenis, dus bouw je foutafhandeling daarop.

82 foutcodes

De uitleg per code is in het Engels, net als de API-documentatie.

Elk verzoek

  • bad_requestHTTP 400

    The request could not be read, for example a body that is not valid JSON.

  • One or more fields of the request are invalid. errors lists each field and why.

  • No session, or the session expired or was revoked. Log in again.

  • forbiddenHTTP 403

    The request is not allowed for this caller.

  • not_foundHTTP 404

    Nothing exists at this path. In the portal: no member, API key, delegation, request or import with this id in your organization.

  • conflictHTTP 409

    The change conflicts with the current state: the link or delegation already exists, or would create a cycle.

  • The body is too large: at most 100 kB of JSON, or 1 MB for a CSV upload.

  • This endpoint does not accept the content type of the body.

  • request_rejectedHTTP 405, 406, 411, 412, 416

    The request was refused for the reason its HTTP status gives. Used for any 4xx without a more specific code.

  • rate_limitedHTTP 429

    Too many requests. The limits: currently 600 a minute per API key (by default), 60 failed API key attempts a minute per address, and per-address limits on portal logins and sign-ups. Wait for the seconds in Retry-After.

  • An unexpected error in the register. The response shows no internals; quote the requestId so the register can find it in its logs. On a price line: nothing of that report was recorded, and sending it again is safe.

  • service_unavailableHTTP 502, 503, 504

    The register is temporarily unavailable. Try again in a few minutes.

API-sleutels

  • No API key was sent, or not as Authorization: Bearer <key>.

  • The API key does not exist. Check that you sent the whole key.

  • The API key has been revoked. Create a new one in the portal.

  • The API key lacks a scope this endpoint needs: data:read for the Consumer API, prices:write or stations:write for the Reporting API.

  • The organization is pending or suspended. Its API keys are refused; in the portal it can do only some things.

Consumer API: zoekvragen en klachten

  • A query parameter is invalid. detail and errors say which and why.

  • A latitude, longitude or bounding box is not valid.

  • A moment is not an ISO 8601 timestamp with offset, such as 2026-11-24T12:00:00+01:00. In a query string, encode + as %2B.

  • unknown_codeHTTP 400

    A fuel, brand or facility code in the query does not exist. The reference endpoints list the codes.

  • The cursor was not issued by this API, or belongs to another query. Pass meta.nextCursor unchanged, with the same other parameters.

  • The station id in the path is not a UUID.

  • Your API key already used this externalRef for a complaint about another station. Use a new reference.

  • The API key already has its maximum of open price-change streams (2), or this server has no room for another stream. Close one, or poll GET /v1/price-changes. retryAfterSeconds says when to try again.

Stations en prijzen

  • The station does not exist, or you may not act on it. Both answer the same.

  • The ref: matches stations of more than one organization you act for. Use the station id.

  • station_closedHTTP 409, 410

    The station is closed for good. The Reporting API and the portal answer 409 and take no more prices; the Consumer API answers 410 Gone.

  • fuel_not_at_stationHTTP 404, 422

    The station does not sell this fuel, or the fuel code does not exist.

  • The station no longer sells this fuel (discontinued). Make it available again in the portal first.

  • The price does not exist, or it belongs to a station you may not act on.

  • The price was already voided.

  • The replacement price of a void breaks a price rule. Nothing was voided; replacement holds the line result.

  • The station's status does not allow this change. Through the Reporting API you can only switch between active and temporarily_closed; going live and closing for good happen in the portal.

  • The station data is not valid. errors lists the fields.

Afgewezen prijsregels

  • validFrom lies more than two minutes ahead of the register clock. Report a price when it takes effect, not before.

  • The same fuel occurs more than once in one report. Only the first line is processed.

  • invalid_priceHTTP geen

    The price is not a positive amount with at most three decimals.

  • unknown_fuelHTTP geen

    The fuel code does not exist.

  • The price lies outside the plausible range of the fuel (minPrice to maxPrice). Usually a typo or a wrong unit.

  • Another price is already recorded for this product at exactly this validFrom. Void that price first, or void it with your price as replacement.

  • A reconfirmation names a product that has no current price. Report a price instead.

Portaal

  • Wrong e-mail address or password, or the account is locked or disabled (all answer the same).

  • Wrong or reused two-factor code, or the login challenge expired.

  • An account was locked after repeated failed logins (the response stays invalid_credentials).

  • csrf_failedHTTP 403

    The CSRF header is missing or wrong, or the request came from another site.

  • No such organization, or you are not a member.

  • Your role in the organization is too low for this action.

  • You may see this station but not do this to it (delegation scope or role).

  • The route needs a register administrator.

  • email_takenHTTP 409

    The e-mail address already has an account.

  • An organization of this kind with this KvK number is already registered.

  • The link (invitation, reset, verification) is unknown, used or expired.

  • The current password is wrong (change password, disable 2FA).

  • last_ownerHTTP 409

    The change would leave the organization without an active owner.

  • The person is already a member.

  • invalid_csvHTTP 422

    The CSV file cannot be read at all (no header, wrong columns, too many rows).

  • The import was committed already, has expired, or has errors (see skipRejected).

  • Two-factor authentication is already on, already off, or has no enrolment pending.

Beheeromgeving

  • A register administrator without two-factor authentication. Turn it on at /portal/account (enrolUrl), then try again.

  • The organization's status does not allow this decision (approve an active one, suspend a pending one, ...).

  • The code of a fuel type, brand or facility (or the unit or category of a fuel type) is used by stations or prices and cannot change.

  • A reporting policy that took effect cannot change or be withdrawn, and a new one must start in the future.

  • The work list item was reviewed or voided already, or the price was voided by its reporter.

  • The complaint is resolved or rejected already.

  • An incident notice starts now or in the past: something that does not work yet cannot be reported. Only maintenance can be announced ahead.

Website-API

  • The register has switched off prices on its public website. Information services publish them through the Consumer API.

Werking van het register (alleen in logs)

  • The process could not start (FATAL, exit code 1).

  • An uncaught exception or unhandled rejection stopped the process (FATAL, exit code 1).

  • A log event could not be serialised; this line replaces it.

  • job_failedHTTP geen

    A command-line run (migrate, seed, org:approve, simulator) or scheduled job failed.

  • A SQL migration failed and was rolled back.

  • An applied migration file was changed afterwards.

  • A mail could not be handed to the SMTP server or the dev outbox; the change it reports on stands.

  • A snapshot download failed after streaming had started; the connection was cut.

  • API usage counters could not be written; they are retried.

  • A system setting could not be read; the built-in default is used.

  • The simulator could not complete one simulated action (a report, void or availability change); the run goes on.

  • The simulator got an answer it has no rule for: an unknown code, an unexpected status or response shape.

  • The last-seen moment of a session could not be updated.

  • The shared rate-limit counters (Postgres) could not be reached; this api instance counts in its own memory until they can.

  • The PDOK address service did not answer in time or answered with an error; the site search offers the register only for a short while.

Zo ziet een foutmelding eruit

Elke fout komt terug als JSON met het content-type application/problem+json (de standaard RFC 9457). Een verzoek zonder API-sleutel krijgt bijvoorbeeld:

{
  "type": "https://openbrandstof.nl/problems/api_key_missing",
  "title": "Unauthorized",
  "status": 401,
  "detail": "An API key is required: send it as Authorization: Bearer <key>.",
  "code": "api_key_missing",
  "instance": "/v1/prices",
  "requestId": "0193a5b2-7c41-7e0a-9d3f-2b6c8e1f4a57"
}
type
Link naar de uitleg van deze foutcode op deze site.
title
Korte omschrijving, vaak de naam van de HTTP-status.
status
De HTTP-status van het antwoord.
detail
Wat er bij dit verzoek misging en wat je moet aanpassen.
code
De vaste foutcode. Bouw je foutafhandeling hierop, niet op title of detail.
instance
Het pad van je verzoek.
requestId
Het id van je verzoek, ook te vinden in de header X-Request-Id.
errors
Alleen bij ongeldige invoer: per veld wat er niet klopt.

Stuur bij een vraag de requestId mee; daarmee vindt het register je verzoek direct terug in de logs.

Alles over de API's staat in de documentatie van de Consumer API en de documentatie van de Reporting API.