Initiate the payout
payoutId
to uniquely identify this payout.
This is so that you always have a reference to the payout you are initiating, even if you do not receive a response from us due to network errors.
This allows you to always reconcile all payments between your system and pawaPay.
You should store this payoutId in your system before initiating the payout with pawaPay.The amount
and currency
should be relatively self-explanatory.
This is the amount
that will be disbursed to the customer.
Any fees will be deducted from your pawaPay wallet balance on successful completion of the payout.
Principal amount (the amount specified in amount
) will be reserved from your pawaPay wallet.
If the payout fails, the funds will be returned to your pawaPay wallet immediately.Then the provider
and phoneNumber
specify who is paying exactly.
Mobile money wallets are identified by the phone number, like bank accounts are by their IBAN.
The provider
specifies which mobile money operator this wallet is registered at. For example MTN Ghana or MPesa Kenya.You will receive a response for the initiation.status
shows whether this payout was ACCEPTED
for processing or not.
We will go through failure modes later in the guide.The payout will be processed
Get the final status of the payment
status
which is COMPLETED
indicating that the payout has been processed successfully.And done!
Asking for the phone number
prefix
within the country object.
This is the country calling code for that country.
We recommend showing that in front of the input box for entering the phone number.
This makes it clear that the number entered should not include the country code.We have also added flag
to the country object to make it look a little nicer.The providers that have been configured on your pawaPay account for payouts are in the providers
property.
It includes both the provider
code to use in calls to initiate a payout and the displayName
for it.
To enable new providers being automatically added to your payout flows, we’ve also added the logo of the provider as the logo
.
This way it is possible to implement the payout flow dynamically, so that when new providers are enabled on your pawaPay account, they become available for your customers without additional effort.Validating the phone number
prefix
to what was entered as the phone number.You can now send it to validation. We will handle basic things like whitespace, characters etc.
We also make sure the number of digits is correct for the country and handle leading zeros.phoneNumber
is the sanitized MSISDN format of the phone number that you can use to initiate the payout.
We strongly recommend using this endpoint for validating numbers especially due to some countries not strictly following ITU E.164.Also, in the response, you will find the provider
. This is the predicted provider for this phoneNumber
.
We recommend preselecting the predicted provider for the customer.
In most countries we see very high accuracy for predictions removing another step from the payment experience.We recommend making it possible to override the prediction as the accuracy is not 100%.Initiate the payout
Done again!
Decimals support
NONE
and TWO_PLACES
.
It’s easy to provide dynamic validation now that is appropriate for the provider.
If the amount is determined by your system, you can apply rounding rules based on the above.If you are preparing the payout amounts beforehand and do not need to do it dynamically, this information is also documented in the providers section.Transaction limits
minAmount
and maxAmount
.And done!
Checking if the provider is operational
OPERATIONAL
- the provider is available and processing payouts normally.DELAYED
- the provider is having downtime and all payout requests are being enqueued in pawaPay.CLOSED
- the provider is having downtime and pawaPay is rejecting all payout requests.DELAYED
) or is not possible at the moment and they can try again later (CLOSED
).If your payouts are not initiated by customers, you can validate the status of the provider and delay initiating payouts while the provider is unavailable (CLOSED
).Handling delayed processing
DELAYED
will be ACCEPTED
on initiation.
They will then be moved to the ENQUEUED
status.
Our 24/7 payment operations team will be monitoring the provider for when their payout service becomes operational again.
When that happens, the payouts will get processed as usual.To find out whether a payout is enqueued, you can check payout status.ENQUEUED
status.
If the payout is already in PROCESSING
status, the request will be rejected.You will receive a callback with a FAILED
status when cancellation has been completed.Handling HTTP 500 with failureCode UNKNOWN_ERROR
UNKNOWN_ERROR
failureCode indicates that something unexpected has gone wrong when processing the payment.
There is no status
in the response in this case.It is not safe to assume the initiation has failed for this payout.
You should verify the status of the payout using the check payout status endpoint.
Only if the payout is NOT_FOUND
should it be considered FAILED
.We will take a look later in the guide, how to ensure consistency of payment statuses between your system and pawaPay.And done!
Handling failures during processing
status
of the payout is FAILED
you can find further information about the failure from failureReason
.
It includes the failureCode
and the failureMessage
indicating what has gone wrong.failureMessage
from pawaPay API is meant for you and your support and operations teams.
You are free to decide what message to show to the customer.UNSPECIFIED_FAILURE
code indicates that the provider indicated a failure with the payment, but did not provide any more specifics on the reason of the failure.In case there is a general failure, the UNKNOWN_ERROR
failureCode would be returned.And done!
Defensive status handling
Handling network errors and system crashes
payoutId
for each payment is to ensure that you can always ask us what is the status of a payment, even if you never get a response from us.You should always store this payoutId
in your system before initiating a payout.ACCEPTED
by pawaPay.Implementing an automated reconciliation cycle
IN_RECONCILIATION
.
This means that there was a problem determining the correct final status of a payment.
When using pawaPay all payments are reconciled by default and automatically - we validate all final statuses to ensure there are no discrepancies.
When encountering payments that are IN_RECONCILIATION
you do not need to take any action.
The payment has already been sent to our automatic reconciliation engine and it’s final status will be determined soon.
The reconciliation time varies by provider. Payments that turn out to be successful are reconciled faster.