SDKs & Developer Tools
Choose the integration surface that fits your stack. All three options call the same Payscribe API; use one approach per service rather than mixing SDK and raw REST calls for the same operation.
Keep API keys in your server environment or a secret manager. Never place them in browser JavaScript, a mobile app, source control, screenshots, or a support ticket.
Select your path
| Use this | When it is the best fit | Start here |
|---|---|---|
| REST API | Your language is not Node.js or PHP, or you need direct control of HTTP requests. | Quickstart and API reference |
| Node SDK | You use Node.js or TypeScript for virtual accounts, cards, or bills. | Node.js SDK guide |
| PHP SDK | You use PHP for customers, virtual accounts, cards, or bills. | PHP SDK guide |
REST API
The REST API is the canonical public contract. It is the right choice for every language and is the reference when diagnosing a request or comparing an SDK response.
- Create a sandbox key in the dashboard.
- Store it as
PAYSCRIBE_API_KEYon your server. - Follow the Quickstart to make a safe first request.
- Use the API reference for the endpoint schema and the Webhooks guide for asynchronous outcomes.
For dashboard configuration, key rotation, IP allowlisting, and webhook-delivery recovery, use the Developer Dashboard guide.
Try the sandbox API
Run a real, read-only sandbox request directly from the documentation. The console accepts only a sandbox key and keeps it only in the current browser tab.
Sandbox keys only. Your key is held only in this browser tab and sent directly to the sandbox API; it is never stored or sent to the documentation site.
GET https://sandbox.payscribe.ng/api/v1/my-account/profile
Authorization: Bearer ps_pk_test_...Select a read-only endpoint, enter your sandbox key, and inspect the real sandbox response.
For write operations, use the cURL, Node.js, Python, or Go examples in the endpoint documentation. This prevents an accidental test action from being mistaken for a production workflow.
Node.js and TypeScript
The official Node SDK supports virtual accounts, virtual cards, bill payments, typed request/response objects, and errors. It does not currently include payouts; use the REST API for that product.
Start with the complete Node.js SDK guide. It includes configuration, a first virtual-account flow, card and bill examples, error handling, and the canonical webhook path.
npm install @payscribe/sdk
import { Payscribe } from '@payscribe/sdk';
const payscribe = new Payscribe({
secretKey: process.env.PAYSCRIBE_API_KEY!,
environment: 'sandbox',
});
The SDK defaults to sandbox when an environment is not supplied. Use production only after completing the go-live checklist.
PHP
The official PHP SDK supports customers, virtual accounts, virtual cards, bills, retries, and typed exceptions. It does not currently include payouts; use the REST API for that product.
Start with the complete PHP SDK guide. It includes configuration, a customer-and-account flow, card and bill examples, error handling, and the canonical webhook path.
composer require payscribe/php-sdk
<?php
require __DIR__ . '/vendor/autoload.php';
use Payscribe\Payscribe;
$payscribe = Payscribe::sandbox(
getenv('PAYSCRIBE_API_KEY') ?: throw new RuntimeException('PAYSCRIBE_API_KEY is required'),
);
Use the sandbox or production key issued by the Payscribe dashboard. The PHP SDK passes the key through to the API and does not enforce a key-prefix format. This avoids copying an illustrative key format from an SDK README into your application.
Safe SDK workflow
For each money-moving operation, create and store your own unique reference, handle a timeout as an unknown outcome until reconciled, and let the webhook or status lookup determine the final state. See Idempotency, Errors, and Sandbox Testing.
Test and troubleshoot
Postman collection
Import the maintained Payscribe Postman collection to explore requests without writing a client. Configure these collection variables before sending a request:
| Variable | Sandbox value |
|---|---|
base_url | https://sandbox.payscribe.ng/api/v1 |
secret_key | Your dashboard-issued sandbox API key (the collection variable keeps its legacy name) |
Do not export a collection containing real credentials. Use Postman's secret/environment-variable facility and a separate production environment.
When SDK and docs differ
The public API reference on this site is the source for the public REST contract. If an SDK example and this site appear to disagree, do not guess or retry a money-moving request. Capture the endpoint, environment, safe request reference, HTTP status, and sanitized response, then contact support.
Report an issue safely
For an API or SDK issue, include:
- environment (sandbox or production);
- endpoint, HTTP method, and timestamp;
- request reference or webhook event ID — never the full API key;
- HTTP status and sanitized response; and
- minimal reproduction steps.
Was this page helpful?