Module 4 · ASYCUDA provider

Signed off 26-10-2026 · the signed-off copy is in HistoryUpdated 26-10-2026

This page is one of the eleven modules of step 2. Read next: Module 5 · Engine · All the modules.

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/tariff D52.

WHO ASKS THE CONTRACT ONE PROVIDER THE FIGURES Traderon any portal Public pageor embedded page Contractexact decimals,a currency each ASYCUDA providercomputes nothing rwandatrade.rwprovider Computing providerengine · indicative Customs serviceOBR's tariff API Trade portalRwanda Tariff versionpublished, dated fills asks chosen on the administration page translated translated reads
One contract, three providers, one chosen per installation. The contract is the calculator's own; each provider translates to and from it, and no provider is asked to change D20, D23.

Functions

Connect

  1. 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.
  2. Certificate: a missing intermediate certificate is carried; verification never off.
  3. Time limit: every call ends after a set time; the page's language goes on every call.

Translate the request

  1. 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.
  2. Exports: EX, a regime from the service's table, the country as exporter and origin, FOB, a destination (ERN-1251).

Reference tables

  1. Serve them: eleven tables, kept 7 days; exchange rates 1 day D29.
  2. 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

  1. 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.
  2. Flat or percentage: base × rate equals the amount, or it is flat. A zero rate is zero.

Watch

  1. Health: a cheap reference call every five minutes, so the page can say since when the service is down.
  2. Access: one call, once the key is set, shows whether customs accepts the server's address D24; shadow calls stay few.

Rwanda

  1. 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

  1. 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.

The contract · Concept note §3 and §8 · Module 3 · Module 9 · Module 10 · Module 0 · Dictionary

Rules

  • 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.

Decisions needed

?18 and ?19: D29, D30. ?37, ?38 and ?40: D52, D53, D55.

Sources

  • eRegulations v7: Business/Tariffs.cs and Model/TariffsModel.cs in eRegulations-4.0-Admin, read 28-09-2026.
  • The prototype's server.js, docs/BURUNDI.md §1, §2 and §5, commit 4f0f969.
  • Tickets ERN-1233, ERN-1235, ERN-1251 and ERN-1254, read 30-09-2026.
  • The prototype's server.js: Rwanda's portal called with a borrowed User-Agent and Referer.
  • What 7.x's tariff page gained, 04-09 to 15-10-2026: rows C, D, F, I, J, L.
  • KRA's Customs Tax Calculator API, read on 26-10-2026.
  • 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.
Drafted with Claude for melux · UNCTAD · working material, hidden from search enginesUpdated · 26-10-2026