Overview
Once you have generated your signature, either locally via the SHA-256 algorithm or using the Niobi Signature Generation API, the final step is formatting and dispatching the HTTP request. Every Niobi API request follows a standardized envelope structure that bundles your authentication metadata with your specific payment parameters.Pre-requisite: IP Whitelisting
Before sending any API requests to Niobi servers or endpoints (in Sandbox or Production), your server’s outgoing public IP address must be whitelisted in the Niobi Dashboard under Workspace -> IP Whitelisting. Requests sent from non-whitelisted IPs will be blocked. See our IP Whitelisting Guide for setup steps.
Before sending any API requests to Niobi servers or endpoints (in Sandbox or Production), your server’s outgoing public IP address must be whitelisted in the Niobi Dashboard under Workspace -> IP Whitelisting. Requests sent from non-whitelisted IPs will be blocked. See our IP Whitelisting Guide for setup steps.
Request Envelope Structure
Every signed request to Niobi contains two tiers:- Root-Level Authentication Metadata: Identifies your integration, timestamp, salt, and cryptographic signature.
- Nested
paramsObject: Contains whatever specific parameters are required by the destination endpoint you are invoking.
Root Fields Specification
The
The outer fields (
params Object is Dynamic:The outer fields (
client_id, sender, timestamp, salt, signature) never change between endpoints. But the contents of "params": { ... } change to match the schema of the endpoint you are calling.Complete Request Examples Across Endpoints
- Collections / Deposits
- Payouts / Disbursements
Sub-Merchant Parameter Placement
If you are operating multiple distinct brands or merchants under one master account:- Pass the approved sub-merchant UUID in
params.sub_merchant_id. - The
sub_merchant_idfield must be included in the pre-signature object when generating the signature (either in code or via the Niobi Signature Generation API) so that the hash remains valid. - For more information on creating and managing sub-merchants, see Sub-Merchant Management.
Common Pitfalls & How to Avoid Them
1. Leaving senderKey in the request body
1. Leaving senderKey in the request body
Error: Security hazard and potential rejection.
Fix: The
Fix: The
senderKey is strictly used on your server to compute the SHA-256 hash. Always delete senderKey before sending the payload over the wire.2. Modifying params after computing the signature (403 Error)
2. Modifying params after computing the signature (403 Error)
Error:
Fix: If any field in
403 - Request was not verified.Fix: If any field in
params or the root envelope changes (e.g. updating an amount or reference), the signature must be recomputed.3. URL-encoding the callback URL before hashing
3. URL-encoding the callback URL before hashing
Error: Signature mismatch on the server.
Fix: When stringifying the pre-signature object, ensure
Fix: When stringifying the pre-signature object, ensure
callback_url remains unencoded (e.g. https://yourdomain.com/callback rather than https%3A%2F%2F...).4. Type mismatch between signing and dispatching
4. Type mismatch between signing and dispatching
Error: Signature mismatch.
Fix: Ensure parameter types remain consistent (e.g. if
Fix: Ensure parameter types remain consistent (e.g. if
amount is a number 10000, do not send "10000" as a string).5. Sending requests from an unwhitelisted IP address
5. Sending requests from an unwhitelisted IP address
Error: Request blocked or connection refused.
Fix: Ensure your server’s outgoing public IP address is whitelisted in your Niobi Dashboard under Workspace -> IP Whitelisting. See our IP Whitelisting Guide.
Fix: Ensure your server’s outgoing public IP address is whitelisted in your Niobi Dashboard under Workspace -> IP Whitelisting. See our IP Whitelisting Guide.
6. Unintentional leading or trailing whitespace
6. Unintentional leading or trailing whitespace
Error:
Fix: Trailing or leading whitespace can occur on your credentials (
403 - Request was not verified.Fix: Trailing or leading whitespace can occur on your credentials (
client_id, sender, senderKey) when copied from the dashboard, as well as on string parameter values inside params (e.g. callback_url, mobile, email, payment_reference). Always trim string values across all fields before computing the hash to prevent signature mismatches.
