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

  1. Your server calls the Checkout API to create a session.
  2. The API returns a redirectUrl unique to this transaction.
  3. You redirect your customer to this URL.
  4. The customer chooses their payment method (Card, Wallet, or Mobile Money) on our secure site.
  5. Once paid, the customer is redirected back to your successUrl.
POST/api/v1/b2b/payments/checkout

Creates 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"
}