Skip to content
ChainPesaDocsTest mode
Dashboard

Get started

Quickstart

From a new account to a completed test payment and a verified webhook.

1. Create your account

Sign up and set up two-factor sign-in. You get a test environment straight away.

2. Create a test key

In the dashboard, open API keys and create a key with the payments:read and payments:write scopes. Copy it when it is shown: only a fingerprint is stored, so it cannot be shown again.

Shell
export CHAINPESA_KEY=cp_test_your_key_here

3. Create a payment

curl -X POST https://dev.chainpesa.com/api/v1/payments \
  -H "Authorization: Bearer $CHAINPESA_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "250.00",
    "currency": "USDT",
    "network": "TRON",
    "reference": "order_1042"
  }'

The response has a checkout_url. That is the page your customer pays on.

4. Pay it, in test mode

Open the checkout_url and press Test mode: simulate this payment. The payment becomes completed and your balance goes up.

5. Hear about it

Add an endpoint under Webhooks in the dashboard. You will receive payment.completed. Verify the signature before you trust it.

Fulfil orders from the webhook, or by fetching the payment from your server. Never from the customer's browser returning to your site.