Where is the API?
When creating an account with pawaPay, you will first receive access to our sandbox environment. The sandbox environment is completely isolated from our production environment. You can safely test your integration with pawaPay without real mobile money wallets and real money involved. Access to your production account will be granted after completing the onboarding on your sandbox account. The base URL for the pawaPay Merchant API is different between our sandbox and production environments. The specific operation can be called by appending the endpoint to the base URL. Example: https://api.sandbox.pawapay.io/payoutsEnvironment | Base URL |
---|---|
Sandbox | https://api.sandbox.pawapay.io/ |
Production | https://api.pawapay.io/ |
Authentication
The pawaPay Merchant API uses a bearer token for authentication. An authorization header is required for all calls to the pawaPay Merchant APIs except for MMO Availability. The token can be generated from the pawaPay Dashboard. Instructions on how to do that can be found in the pawaPay Dashboard Docs. The token generated from your sandbox account can only be used for authenticating against the Merchant API in sandbox. For authenticating against the Merchant API in production, a separate token must be generated with your live account. As our sandbox environment is completely isolated from our production environment, the URLs for each dashboard are also different.Environment | Dashboard URL |
---|---|
Sandbox | https://dashboard.sandbox.pawapay.io/ |
Production | https://dashboard.pawapay.io/ |
Signatures
The pawaPay API is secured by the API token as explained in Authentication. To add a second layer of security, you can optionally sign your financial requests to us - deposit, payout and refund requests. In this case, pawaPay will only accept financial requests that have been signed by you. To utilize this additional capability, you should provide your public key in the pawaPay Dashboard and enable this feature. Read how to do that from the pawaPay Dashboard Docs. This ensures that even if your API token leaks, only you can initiate financial requests with pawaPay. If configured, pawaPay will also send callbacks to your callback URLs with the final status of your payment. Your network team can whitelist the pawaPay platform IP addresses for these callback URLs. Additionally, you can also enable pawaPay to sign those callbacks. You can then validate the signature that is included in the header of the callback to ensure that callbacks are in fact coming from pawaPay and have not been tampered with.Signatures in financial requests
Financial requests are requests sent to the pawaPay Merchant API to move funds. These include deposits, payouts, bulk payouts and refunds. The implementation of signatures in pawaPay is based on the standard described in RFC-9421. When creating the financial request to send to the pawaPay Merchant API, you should create a Content-Digest, sign the request and add Signature and Signature-Input headers. You can find sample node code for signing your requests from Github.Hash the request body
For generating theContent-Digest
you can use either SHA-256 or SHA-512 algorithm.
The Content-Digest
should be created from the request body.
Having the request body hashed and available as a header allows verification that the content of the request has not been tampered with.
Create the signature base
For creating the content that will be signed, you need to create a signature base. This should include all details of the request that should be verifiable. We recommend including at least the following Derived Components.- @method
- @authority
- @path
- Signature-Date
- Content-Digest
- Content-Type
Create the signature
You can use your private key now to sign the signature base. You can use one of the following algorithms:- RSASSA-PSS Using SHA-512
- RSASSA-PKCS1-v1_5 Using SHA-256
- ECDSA Using Curve P-256 DSS and SHA-256
- ECDSA Using Curve P-384 DSS and SHA-384
Include Signature and Signature-Input headers
Having generated the signature, you should include it into theSignature
header of the request.
You also need to create the Signature-Input
header which outlines the parameters and their order that were used to generate the Signature
as well as metadata about the signature.
The metadata should include.
- The used algorithm (
alg
) - The date the signature was created (
created
) - The expiration date of the keypair (
expires
) - The id of the key (
keyid
)
Do not forget to enable signed financial calls and upload your public key in the pawaPay Dashboard. Learn how to do that from the pawaPay Dashboard Docs.
Make the request
You can now send this request to pawaPay Merchant API to initiate a deposit, payout, bulk payout and refund.Signatures in callbacks
When receiving callbacks from pawaPay they will include the following headers.- Signature
- Signature-Input
- Signature-Date
- Content-Type
- Content-Digest
Validate content integrity
Create a hash of the request body using the algorithm specified in theContent-Digest
header.
Comparing the generated value to the value in Content-Digest
ensures the body of the request has not been tampered with.
Validate the signature
Based on the parameters inSignature-Input
, generate the signature base for the request. You can read more about it here.
Based on the previous example, the signature base would be the following.
Signature-Input
) was in fact signed by pawaPay and therefore originates from pawaPay.
Do not forget to enable signed callbacks in the pawaPay Dashboard. Learn how to do that from the pawaPay Dashboard Docs.
Callback URLs
The pawaPay Merchant API is asynchronous. You can read more from Asynchronous API. Callback URLs are configured from the pawaPay Dashboard. You can find instructions on how to do that from the pawaPay Dashboard Docs. When using callbacks, please ensure the following IP addresses are whitelisted to ensure we can reliably deliver callbacks to you.Environment | IP |
---|---|
Sandbox | 3.64.89.224/32 |
Production | 18.192.208.15/32 |
Production | 18.195.113.136/32 |
Production | 3.72.212.107/32 |
Production | 54.73.125.42/32 |
Production | 54.155.38.214/32 |
Production | 54.73.130.113/32 |
Correspondents
Correspondents in our Merchant API refer to the specific Mobile Money Operators (MMOs) that are available through our platform. The parameters that define the destination of the payment arecorrespondent
and payer
for Deposits or recipient
for Payouts.
This routes the payment to the correct person (specified by the MSISDN) on the correct mobile network (specified by the correspondent
).
You can always check which correspondents are available on your account from the active configuration endpoint.
You can use the predict-correspondent endpoint to predict the MMO for a phone number (MSISDN).
The amount of decimal places that can be specified as the amount
of the transaction vary between different MMOs.
You can find the list of all available correspondents, their currency and supported decimal places below.
Benin
Benin
MMO | Correspondent | Country | Currency | |
---|---|---|---|---|
MTN | MTN_MOMO_BEN | BEN | XOF | Not supported |
Moov | MOOV_BEN | BEN | XOF | Not supported |
Burkina Faso
Burkina Faso
MMO | Correspondent | Country | Currency | |
---|---|---|---|---|
Moov | MOOV_BFA | BFA | XOF | Not supported |
Orange | ORANGE_BFA | BFA | XOF | Not supported |
Cameroon
Cameroon
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
MTN | MTN_MOMO_CMR | CMR | XAF | Not supported |
Orange | ORANGE_CMR | CMR | XAF | Not supported |
Côte d'Ivoire (Ivory Coast)
Côte d'Ivoire (Ivory Coast)
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
MTN | MTN_MOMO_CIV | CIV | XOF | Not supported |
Orange | ORANGE_CIV | CIV | XOF | Not supported |
Democratic Republic of the Congo (DRC)
Democratic Republic of the Congo (DRC)
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Vodacom | VODACOM_MPESA_COD | COD | CDF | Not supported |
USD | 2 places | |||
Airtel | AIRTEL_COD | COD | CDF | 2 places |
USD | 2 places | |||
Orange | ORANGE_COD | COD | CDF | 2 places |
USD | 2 places |
Gabon
Gabon
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_GAB | GAB | XAF | 2 places |
Ghana
Ghana
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
MTN | MTN_MOMO_GHA | GHA | GHS | 2 places |
AT | AIRTELTIGO_GHA | GHA | GHS | 2 places |
Vodafone | VODAFONE_GHA | GHA | GHS | 2 places |
Kenya
Kenya
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
MPesa | MPESA_KEN | KEN | KES | Deposits: not supported; payouts: 2 places |
Malawi
Malawi
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_MWI | MWI | MWK | 2 places |
TNM | TNM_MWI | MWI | MWK | 2 places |
Mozambique
Mozambique
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Vodacom | VODACOM_MOZ | MOZ | MZN | 2 places |
Nigeria
Nigeria
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_NGA | NGA | NGN | Not supported |
MTN | MTN_MOMO_NGA | NGA | NGN | 2 places |
Republic of the Congo
Republic of the Congo
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
AIRTEL | AIRTEL_COG | COG | XAF | Not supported |
MTN | MTN_MOMO_COG | COG | XAF | Not supported |
Rwanda
Rwanda
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_RWA | RWA | RWF | Not supported |
MTN | MTN_MOMO_RWA | RWA | RWF | Not supported |
Senegal
Senegal
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Free | FREE_SEN | SEN | XOF | Not supported |
Orange | ORANGE_SEN | SEN | XOF | Not supported |
Sierra Leone
Sierra Leone
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Orange | ORANGE_SLE | SLE | SLE | 2 places |
Tanzania
Tanzania
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_TZA | TZA | TZS | 2 places |
Vodacom | VODACOM_TZA | TZA | TZS | Not supported |
Tigo | TIGO_TZA | TZA | TZS | Not supported |
Halotel | HALOTEL_TZA | TZA | TZS | Not supported |
Uganda
Uganda
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_OAPI_UGA | UGA | UGX | Not supported |
MTN | MTN_MOMO_UGA | UGA | UGX | 2 places |
Zambia
Zambia
MMO | Correspondent | Country | Currency | Decimals in amount |
---|---|---|---|---|
Airtel | AIRTEL_OAPI_ZMB | ZMB | ZMW | 2 places |
MTN | MTN_MOMO_ZMB | ZMB | ZMW | 2 places |
Zamtel | ZAMTEL_ZMB | ZMB | ZMW | 2 places |