Proposed integration approach
Sator Tracking ↔ E-Certificate
Based on the API document you shared, this is the approach we suggest for connecting the two systems. It keeps your existing certificate endpoints and clarifies vehicle lookup, authentication, pricing, and the IremboPay checkout flow.
1. Introduction
Thanks for sharing the API document. The certificate endpoints already cover most of the flow we need. The main point we suggest adjusting is authentication: this integration is server-to-server, so it should not depend on an individual customer's username and password.
POST /tracking/sign could technically work if it uses a
dedicated integration account and has a documented token-expiry or
refresh process. A service Bearer token is simpler and safer for both
systems, so that is the preferred option below.
| Current API document | Suggested integration approach |
|---|---|
| User signs in with username and password | Each backend sends Authorization: Bearer <token> |
| Token tied to a logged-in user | A credential tied to the Sator Tracking integration, not one employee |
| Session expires, sign-out, change password | A service token, or a documented token refresh flow |
| A customer signing in | Sator Tracking backend talking to e-certificate backend |
People continue to sign in to Sator Tracking as they do today. Integration
credentials stay on the servers. The dashboard only receives the public IremboPay fields:
publicKey and invoiceNumber.
2. Authentication
Our preferred option is a Bearer token issued specifically for the integration. In that setup, these user-account operations are not part of the integration flow:
POST /tracking/signPOST /tracking/signoutPOST /tracking/changepassword- The
accessTokenheader
Both systems use the standard header:
Authorization: Bearer <partner_token>
| Who calls whom | Which token |
|---|---|
| You → Sator Tracking (is this vehicle in our system?) | Sator Tracking provides an integration token, shared through a secure channel. |
| Us → you (prices, start payment, PDF) | E-certificate provides a service token, or dedicated service-account credentials with token refresh details. |
Wrong or missing token → 401
{
"success": false,
"message": "Unauthorized"
}
3. Who does what
| Sator Tracking | E-certificate |
|---|---|
| Check the vehicle exists (plate, IMEI, chassis, owner) | Templates and the rate for each allowed period |
| Display the amount returned by the e-certificate API | Create the IremboPay invoice on your merchant account |
| Open the IremboPay widget in our dashboard | Take the payment and issue the official PDF |
| Wait until paid, then show the PDF | If our vehicle lookup returns 404, do not issue |
GET /api/v1/vehicle/{key}.
4. Price and period
The e-certificate system should remain the source of truth for pricing. Sator Tracking will not calculate the certificate amount or keep a separate hardcoded rate.
The customer selects one of the period-and-rate options returned by the
templates API. Sator Tracking sends the selected
period and the selected templateId to
POST /certificates. The e-certificate API then returns the
final amount and currency. That returned amount
is what Sator Tracking displays and what the IremboPay invoice charges.
| Value | Source |
|---|---|
| Certificate templates | E-certificate templates API |
| Allowed periods and their rates | E-certificate templates API |
| Final amount and currency | POST /certificates response |
- The templates API returns each allowed period together with its rate.
- Sator Tracking sends only
templateIdand the selectedperiod; it does not send a price. - Sator Tracking displays the returned period rate without calculating it.
- The e-certificate backend validates the selected period and returns the final amount again when creating the invoice.
- The amount returned by
POST /certificatesis authoritative.
5. Payment flow
From the customer clicking Renew to having a PDF:
| Item | Value |
|---|---|
| Sator Tracking base URL | https://dapi.satorrwanda.rw |
| E-certificate base URL | To be confirmed for host 165.232.70.85 |
| Content-Type | application/json |
| Currency | RWF |
6. Sator Tracking vehicle API
The e-certificate backend can use this endpoint to confirm that a vehicle exists in Sator Tracking.
6.1 Get vehicle by key
This can replace the separate
/vehicles/plateNumber/{plateNumber} and
/vehicles/serialNumber/{serialNumber} calls in the shared document.
{key} can be the plate, the IMEI / device serial, or our numeric vehicle id. If the plate has spaces, encode them (RAD%20292%20T). It has to match how we stored it.
Header: Authorization: Bearer <sator_token>
200: vehicle exists
{
"success": true,
"data": {
"id": 42,
"make": "TOYOTA",
"imei": "352544071445473",
"plate_number": "RAD 292 T",
"chassis_number": "YVZE4C4A7WB20794",
"vehicle_type": "van",
"status": "online",
"tenant": {
"id": "...",
"name": "Karinda DESIRE",
"contact_email": "owner@example.com",
"phone": "078xxxxxxx",
"address": "Kigali"
}
}
}
| E-certificate vehicle field | From this response |
|---|---|
plateNumber / registrationNumber | data.plate_number |
imeiNumber / deviceSerialNumber | data.imei |
chassisNumber | data.chassis_number |
make | data.make |
type | data.vehicle_type |
ownerNames | data.tenant.name |
ownerTelephoneNumber | data.tenant.phone |
ownerEmail | data.tenant.contact_email |
404 vehicle is not registered in Sator Tracking; certificate issuance should stop.
409 more than one vehicle matched that key.
401 bad token. 400 invalid key.
{ "success": false, "message": "Vehicle not found" }
The response includes chassis_number. The current search keys are plate, IMEI, and numeric id. Search by chassis can be added if it is required by the integration.
7. Proposed use of the e-certificate APIs
The existing resource paths can remain as documented. For automated
calls, we suggest service authentication as described in section 2.
To open checkout in the Sator Tracking dashboard, the response from
POST /certificates would also need the public IremboPay fields:
IremboPay.initiate({ publicKey, invoiceNumber }).
7.1 Templates and rates by period
Sator Tracking uses this endpoint to load the certificate choices. Each template returns its allowed periods together with the rate for each period, so no price calculation is required in Sator Tracking.
Header: Authorization: Bearer <ecert_token>
[
{
"id": "temp001",
"name": "GPS tracking certificate",
"currency": "RWF",
"periodRates": [
{ "period": 1, "amount": 2000 },
{ "period": 3, "amount": 5500 },
{ "period": 6, "amount": 10000 }
]
}
]
period is the certificate duration in months, and
amount is the complete rate for that period. Points to
confirm: the available period-rate options and which
countryId and issuer values apply to Rwanda.
POST /certificates returns the final amount again before payment.
7.2 Certificates for a vehicle
Encode the plate if it has spaces. We use this to show what is already issued and when it expires.
Same array as in your document: certificateNumber, expiryDate, paymentStatus, status, period, and so on.
7.3 Start buy / renew
In the proposed flow, this endpoint creates the IremboPay invoice on the e-certificate merchant account. The e-certificate backend determines the final amount using its own pricing rules and returns it to Sator Tracking.
Request
{
"vehicle": {
"ownerNames": "Karinda DESIRE",
"registrationNumber": "RAD 292 T",
"plateNumber": "RAD 292 T",
"make": "TOYOTA",
"chassisNumber": "YVZE4C4A7WB20794",
"deviceSerialNumber": "352544071445473",
"imeiNumber": "352544071445473",
"ownerTelephoneNumber": "078xxxxxxx",
"ownerEmail": "owner@example.com",
"type": "van",
"simNumber": "078xxxxxxx"
},
"issuer": 1,
"paymentMethod": "MOBILE",
"period": 3,
"templateId": "temp001",
"referenceId": "550e8400-e29b-41d4-a716-446655440000",
"requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
| Field | Notes |
|---|---|
referenceId | A UUID generated by Sator Tracking and used to check payment status. |
requestId | An idempotency UUID. Repeating the same value should return the original result rather than create another certificate. |
period | Months, 1–6. |
templateId | From your templates endpoint. |
| Invoice contact | Use vehicle.ownerNames, vehicle.ownerTelephoneNumber, and vehicle.ownerEmail. A separate customer object is not required. |
paymentMethod | MOBILE like in your document (MoMo / Irembo checkout). |
200: suggested response when the invoice is ready. These additional fields allow Sator Tracking to open the IremboPay widget:
{
"referenceId": "550e8400-e29b-41d4-a716-446655440000",
"amount": 5500,
"currency": "RWF",
"period": 3,
"invoiceNumber": "IPAY-XXXX",
"publicKey": "<your IremboPay public key>",
"widgetScriptUrl": "https://dashboard.irembopay.com/assets/payment/inline.js",
"locale": "EN"
}
The dashboard uses only these public fields. The IremboPay secret key remains on the e-certificate server:
IremboPay.initiate({
publicKey,
invoiceNumber,
locale: IremboPay.locale.EN,
callback: function (err) { /* then poll 7.4 */ }
});
7.4 Payment status
The e-certificate system issues the certificate after receiving payment confirmation from IremboPay. Sator Tracking checks the status through this endpoint instead of checking settlement directly with IremboPay.
Following the shared document, Sator Tracking can check about 5 seconds after checkout closes, then retry up to 3 times at 10-second intervals.
| Code | Meaning |
|---|---|
| 201 | Payment pending; retry |
| 200 | Paid; body includes certificate.certificateNumber |
| Failed | Payment failed. The shared document uses 401; we should confirm whether this remains the intended application-level response. |
{
"code": 200,
"description": "Payment done successfully",
"certificate": {
"certificateNumber": "CERT-...."
}
}
An optional signed payment webhook from e-certificate to Sator Tracking would reduce polling, but it is not required for the first integration.
7.5 Official certificate PDF
Suggested response: the PDF file with Content-Type: application/pdf.
The existing send=true email option can remain. Sator Tracking can also fetch the file and present it in the dashboard.
8. Errors
JSON is enough. Please do not send stack traces.
{ "success": false, "message": "Vehicle not found" }
| HTTP | Meaning |
|---|---|
| 400 | Validation |
| 401 | Missing or bad Bearer token |
| 404 | Vehicle or certificate not found |
| 409 | More than one match, or we sent the same requestId twice |
| 429 | Rate limit |
9. Integration details to confirm
- The full base URL on
165.232.70.85(HTTPS, port, and any path prefix). - Authentication choice: service Bearer token, or dedicated
/tracking/signcredentials with token expiry and refresh details. countryId,issuer, andtemplateIdfor Rwanda.- Which period-rate options apply to each certificate template.
- Whether
POST /certificatescan returninvoiceNumber,publicKey,widgetScriptUrl, and the finalamount. - Test credentials and two or three sample plates.
- Whether a payment-confirmed webhook is available or polling should remain the only confirmation mechanism.
Sator Tracking will share its vehicle-lookup token through a separate secure channel.
10. Testing after integration
Once both sides are connected in the test environment, we can verify the complete flow together using a known Sator Tracking vehicle and an IremboPay sandbox payment.
- Use a known plate to confirm the vehicle lookup returns
200and the expected vehicle details. - Try an unknown plate and confirm the lookup returns
404. - Call an endpoint without the Bearer token and confirm it returns
401. - Load the certificate templates and confirm each allowed period and its rate match the e-certificate system.
- Select a template and period, then confirm Sator Tracking displays the final amount and currency returned by the API without recalculating them.
- Open the IremboPay widget and complete a sandbox payment.
- Check the payment reference. It may return
201while pending, followed by200with the certificate number. - Download the PDF using the certificate number and verify the vehicle, price, issue date, and expiry date.
- Repeat the request with the same
requestIdand confirm that a second certificate is not created.