Skip to content

Make Payment

POST

Creates and processes a transaction for a specific payment method in one call. This is the core request in the seamless flow — your UI collects the method’s required fields and submits them directly, without redirecting to a Pesepay-hosted page.

EnvironmentURL
Productionhttps://api.pesepay.com/api/payments-engine/v2/payments/make-payment
Sandboxhttps://api.test.sandbox.pesepay.com/payments-engine/v2/payments/make-payment
  1. Pick a payment method and its required fields.
  2. Build and encrypt the request body.
  3. POST it with your integration key in the authorization header.
  4. Decrypt the response, store the referenceNumber, and wait for the result callback or poll pollUrl — the customer still has to approve the payment on their side.
ParameterTypeRequiredDescription
authorizationstringYesYour application’s integration key
content-typestringYesMust be application/json
FieldTypeRequiredDescription
amountDetailsobjectYes{ amount: number, currencyCode: string }
paymentMethodCodestringYese.g. PZW211 for EcoCash, PZW212 for InnBucks — see Payment Method Codes
paymentMethodRequiredFieldsobjectYesThe chosen method’s required fields as key/value pairs. Send {} for methods that need none (InnBucks, PayGo). Keys come from the method’s Payment Methods page or from Get Payment Methods by Currency
reasonForPaymentstringYesA short summary of the transaction
resultUrlstringYesWhere Pesepay posts the final result — see The Result Callback
returnUrlstringNoWhere the customer is sent after the payment. Defaults to resultUrl if omitted
merchantReferencestringNoYour own order/invoice reference, echoed back on the transaction
customerobjectNo{ email, phoneNumber, name }
paymentMetadataobjectNoString key/value pairs carried on the transaction and returned as transactionMetadata on the result. Required on an application with split payments, which must carry beneficiaryMerchantEmail
Plaintext request body — EcoCash example (before encryption)
{
"amountDetails": {
"amount": 10.00,
"currencyCode": "USD"
},
"merchantReference": "ORDER-1042",
"reasonForPayment": "Order #1042 — running shoes",
"resultUrl": "https://example.com/payments/result",
"returnUrl": "https://example.com/payments/return",
"paymentMethodCode": "PZW211",
"customer": {
"email": "customer@example.com",
"phoneNumber": "0777777777",
"name": "Jane Customer"
},
"paymentMethodRequiredFields": {
"customerPhoneNumber": "0777777777"
}
}
Terminal window
# Encrypt your JSON body first (see the Encryption Guide), then:
curl -X POST https://api.test.sandbox.pesepay.com/payments-engine/v2/payments/make-payment \
-H "authorization: YOUR_INTEGRATION_KEY" \
-H "content-type: application/json" \
-d '{"payload": "ENCRYPTED_BASE64_STRING"}'

Decrypt the payload to get the transaction result. It is the same object you get from Check Payment Status and in the result callback — the result callback page has the complete field list and the amountDetails breakdown. There is no redirectUrl on it.

FieldTypeDescription
referenceNumberstringStore this — used to track status and match result callbacks
pollUrlstringA ready-made Check Payment Status URL for this transaction
transactionStatusstringSee Transaction statuses
transactionStatusCodenumberNumeric equivalent of transactionStatus
transactionStatusDescriptionstringHuman-readable description of the status
amountDetailsobjectAmounts and fees applied to the transaction
transactionMetadataobjectString key/value pairs carried on the transaction