Best practices for secure and reliable FIRS e-invoicing integration
x-api-key - Public identifierx-api-secret - Private secret/api/firs/** endpointsNever expose FIRS credentials to client-side code. Always use platform API keys for client applications and store FIRS credentials only on secure servers or through Felcy's proxy authentication.
# Rotate API secret
curl -X POST https://api.felcytech.com.ng/api/v1/auth/rotate-secret \
-H "x-api-key: your_current_api_key" \
-H "x-api-secret: your_current_api_secret" \
-H "Content-Type: application/json"
# Response includes new secret
{
"newSecret": "mbs_proxy_secret_new_xyz789",
"expiresAt": "2024-02-15T10:30:00Z"
}Always surface FIRS error payloads to help users understand validation failures:
{
"code": 400,
"error": {
"type": "firs_validation_error",
"message": "Invoice validation failed",
"details": [
{
"field": "accountingSupplierParty.tin",
"code": "INVALID_TIN_FORMAT",
"message": "TIN must be in format XXXXXXXX-XXXX"
}
],
"upstream": {
"firsCode": "VAL_001",
"firsMessage": "Supplier TIN validation failed"
}
}
}# Check rate limit headers curl -I https://api.felcytech.com.ng/api/v1/invoice/validate \ -H "x-api-key: your_api_key" \ -H "x-api-secret: your_api_secret" # Response headers: # X-RateLimit-Limit: 1000 # X-RateLimit-Remaining: 999 # X-RateLimit-Reset: 1642694400
Check reference number format and business association
POST /api/v1/invoice/reference/validateComprehensive business rules and structure validation
POST /api/v1/invoice/validateApply digital signature for authenticity
POST /api/v1/invoice/signSubmit to FIRS system for processing
POST /api/v1/exchange/transmitVerify successful processing by FIRS
GET /api/v1/invoice/confirm/{referenceNumber}Full sync on first login, incremental on subsequent logins
Every 15-30 minutes during business hours
User-triggered sync for immediate updates
Original:
john.doe@company.comMasked:
j***@c******.comsandbox.api.felcytech.com.ngapi.felcytech.com.ng# .env.development FELCY_API_URL=https://sandbox.api.felcytech.com.ng FELCY_API_KEY=sandbox_key_xxx FELCY_API_SECRET=sandbox_secret_xxx # .env.production FELCY_API_URL=https://api.felcytech.com.ng FELCY_API_KEY=prod_key_xxx FELCY_API_SECRET=prod_secret_xxx