Skip to main content
Danipa
Docs · 008 / 010

Get started

Create your first API key and make a sandbox call to Danipa Pay in under five minutes.

This guide takes you from zero to a working sandbox API call in about five minutes. By the end you will have a sandbox account, an API key, and a successful response from a real Danipa Pay endpoint.

What you need

  • A Danipa Pay developer account (free).
  • A terminal with curl, or a Node / Python runtime.
  • Two minutes for the sandbox account to provision.

1. Create your account

Go to developer.sandbox.danipa.com and sign up. The sandbox account is fully isolated from production — nothing you do here moves real money.

Once you sign in, the dashboard shows your test merchant, an empty key list, and an empty webhook list.

2. Create your first API key

    1. Open the Keys tab in the left nav.
    2. Click Create new key.
    3. Name the key (e.g. local-dev) and pick the scopes you need — for this quickstart, leave the defaults (read + write).
    4. Copy the key starting with dk_test_…. You can only view it once — store it in a password manager or environment variable immediately.

3. Make your first request

Set your key as an env var:

export DANIPA_API_KEY=dk_test_replace_with_your_key

Then call the wallet-balance endpoint — a safe read-only check that confirms your key works.

cURL

curl https://api.sandbox.danipa.com/ms/v1/wallets/me/balances \
  -H "Authorization: Bearer $DANIPA_API_KEY"

Node.js

import axios from 'axios';

const { data } = await axios.get(
  'https://api.sandbox.danipa.com/ms/v1/wallets/me/balances',
  { headers: { Authorization: 'Bearer ' + process.env.DANIPA_API_KEY } },
);

console.log(data);

Python

import os, requests

resp = requests.get(
    'https://api.sandbox.danipa.com/ms/v1/wallets/me/balances',
    headers={'Authorization': f"Bearer {os.environ['DANIPA_API_KEY']}"},
)
resp.raise_for_status()
print(resp.json())

A successful response looks like:

{
  "wallet": {
    "id": "wlt_01HG...",
    "currency": "USD",
    "available": "0.00",
    "pending": "0.00"
  }
}

4. Move money in the sandbox

The sandbox seeds your wallet with test balances. Try a transfer to a synthetic recipient using an idempotency key — the same key replayed within 24h returns the original response without creating a duplicate transfer.

cURL

curl https://api.sandbox.danipa.com/ms/v1/transfers \
  -H "Authorization: Bearer $DANIPA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "10.00",
    "currency": "USD",
    "recipient": "test_recipient_ghana"
  }'

Node.js

import axios from 'axios';
import { randomUUID } from 'node:crypto';

const { data } = await axios.post(
  'https://api.sandbox.danipa.com/ms/v1/transfers',
  {
    amount: '10.00',
    currency: 'USD',
    recipient: 'test_recipient_ghana',
  },
  {
    headers: {
      Authorization: 'Bearer ' + process.env.DANIPA_API_KEY,
      'Idempotency-Key': randomUUID(),
    },
  },
);
console.log(data);

Python

import os, uuid, requests

resp = requests.post(
    'https://api.sandbox.danipa.com/ms/v1/transfers',
    json={
        'amount': '10.00',
        'currency': 'USD',
        'recipient': 'test_recipient_ghana',
    },
    headers={
        'Authorization': f"Bearer {os.environ['DANIPA_API_KEY']}",
        'Idempotency-Key': str(uuid.uuid4()),
    },
)
resp.raise_for_status()
print(resp.json())

In sandbox mode, mobile-money payouts auto-settle after about five seconds.

5. Set up webhooks

Configure your webhook endpoint in the developer dashboard under Settings → Webhooks. See the Webhooks guide for details on event types and signature verification.

What's next

For all integrations:

  • Authentication — how API keys work, scopes, rotating, and the difference between live and test keys.
  • Errors & limits — the standard error envelope and how to handle 4xx / 5xx and rate-limited responses.
  • SDKs — official Node.js, PHP, Python, and Java libraries.

For merchants accepting payments: