OasisPay Docs
Build with OasisPay
Create payments, issue virtual accounts, verify signed webhooks, and test safely before going live.
Getting Started
Use your secret key in the `Authorization` header. For every create request, send an `Idempotency-Key` so safe retries do not create duplicates.
curl https://api.oasispayhq.com/api/v1/payments \
-H "Authorization: Bearer osk_test_xxx" \
-H "Idempotency-Key: order_1001" \
-H "Content-Type: application/json" \
-d '{
"amount": { "amount": 5000, "currency": "NGN" },
"customer": { "email": "[email protected]" },
"paymentMethod": "bank_transfer"
}'API Reference
Payment Creation
Create a payment with an amount, customer, and payment method. OasisPay returns instructions for the customer to complete the payment.
await fetch("https://api.oasispayhq.com/api/v1/payments", {
method: "POST",
headers: {
Authorization: "Bearer osk_test_xxx",
"Content-Type": "application/json",
"Idempotency-Key": "order_1001"
},
body: JSON.stringify({
amount: { amount: 5000, currency: "NGN" },
customer: { email: "[email protected]" },
paymentMethod: "bank_transfer"
})
});Virtual Accounts
Use dynamic virtual accounts for one payment, or reserved virtual accounts for reusable customer collections.
await fetch("https://api.oasispayhq.com/api/v1/virtual-accounts/dynamic", {
method: "POST",
headers: {
Authorization: "Bearer osk_test_xxx",
"Content-Type": "application/json",
"Idempotency-Key": "va_1001"
},
body: JSON.stringify({
amount: 5000,
currency: "NGN",
customer: { email: "[email protected]" }
})
});Webhooks
OasisPay sends `X-OasisPay-Signature`, `X-OasisPay-Timestamp`, and `X-OasisPay-Event`. Verify `HMAC_SHA256(timestamp + "." + rawBody, webhookSecret)`.
import crypto from "crypto";
function verifyWebhook(rawBody, headers, secret) {
const timestamp = headers["x-oasispay-timestamp"];
const signature = headers["x-oasispay-signature"];
const expected = crypto
.createHmac("sha256", secret)
.update(timestamp + "." + rawBody)
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Errors
Every API error includes a request ID. Use it when checking API logs or contacting support.
{
"statusCode": 401,
"message": "Invalid API key.",
"requestId": "req_xxx",
"path": "/api/v1/payments",
"timestamp": "2026-06-03T12:00:00.000Z"
}SDKs And Language Examples
$client->payments->create([ "amount" => ["amount" => 5000, "currency" => "NGN"], "customer" => ["email" => "[email protected]"] ]);
client.payments.create(
amount={"amount": 5000, "currency": "NGN"},
customer={"email": "[email protected]"}
)OasisPay::payments()->create([ "amount" => ["amount" => 5000, "currency" => "NGN"], "customer" => ["email" => "[email protected]"] ]);
await client.payments.create({
amount: { amount: 5000, currency: "NGN" },
customer: { email: "[email protected]" }
});Testing
Use `osk_test_` keys for sandbox calls. Send stable idempotency keys when retrying POST requests.
Headers: Authorization: Bearer osk_test_xxx Idempotency-Key: your_unique_operation_id Test webhook endpoints from: /dashboard/developers/webhooks
