Skip to main content
This guide will walk you through setting up test payments using our standard REST endpoints.

Step 1: Get your API Keys

Register or log into your Senda Merchant Dashboard and copy your publishable and secret keys under the developers section:
  • Publishable Key (pk_test_...): Used in client-side checkout engines like senda-js.
  • Secret Key (sk_test_...): Keep this secure. Use this in your server-side API integrations.

Step 2: Create a Payment Intent

From your backend, make a secure POST request to create a PaymentIntent. This registers an in-flight payment attempt.
curl -X POST https://api.sendapay.io/v1/payment_intents \
  -H "Authorization: Bearer sk_test_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100.00,
    "currency": "ZMW",
    "payment_method_types": ["mobile_money"],
    "description": "Invoice #1042"
  }'
The API will return a PaymentIntent object containing a unique id and a client_secret.

Step 3: Trigger the USSD Push (Confirm)

Use the client secret to confirm the intent. This triggers a native network USSD prompt on the customer’s phone requesting their wallet PIN.
curl -X POST https://api.sendapay.io/v1/payment_intents/pi_123/confirm \
  -H "Authorization: Bearer sk_test_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_method": {
      "type": "mobile_money",
      "mobile_money": {
        "phone": "+260971234567",
        "provider": "mtn"
      }
    }
  }'
Your customer will see a prompt on their device instantly. Once they enter their PIN, Senda’s double-entry ledger secures the funds and dispatches a signed webhook callback to your server.