What’s new in V2 of the PawaPay API?
We have simplified the PawaPay API to make it easier to use. We’ve also added clarity to allow providers with different payment authorisation flows to be implemented in a future-proof manner. And we have restructured the payloads to consistently add features and capabilities to the API in the future. Let’s take a look one by one.Support for new payment authorisation flows
Some providers do not use the PIN prompt to authorise payments. They either require the customer to preauthorise the payment by generating an OTP or use a redirection based authorisation. Now both these mechanisms are supported in a way that allows you to implement once and all future providers with the same authorisation mechanism can be supported without a new implementation.Avoiding failures on initiation is now easier
We’ve added all the data you need to our active configuration endpoint to make sure payments do not fail on initiation. There is data there for handling decimals in amounts correctly, minimum and maximum transaction limits, provider availability information etc. Also the predict provider endpoint helps you not only predict the provider for a phone number, but also sanitises and validates the phone number to ensure it’s valid for the country and provider.The best customer experience
The active configuration endpoint also includes information about the specifics of how payments are authorised with the particluar provider. This allows you to show the exact steps the customer needs to take and how to recover from cases where they don’t enter the PIN prompt in time etc.Active configuration gets an overhaul
We beefed up the active configuration endpoint. It is more logically structured now and supports filtering to get information on the exact countries and flows you need in your payment flow. We’ve added a lot of static information like provider names and logos, currency names, country codes, flags and prefixes. This way you are able to build a dynamic payment flow that does not need any changes when new providers are enabled on your account.How to upgrade from V1?
Let’s first take a look at how to make everything work just as it was before. This is not a large undertaking.Change the baseUrl of the API
api.pawapay.cloud as the baseUrl for the API, now it’s time to change it to:api.sandbox.pawapay.iofor your sandbox accountapi.pawapay.iofor your live account
.cloud domain.Versioned paths
Financial requests
- Rename all instances of
correspondenttoprovider. - Move it inside the
accountDetailsobject. - Change the
typewithinpayerorrecipientfrom valueMSISDNtoMMO. - Change the
addresswithinpayerorrecipienttoaccountDetails. - Change the
valuewithinaddresstophoneNumber. - Remove the
customerTimestampfrom the request payload. This parameter has been removed. - Rename
statementDescriptiontocustomerMessage. - Change metadata from
"fieldName": "orderId"and"fieldValue": "ORD-123456789"format to"orderId": "ORD-123456789"format.
Required changes in responses
ENQUEUED any more on initiation.
The only statuses returned on initiation are:ACCEPTEDREJECTEDDUPLICATE_IGNORED
rejectionReason and error responses are now consolidated into failureReason.failureReason later in the guide.Next let’s look at callbacks and status checks.New response format for status checks
Payload changes for callbacks and status checks
rejectionReason, failureReason and error responses to a failureReason.
You can now always find out what happened from a single place which is the failureReason.You can find all the failureCodes in our docs. Make sure you have implemented handling for them.The requestedAmount and depositedAmount are now just a single amount, showing the amount that was requested to be deposited.
If the payment FAILED, no funds have been deposited.The respondedByPayer, receivedByRecipient and suspiciousActivityReport have been removed from all callbacks and status checks.The providerTransactionId replaces the correspondentIds object.
It will contain the ID of the transaction as specified by the provider (if available from the provider).Otherwise, all the changes in the request will be reflected in the callbacks and status checks as well, so make sure renamed or deprecated parameters are adjusted.Before:Callback resends, enqueued payout cancellation etc
Provider availability
correspondent has been renamed to provider everywhere in the API.Next let’s take a look at predict provider.Predicting the provider
- The
correspondenthas been renamed toprovider. - The
operatorhas been omitted in the response. - The
msisdnhas been renamed tophoneNumber.
Retrieving wallet balances
country to do that instead of a path parameter.Checking wallet balances before:mno has been renamed to provider as well.Now let’s look at active configuration.Getting your active configuration
merchantId has been removed from the response.The merchantName has been renamed to companyName.Of course the correspondents have been renamed to providers like in the rest of the API.Within the list of providers you can now find the list of currencies they support.
Currently, the only country with multicurrency support is DRC.In currencies you will now find a map of operationTypes which contain the minimum and maximum transaction limits.
The minTransactionLimit and maxTransactionLimit have been renamed to minAmount and maxAmount respectively.The ownerName has been renamed to nameDisplayedToCustomer.Getting your active configuration before:When using the payment page
msisdn has been renamed to phoneNumber.The statementDescription has been renamed to customerMessage.The amount is now contained in the amountDetails object together with the currency.Before in V1:failureReason like the rest of the API.When checking for the final status of the payment, the changes listed earlier in the guide must be implemented to ensure everything works.And done!
How to get the best out of V2?
We’ve added some capabilities that allow for a more dynamic, lower maintenance integration. We’ve also enabled a better customer experience for your customers. All API first as we do, so you can build exactly what you want.Support for different payment authorisation flows
- preauthentication
- redirection You can implement each of those once and know that new providers with the same authorisation flows will work as well.
Provider specific instructions for authorisation
Making sure payment data is accurate and valid
Easier support for showing provider availability
Making it easy to expand
What next?