Skip to main content

Quickstart

Make your first authenticated Payscribe sandbox request in about 10 minutes. You will retrieve your wallet balances, verify the response, and choose a complete flow to build next.

By the endYour server can call the Payscribe sandbox with an API key and read a real API response.

Before you begin

You need a Payscribe account and a sandbox API key from Settings → API Keys in the dashboard. Sandbox requests use test data and do not move real money.

Keep the key server-side

Use a ps_pk_test_... key for sandbox development. Do not add it to browser JavaScript, a mobile app, a client-side bundle, screenshots, or source control.

1. Set a local environment variable

Use a name your application can read. These examples use PAYSCRIBE_API_KEY.

export PAYSCRIBE_API_KEY="ps_pk_test_your_api_key"

For a deployed application, set the variable in your hosting provider or server configuration—not in your codebase. See Authentication for secure key-handling guidance.

2. Retrieve your sandbox balances

Copy the example for your server environment. It calls the sandbox URL and passes the API key in the Authorization header.

curl https://sandbox.payscribe.ng/api/v1/my-account/balances \
-H "Authorization: Bearer $PAYSCRIBE_API_KEY"

3. Verify the result

You should receive 200 OK, "status": true, and a message.details array with one entry per wallet. Your wallet ID and balances will differ.

{
"status": true,
"description": "Account balance fetched successfully.",
"message": {
"details": [
{
"id": "wlt_abc123",
"currency": "NGN",
"available_balance": 2450000,
"collection": 2500000,
"ledger": 2450000
}
]
},
"status_code": 200
}
Success checkIf you can see a wallet currency and available_balance, your sandbox connection is working.

If the request fails

The API returns JSON errors with a status code and description. Treat the code as the recovery signal; do not display raw error payloads or credentials to your end users.

Example error response
{
"status": false,
"description": "Invalid API key",
"status_code": 401
}
What you seeCheck this firstNext action
401 or 403The key prefix and authorization headerUse a valid ps_pk_test_... key; keep it server-side.
404The base URL and endpoint pathUse https://sandbox.payscribe.ng/api/v1 and the documented route.
400 or 422Required fields and formatsCorrect the request; do not retry unchanged input.
Timeout or 5xx on a write requestYour request ref and transaction stateKeep the same ref, then reconcile before retrying.

Read Common errors, Errors, and Idempotency before implementing money-moving requests.

4. Build one complete flow

Your connection works. Now build a workflow that includes its API calls, expected state changes, and webhook confirmation.

Before production

Test webhooks, duplicate handling, validation failures, and production configuration before moving real funds. Continue with Sandbox testing, Webhooks, and the go-live checklist.

Was this page helpful?

Report a docs issue →