Skip to main content
POST
/
v2
/
paymentpage
Deposit via Payment Page
curl --request POST \
  --url https://api.sandbox.pawapay.io/v2/paymentpage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "depositId": "f4401bd2-1568-4140-bf2d-eb77d2b2b639",
  "returnUrl": "https://merchant.com/paymentProcessed",
  "customerMessage": "Note of 4 to 22 chars",
  "amountDetails": {
    "amount": "15",
    "currency": "ZMW"
  },
  "phoneNumber": "260763456789",
  "language": "EN",
  "country": "ZMB",
  "reason": "Ticket to festival",
  "metadata": [
    {
      "orderId": "ORD-123456789"
    },
    {
      "customerId": "customer@email.com",
      "isPII": true
    }
  ]
}'
{
"depositId": "f4401bd2-1568-4140-bf2d-eb77d2b2b639",
"status": "REJECTED",
"failureReason": {
"failureCode": "PROVIDER_TEMPORARILY_UNAVAILABLE",
"failureMessage": "The provider 'MTN_MOMO_ZMB' is currently not able to process payments. Please consult our status page for downtime information on all providers. Programmatic access is also available, please consult our API docs."
}
}
Initiates a deposit using the pawaPay Payment Page.

Check the guide!

Follow the step-by-step guide on how to build a payment flow using the payment page.
  • The request will return a redirectURL.
  • The customer should be forwarded to this URL to start the payment process.
  • Once the customer completes the payment process on the Payment Page, they will be forwarded to the returnUrl.
  • The original depositId will be passed as a query parameter.
Your page on the returnUrl has two options to determine the status of the payment. You can do that by either: The customer experience of the Payment Page can be changed through the following parameters during initiation.
ParameterBehaviour if specifiedBehaviour if not specified
amountDetailsThe specified amount will be used for the payment. Customer is not able to change it.The customer is able to enter the amount they wish to pay. For example, when depositing into their eWallet.
phoneNumberThe payment will be initiated from the specified mobile money wallet. Customer is not able to change it.The customer can specify the phone number of the mobile money wallet they wish to pay from.
countryThe customer can pay only using a mobile money wallet from the specified country.The customer can pay with a mobile money wallet from any country that is configured on your pawaPay account.
reasonThe reason will be shown to the customer on the Payment PageThe customer will not be shown what they are paying for.

Authorizations

Authorization
string
header
required

Body

application/json
depositId
string<uuid>
required

A UUIDv4 based unique ID for this payment. We require you to provide the unique ID for all initiated payments to ensure you can always reconcile all payments. Please store this ID in your system before initiating the payment with pawaPay.

Required string length: 36
Example:

"f4401bd2-1568-4140-bf2d-eb77d2b2b639"

returnUrl
string<uri>
required

The URL the customer should be redirected to after the payment is processed.

Example:

"https://merchant.com/paymentProcessed"

customerMessage
string

A short narration for the transaction. Depending on the 'provider', this message may be visible to the customer in the SMS receipt or within their transaction history.

Defaults to your company name as registered on your pawaPay account trimmed to fit the length limitations.

Required string length: 4 - 22
Example:

"Note of 4 to 22 chars"

amountDetails
object
phoneNumber
string

The phone number (MSISDN) of the customer paying or receiving payment. The format is described in Wikipedia.

Use predict provider to validate and sanitise the phone number.

Phone number validation has following rules:

  • Only digits without whitespaces or any other separators or prefixes like '+'.
  • Should not start with zero.
  • Country code is mandatory.
  • Should not exceed or be less than the valid length of specified country.
Example:

"260763456789"

language
enum<string>

The language in which the Payment Page will be presented to the customer. If the user has explicitly changed their languages preferences, their selection will override this parameter.

Available options:
EN,
FR
Example:

"EN"

country
string

If specifified, allows payment from phone numbers only from a specific country. If not specified, the customer can select any country that is configured for your account in pawaPay.

You can use the active configuration endpoint to verify which countries and providers have been configured for your account.

Format must be the ISO 3166-1 alpha-3, three character country code in upper case. Read more from Wikipedia.

Example:

"ZMB"

reason
string

An optional text which will be displayed to the customer on the payment page to specify what they are paying for.

Required string length: 1 - 50
Example:

"Ticket to festival"

metadata
object[]

A list of metadata that you can attach to the payment for providing additional context about the payment. For example, adding the channel from which the payment was initated, product ID or anything else that might help your operations team.

Metadata will be included in:

  • In the dashboard on payment details pages
  • Financial statements as JSON object
  • Callbacks

Metadata can be used when searching in the pawaPay Dashboard. Full value of the metadata field must be used for searches.

Metadata will not be visible to the customer that is involved in this payment.

Up to 10 metadata fields can be attached to a payment.

Example:
[
{ "orderId": "ORD-123456789" },
{
"customerId": "customer@email.com",
"isPII": true
}
]

Response

Payment Page session is created successfully

redirectUrl
string<uri>

The unique URL for this Payment Page. Customer has to be forwarded to this URL where they can complete the payment.

Please note! The URL is valid for 15 minutes.

Example:

"https://paywith.pawapay.io/?token=AgV4aA3ZxKfGcdMIo6a6Upf7X2MRptdFUrc6Oi3U53CxC0YAkAADABVhd3MtY3J5cHRvLXB1YmxpYy1rZXkAREFzdDR5WktOeWVTRTZ5bTdhVTJJeno3bG1ydkFYenFpUWZqNVQxbGQ2RUgweEpkZVZ0cWJGM3hwMzI1VWN6VGxEdz09AAdwdXJwb3NlAA5jcmVhdGUtc2Vzc2lvbgAFc3RhZ2UAD3NpZ24tY2xvdWRmcm9udAACAAdhd3Mta21zAE5hcm46YXdzOmttczpldS1jZW50cmFsLTE6MTAxOTQ0Mzc3ODY2OmtleS82ZTgzZmVjMS00MWRhLTQxMWQt"