Hosted Checkout (Web Redirection)
The simplest way to accept payments on your website. Redirect users to a secure CashPay-hosted page to complete their transaction.
Workflow Overview
- Your server calls the Checkout API to create a session.
- The API returns a
redirectUrlunique to this transaction. - You redirect your customer to this URL.
- The customer chooses their payment method (Card, Wallet, or Mobile Money) on our secure site.
- Once paid, the customer is redirected back to your
successUrl.
POST
/api/v1/b2b/payments/checkoutCreates a secure payment session and returns a redirection URL.
Request Payload
JSON
{
"amount": 150.00,
"currency": "USD",
"reference": "ORDER-9988",
"description": "Payment for Electronics",
"customer": {
"name": "Jane Doe",
"email": "jane@example.com"
},
"redirectUrl": "https://myshop.com/payment/callback",
"paymentMethods": "Card,MobileMoney,Wallet"
}Success Response
JSON
{
"success": true,
"sessionId": "cs_live_abc123...",
"redirectUrl": "https://checkout.cashpay-all.com/pay/abc123xyz"
}Why use Hosted Checkout?
It handles PCI-DSS compliance for you, as sensitive card data never touches your server. It also provides the widest range of local payment methods automatically.