Skip to main content

Requirements

Before integrating with the URA EFRIS System-to-System API using the community-maintained SDKs (PHP, JavaScript, or Python), ensure that all technical, regulatory, and environment requirements below are met.

Failure to meet these requirements will result in authentication errors, rejected payloads, signature validation failures, or failed URA audits.


1. URA Prerequisites (Mandatory)

EFRIS System-to-System Registration

You must be approved by URA to integrate using the System-to-System (S2S) flow.

  • Your business must be registered on the EFRIS Portal
  • S2S credentials must be issued by URA (distinct from EFD/AskURA credentials)
  • Sandbox credentials are different from production credentials

⚠️ These SDKs are S2S-only (appId: "AP04"). They will not work with EFD device-based or AskURA (appId: "AP05") integrations.


Required URA Credentials

You will receive the following from URA:

VariableDescription
tinTaxpayer Identification Number (10–20 digits)
deviceNoDevice Serial Number (DSN) – virtual or physical
taxpayerIdTaxpayer internal ID (usually 1)
brnBusiness Registration Number (optional, if applicable)
pfxPathPath to your .pfx certificate file
pfxPasswordPassword for the PFX certificate
envEnvironment: sbx (sandbox) or prod (production)

2. Supported Environments

All SDKs support both sandbox and production environments.

EnvironmentBase URLPurpose
Sandboxhttps://efristest.ura.go.ug/efrisws/ws/taapp/getInformationDevelopment & testing
Productionhttps://efrisws.ura.go.ug/ws/taapp/getInformationLive URA submissions

⚠️ Sandbox behavior may differ slightly from production (e.g., relaxed TIN validation), but payload validation rules, encryption requirements, and ReturnCode logic are identical.


3. Language-Specific Requirements

PHP

  • PHP 8.1+
  • Extensions:
    • curl
    • json
    • openssl (for RSA/AES encryption)
    • mbstring (for UTF-8 handling)
  • Composer (Packagist)
php -v
composer -V

4. System & Network Requirements

  • Outbound HTTPS access to:
    • https://efristest.ura.go.ug/efrisws/ws/taapp/getInformation
    • https://efrisws.ura.go.ug/ws/taapp/getInformation
  • TLS 1.2 or higher
  • Valid system clock (time drift >10 minutes causes ReturnCode: 28)
  • Ability to read .pfx certificate files with provided password

⏱️ Time synchronization is critical. Request timestamps (requestTime) must be within ±10 minutes of URA server time. Use T101: Get Server Time to sync clocks before initialization.


5. Payload & Date Rules (Critical)

JSON Envelope Structure

All requests/responses follow this outer-layer format:

{
"data": {
"content": "BASE64-encoded (encrypted) payload",
"signature": "JKQWJK34K32JJEK2JQWJ5678",
"dataDescription": {
"codeType": "1",
"encryptCode": "1",
"zipCode": "0"
}
},
"globalInfo": {
"appId": "AP04",
"version": "1.1.20191201",
"dataExchangeId": "9230489223014123",
"interfaceCode": "T109",
"requestCode": "TP",
"requestTime": "2026-02-25 14:30:22",
"responseCode": "TA",
"userName": "admin",
"deviceMAC": "FFFFFFFFFFFF",
"deviceNo": "TCS9e0df01728335239",
"tin": "1000029771",
"brn": "",
"taxpayerID": "1",
"longitude": "32.5825",
"latitude": "0.3476",
"agentType": "0"
},
"returnStateInfo": {
"returnCode": "",
"returnMessage": ""
}
}

Date & Time Formats

ContextFormatExampleNotes
Request timestamps (requestTime, issuedDate)yyyy-MM-dd HH:mm:ss2026-02-25 14:30:22Must be Uganda time
Response timestamps (currentTime, issuedDate in responses)dd/MM/yyyy HH:mm:ss25/02/2026 14:30:22Follows extendField.responseTimeFormat
Stock dates (stockInDate, productionDate)yyyy-MM-dd2026-02-25Date only

📅 Critical Rules:

  • issuedDate cannot be in the future
  • Back-dating invoices is only allowed if isAllowBackDate: "1" in T103 response
  • lastReqDt equivalent fields must not exceed URA retention policies

Invoice Numbering

  • Invoice numbers (invoiceNo) are assigned by URA upon successful upload (T109)
  • Your system must track the referenceNo (seller's transaction reference) for reconciliation
  • referenceNo must be unique per taxpayer and ≤50 characters
// ✅ Correct: Let URA assign invoiceNo
'basicInformation' => [
'invoiceNo' => '', // Leave empty in request
'referenceNo' => 'TXN_' . time() . '_' . uniqid()
]

// ❌ Rejected: Supplying your own invoiceNo
'basicInformation' => [
'invoiceNo' => 'INV-2026-001' // Will be ignored or cause error
]

6. Encryption & Signature Requirements

All S2S integrations must implement:

StepInterfacePurpose
1T102: Client InitializationObtain RSA key pair (clientPriKey, serverPubKey, keyTable)
2T103: Sign InAuthenticate and receive taxpayer/branch/device metadata
3T104: Get Symmetric KeyObtain AES key (passowrdDes) and signature value for subsequent requests
4All subsequent callsEncrypt content with AES, sign with RSA, BASE64-encode

🔐 Encryption Flow:

  1. Serialize inner payload to JSON
  2. Compress (if zipCode: "1")
  3. Encrypt with AES symmetric key
  4. BASE64-encode → data.content
  5. Sign the encrypted content with RSA private key → data.signature
  6. Wrap in outer JSON envelope with globalInfo

The SDKs handle this automatically—do not attempt manual encryption unless extending the SDK.


7. Validation Behavior

All SDKs perform local validation before sending requests to URA:

  • Required fields per interface code (T109, T110, etc.) are enforced
  • Data types, lengths, and enumerated values are validated
  • Business rules (e.g., discountFlag sequencing, excise duty consistency) are checked early
  • ReturnCode mappings are translated to human-readable errors

This reduces failed submissions and simplifies debugging.


8. Security Best Practices

  • Store credentials in environment variables or secure vaults—never in source code
  • Restrict file permissions on .pfx certificates and key cache files
  • Rotate PFX certificates and device credentials when staff or systems change
  • Log URA responses securely—mask content, signature, and credential fields
  • Monitor returnCode values and implement retry logic for transient errors (99, 46, 9901, 9902)

9. Compliance & Audit Considerations

  • Maintain local copies of all submitted invoices and URA acknowledgments
  • Reconcile referenceNo and invoiceNo mappings daily
  • Implement idempotency for invoice uploads to avoid duplicates
  • Handle T117: Invoice Checks for periodic reconciliation with URA records
  • Retain audit logs for ≥7 years per URA regulations