Postman Collection
A ready-to-import Postman collection with every endpoint pre-built and a pre-request script that signs each request automatically — you never compute an X-Signature by hand.
Download
| File | Link |
|---|---|
| Collection | OfficeUG-Partner-API.postman_collection.json |
| Sandbox environment | OfficeUG-Partner-API-Sandbox.postman_environment.json |
Import into Postman
- File → Import in Postman (or drag both files onto the Postman window).
- Import the collection first, then the environment.
- Select OfficeUG Partner API — Sandbox from the environment dropdown, top-right.
- Open the environment (the eye icon next to the dropdown) and fill in:
| Variable | Value |
|---|---|
base_url |
https://sandboxsacco.officeug.com (already set) |
api_key |
Your sandbox pk_sandbox_... key |
api_secret |
Your sandbox sk_sandbox_... secret |
account_ref |
SANDBOX-001 (already set — see Sandbox for the other fixture accounts) |
Get api_key/api_secret from your SACCO's Partner API "Partners" screen.
How the signing works
Every request in the collection is unsigned as written — no X-Signature is hardcoded anywhere, because a hardcoded signature would only ever be valid for one exact timestamp. Instead, the collection-level Pre-request Script (Collection → Edit → Pre-request Script tab) runs before every single request and:
- Builds the canonical string exactly as described in Authentication:
{timestamp}|{METHOD}|{request_uri}|{content_type}|{sha256(body)}. - Signs it with
api_secretusing HMAC-SHA256 (via Postman's bundledcrypto-js). - Attaches
X-Api-Key,X-Timestamp, andX-Signatureheaders automatically.
You will never see these three headers listed on an individual request — they're injected at send time. If you want to see the exact values that were sent, open the response and check the Postman Console (View → Show Postman Console) before sending, which logs the final outgoing request.
Why does the script rewrite the request body too? Postman resolves
{{variables}}in the URL/body after the pre-request script runs. If the script signed the raw{{account_ref}}-style template text but Postman then substituted the real value before sending, the signature would cover different bytes than what actually goes over the wire — and the server would reject it asINVALID_SIGNATURE. The script resolves variables itself first (pm.variables.replaceIn) and overwrites the request body with that exact resolved string, so what's signed and what's sent are always byte-for-byte identical.
What's in the collection
- Read — Get balance, Get statement, Verify account (all sandbox-safe, read-only).
- Money movement — Create disbursement, Create collection, Confirm collection. Amounts are demo values (
5000/2000UGX) against{{account_ref}};idempotency_keyuses Postman's{{$guid}}dynamic variable so re-running a request never accidentally replays the previous one. - Operations — Get operation status, List operations (POST, recommended), List operations (GET, deprecated — kept for reference against existing integrations, sunset 2027-01-30).
Create disbursement and Create collection each have a Tests script that reads data.operation_id from a successful response and saves it into the operation_id environment variable automatically — so you can run Create collection followed immediately by Get operation status (or Confirm collection, against a live partner) with no manual copy-pasting.
Trying the OTP-gated collection flow
Sandbox partners cannot exercise this flow — require_collection_otp is always ignored in sandbox mode (there's no real member behind a fake test account to send a code to), so Create collection against a sandbox credential always comes back completed immediately, regardless of the setting. See Collections.
To actually see it: duplicate the environment (see "Switching to production" below) with live credentials — every live partner has this on by default unless a SACCO admin has turned it off — then:
- Run Create collection against a real member account. The response comes back
awaiting_confirmation;operation_idis saved automatically. This moves toward a real debit — use a small amount and an account you're authorised to test against. - The confirmation code is sent to that member's real email/SMS.
- Get the code from the member and set the
otpenvironment variable to it. - Run Confirm collection — this is where the debit actually happens.
Switching to production
Duplicate the environment (right-click → Duplicate), rename it, and change three values: base_url to https://prodsacco.officeug.com, plus your live api_key/api_secret. Everything else — the collection, the pre-request script, the request bodies — is identical. Live requests move real member money; there is no sandbox-style safety net once you switch.