Signed off 26-10-2026 · frozenMise à jour 26-10-2026
Cette page n’est pas encore traduite ; voici la version anglaise.
Definition and examples
The adapter that answers the calculator's contract by asking a customs service's ASYCUDA tariff API, and computes nothing itself: the port of eRegulations v7's TariffsBO. Examples: Burundi, against api-gue.obr.gov.bi/tariff with v7's production settings D24; Rwanda, against RRA's api.stp.sw.rra.gov.rw/tariffD52.
Un contrat, trois fournisseurs, un seul choisi par installation. Le contrat est propre au calculateur ; chaque fournisseur traduit vers lui et depuis lui, et aucun fournisseur n'a à changer D20, D23.
Functions
Connect
Credentials:api-id and api-key as headers, or in the query where the service takes only that; never sent to the browser, never logged; UNCTAD holds them for now D22, rotated from the administration page.
Certificate: a missing intermediate certificate is carried; verification never off.
Time limit: every call ends after a set time; the page's language goes on every call.
Translate the request
One currency: amounts are converted into the declaration currency with the service's rates of the day, rounded once (D23, ERN-1235); no rate, nothing sent.
Exports:EX, a regime from the service's table, the country as exporter and origin, FOB, a destination (ERN-1251).
Currencies: those the service quotes a positive rate for, less the installation's exclusions, the local currency always; each code sent as the service spells it, UGS found by "UGX" (D53, ERN-1300).
Translate the answer
Lines: each charge with its base, rate and amount in the local currency, as customs assessed it, and in the currency chosen on the form, converted with the service's rate D46.
Flat or percentage: base × rate equals the amount, or it is flat. A zero rate is zero.
Watch
Health: a cheap reference call every five minutes, so the page can say since when the service is down.
Access: one call, once the key is set, shows whether customs accepts the server's address D24; shadow calls stay few.
Rwanda
RRA: the same adapter, credentials in the query, which RRA alone takes; no request log, since the address holds the key; no live traffic before RRA agrees D52. The rwandatrade.rw provider is withdrawn.
Kenya
KRA's tax calculator: a customs service's own API that is not ASYCUDA, published on 26-10-2026 for its sandbox only. It takes one value in one currency, with no freight, insurance, origin or regime, and answers a total, the import declaration fee and the railway levy, with no line per charge; the rates come from another call. A third kind of adapter, not written: a candidate, tested against the contract in step 4 from a sandbox account D55; its totals shown as they come D56.
Customs' answer is shown as it is; defects are reported to the service, never corrected D4.
When the service does not answer, no computed figure replaces it unless the country allows it; Burundi does not D11.
A 401 or 403 is an alert to the administrators, never shown on a field. A 4xx, or a 500 while the probe is healthy, refuses this shipment; a timeout, or errors while the probe fails, is an outage.
An unknown code answered with an empty 200 is "not found", not an error; an empty list of rates is a failure.
Not seen: OBR's production service from the calculator's server; whether OBR's export estimate is live; RRA's agreement; any answer from KRA's sandbox.
Rédigé avec Claude pour melux · CNUCED · document de travail, masqué des moteurs de rechercheMise à jour · 26-10-2026