Skip to main content
This quickstart takes you from a test key to a verified payment without moving real money. Every call runs in test mode.

Before you start

  • A Spotflow account. Sign up if you don’t have one.
  • You don’t need KYB verification to use test mode. You’ll need it before you can go live. See KYB verification.
1

Get your test secret key

In the Spotflow dashboard, switch to test mode and open Settings → API Keys. Copy your secret key. It starts with sk_test_.Store it as an environment variable, never in code:
Your secret key grants full access to your account. Keep it on your server and never put it in frontend code. Client-side integrations use your public key (pk_test_…). See Authentication.
2

Start a payment

Call Initialize Payment with a unique reference, the amount, the currency and the customer’s email. The request and response are shown alongside this page, in cURL, Node.js and Python.
  • amount is in the major unit of the currency: 5.00 with GHS means five Ghana cedis.
  • reference is yours. Keep it unique per payment. It’s also your idempotency key, so a retry with the same reference won’t create a second payment.
The response includes a checkoutUrl and a status of pending.
3

Pay at checkout

Open the checkoutUrl in your browser and pay with one of the test cards or test mobile money numbers on Testing payments. Test details only work with test keys.
4

Verify the payment

Check the result with Verify Payment, using your reference:
A payment moves from PENDING to SUCCESSFUL, FAILED or CANCELLED. See Payment lifecycle.
Don’t poll more than once every 5 seconds. In production, use webhooks to learn when a payment completes, then verify it before you fulfil the order.

Troubleshooting

Next steps

Receive webhooks

Get notified when payments, subscriptions and accounts change.

Try the API in your browser

Every endpoint page has an interactive playground for test requests.

Bill a customer every month

Set up a subscription plan and recurring billing.

Go live

Complete KYB verification, then switch to your live key.