Cette page n’est pas encore traduite ; voici la version anglaise.
The contract is the calculator's own API: what the page, a portal or eRegulations sends, and what comes back. Whichever provider computes, ASYCUDA, Rwanda's portal or our engine, the page sees only this. Here it is, with a real Burundi estimate.
Why a contract of our own. OBR's service takes one currency for the whole shipment and eRegulations v7 hands back figures that are not exact. Our contract carries a currency on every amount and exact decimals. Each provider has an adapter that translates to and from it, so no customs service is ever asked to change D23. This page is the first draft; step 4 fixes every field.
| Operation | Request | Answers |
|---|---|---|
| Search a product | GET /api/v1/search?q=riz&lang=fr |
Codes, descriptions (with translations, D35), units |
| One product | GET /api/v1/commodity/10062000000 |
The code, its units, any additional variable it needs |
| A reference list | GET /api/v1/reference/currencies |
Countries, currencies, regimes, treatments, packages, delivery terms |
| An estimate | POST /api/v1/estimate |
Every charge with its base, rate and amount, the total, where it came from |
All four answer in JSON. Amounts are strings holding exact decimals, so "53184540.00" is never rounded on the way. Every amount says its currency.
Husked rice from Pakistan into Burundi: invoice 50 000 000 BIF, external freight 2 000 000, insurance 500 000, 25 000 kg in 500 cartons. The request below is ours; OBR's real answer of 30-09-2026 is translated back into ours underneath.
{
"flow": "import",
"regime": "4",
"commodity": "10062000000",
"origin": "PK",
"treatment": null,
"quantities": [{ "value": "25000", "unit": "KGM" }],
"weightGross": "25000",
"packages": { "count": 500, "type": "CT" },
"amounts": {
"invoice": { "value": "50000000", "currency": "BIF" },
"externalFreight": { "value": "2000000", "currency": "BIF" },
"internalFreight": { "value": "0", "currency": "BIF" },
"insurance": { "value": "500000", "currency": "BIF" }
},
"resultCurrency": "BIF",
"lang": "fr"
}
The adapter turns ours into OBR's shape: one currency for the whole declaration, the country's fixed values from the installation's settings (procedure 4000, national procedure 000, destination BI, CIF), and nothing the trader did not give.
{
"declarationType": "IM", "declarationProcedure": "4",
"exportCountry": "PK", "destinationCountry": "BI",
"deliveryTerms": "CIF", "currencyCode": "BIF",
"items": [{
"commodityCode": "10062000000", "originCountry": "PK",
"invoiceAmount": 50000000, "externalFreightAmount": 2000000,
"internalFreightAmount": 0, "insuranceAmount": 500000,
"quantity": 25000, "weightGross": 25000,
"packagesNumber": 500, "packagesType": "CT",
"extendedProcedure": "4000", "nationalProcedure": "000"
}]
}
Had the invoice been in USD and the freight in KES, the adapter would first convert both into one currency with OBR's own rates, and say so in the answer. That is what eRegulations v7 already does (ERN-1235).
OBR answered 53 184 540 BIF in nine charges: eight on the rice, and the declaration's flat form fee. Translated into ours:
{
"provider": "asycuda",
"source": "OBR tariff API",
"answeredAt": "2026-09-30T17:25:00+02:00",
"indicative": false,
"customsValue": { "value": "52500000.00", "currency": "BIF" },
"total": { "value": "53184540.00", "currency": "BIF" },
"totalLocal": { "value": "53184540.00", "currency": "BIF" },
"rate": { "from": "BIF", "to": "BIF", "value": "1", "date": "2026-09-30", "source": "OBR" },
"charges": [
{ "code": "DDI", "name": "Droit de douane à l'importation",
"base": "52500000.00", "rate": { "kind": "percent", "value": "75" }, "amount": "39375000.00" },
{ "code": "RAD", "name": "Redevance administrative",
"base": "52500000.00", "rate": { "kind": "percent", "value": "1" }, "amount": "525000.00" },
{ "code": "FIP", "name": "Financement infrastructure publique",
"base": "52500000.00", "rate": { "kind": "percent", "value": "1.5" }, "amount": "0.00", "exempt": true },
{ "code": "TSR", "name": "Taxe de sûreté",
"base": "52500000.00", "rate": { "kind": "percent", "value": "2" }, "amount": "1050000.00" },
{ "code": "PFR", "name": "Prélèvement forfaitaire",
"base": "52500000.00", "rate": { "kind": "percent", "value": "3" }, "amount": "1575000.00" },
{ "code": "RIF", "name": "Redevance informatique",
"base": "52500000.00", "rate": { "kind": "percent", "value": "0.25" },"amount": "131250.00" },
{ "code": "RIR", "name": "Redevance d'intégration régionale",
"base": "52500000.00", "rate": { "kind": "percent", "value": "2" }, "amount": "1050000.00" },
{ "code": "TVA", "name": "Taxe sur la valeur ajoutée",
"base": "94631250.00", "rate": { "kind": "percent", "value": "10" }, "amount": "9463125.00" },
{ "code": "DMC", "name": "Vente des chemises déclarations", "level": "declaration",
"rate": { "kind": "flat", "value": "5", "currency": "USD", "at": "3032.9106" }, "amount": "15164.55" }
],
"messages": [],
"notices": [ "estimate" ]
}
Four things the translation does that the customs answer does not:
{ "error": "refused", "provider": "asycuda", "fields": { "items[0].weightGross": "Required" } }
{ "error": "unavailable", "provider": "asycuda", "since": "2026-09-30T20:20:00+02:00" }
{ "error": "not-found", "commodity": "99999999999" }
A refusal names the field so the page can show it there; "unavailable" carries the time the probe first failed; an unknown code is refused before anything is sent to customs (module 1).
| OBR's API | eRegulations v7's API | The calculator's contract | |
|---|---|---|---|
| Currency | One per declaration | One per request; since 29-09-2026 the page converts each amount first, with a rate list up to 7 days old | One per amount |
| Numbers | Floating point | int in, float out |
Exact decimals, as strings |
| Flat charges | Look like percentages | The same | Marked flat, with their currency |
| Exempt charges | Nominal rate, zero applied | The same | Marked exempt |
| Where it came from | Not said | Not said | Provider, time, rate date, tariff version when computed |
| Exports | EX in the same call |
EX in the same call, since 7.6.22 (01-10-2026) |
"flow": "export" |
infocommerce.obr.bi/api/tariffs/estimate), 30-09-2026: the rice case above, one call.EstimateInput, EstimateResult, EstimateTax.TariffsModel.cs and TariffsController.cs; ticket ERN-1235 for the conversion of amounts.docs/BURUNDI.md §5 on flat charges and zeros, and its August total of 53 184 493,74 BIF, since moved by the dollar's rate.