Skip to main content
You’ll create a payment, charge it by bank transfer, and confirm it was paid. Everything runs against sandbox, so no real money moves. Pick your language in any code block; each step builds on the helper from step 1.

Before you start

  • A Kwugwo account with a sandbox workspace.
  • At least one PSP connected in sandbox (in its test mode), with a checkout that offers Bank transfer. See Testing in sandbox.
  • Your sandbox secret key from Dashboard → API Keys.
Your secret key goes on your server only. Never ship it to a browser or mobile app.
1

Set your key and make a first call

Put your key and the sandbox base URL in environment variables:
Then add a small helper that sends authenticated JSON requests, and use it to list your checkouts:
You should see your checkouts. A 401 means the key is wrong, or is a live key used against sandbox.
2

Create a payment

Charge ₦5,000.00. Amounts are in the smallest currency unit (kobo), so that’s 500000. ref is your order ID; it’s unique per workspace, so a retry can’t create a duplicate payment.
Response (trimmed)
Save the uid with your order. If checkout is null, add "checkout": "chk.…" (from step 1) to the request.
Using the embedded checkout? Stop here: hand this uid to checkout.open({ ugwoUid }) in the browser and skip to step 4.
3

Charge it by bank transfer

Start a payment attempt (an activity). Bank transfer needs no extra parameters; other mediums take theirs in data.medium_params.
Response (trimmed)
In production you’d show the customer these account details. In sandbox, complete the transfer with your PSP’s test tools; see Testing in sandbox.
4

Confirm the payment

Kwugwo sends ugwo.successful to your webhook endpoint once the PSP confirms. Either way, confirm from your server by fetching the ugwo:
When status is ugwo_successful, total_amount_paid covers amount, and ref is your order, the order is paid. Validate and fulfil turns this into a webhook handler.

What you built

Next steps

Embed the checkout

Let Kwugwo render every medium, bank picker and instruction.

Build your own UI

Handle every next_action type yourself.

Validate and fulfil

The checks to run before you ship an order.

Webhooks

Receive and verify events.