REST API v1 · OpenAPI Compliant

Yoventra Payment Gateway

Accept payments globally on your website or application. Receive payments through bank accounts, cards, and mobile money with instant ledger settlement.


1. Introduction

Yoventra operates a direct multi-channel payment gateway that allows online businesses to receive payments from their customers. When integrated, payments can be funded via:

🏛️ Bank Account Payment

Customers with an online banking account on our platform can authorize an atomic direct debit from their account.

💳 Cards & Mobile Money (Paystack)

Customers can pay using Visa, Mastercard, Verve, or Africa Mobile Money (Ghana GHS & Nigeria NGN) via Paystack.

2. Merchant Registration

To start accepting payments, register your business at /merchant/register.php. Upon registration, you will receive:

3. API Authentication

We use API keys to authenticate requests. Authenticate server-to-server requests by providing your Secret Key in the Authorization header:

Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Public Key (pk_...): For client-side JavaScript popup checkouts. Safe to include in HTML.
Secret Key (sk_...): For backend server-to-server API requests. Never expose in frontend code.
TRY IT LIVE

Interactive Checkout Demo

Test the embedded modal checkout popup right now:

POST

/api/v1/payment/initialize.php

Initializes a transaction session and returns a checkout URL and session token.

Headers
Authorization: Bearer sk_live_xxxxxx
Content-Type: application/json
Idempotency-Key: <optional-unique-uuid>
Request Body (JSON)
{
  "amount": 150.00,
  "currency": "USD",
  "email": "customer@example.com",
  "name": "John Doe",
  "phone": "+1234567890",
  "reference": "ORDER-99120",
  "callback_url": "https://mysite.com/payment/callback",
  "return_url": "https://mysite.com/order/success",
  "description": "Invoice #99120 Payment"
}
Response (200 OK)
{
  "status": true,
  "code": "PAYMENT_INITIALIZED",
  "message": "Payment initialized successfully.",
  "data": {
    "transaction_id": "GW-20260916-A1B2C3D4",
    "merchant_reference": "ORDER-99120",
    "amount": 150.00,
    "currency": "USD",
    "fee": 3.50,
    "net_amount": 146.50,
    "environment": "live",
    "session_id": "cs_live_9f81a7b3c2e5d4...",
    "checkout_url": "https://yoventra.top/checkout/index.php?session=cs_live_...",
    "expires_at": "2026-09-16 05:00:00"
  }
}
GET

/api/v1/payment/verify.php?reference={reference}

Verify payment status directly server-to-server using the gateway reference (GW-...) or your merchant reference.

curl -X GET "https://yoventra.top/api/v1/payment/verify.php?reference=GW-20260916-A1B2C3D4" \
     -H "Authorization: Bearer sk_live_xxxxxx"
{
  "status": true,
  "code": "PAYMENT_VERIFIED",
  "data": {
    "transaction_id": "GW-20260916-A1B2C3D4",
    "merchant_reference": "ORDER-99120",
    "amount": 150.00,
    "currency": "USD",
    "fee": 3.50,
    "net_amount": 146.50,
    "status": "successful",
    "payment_method": "bank_account",
    "paid_at": "2026-09-16 04:32:10",
    "customer": {
      "email": "customer@example.com",
      "name": "John Doe",
      "phone": "+1234567890"
    }
  }
}

8. Webhooks & HMAC Signature Verification

Every successful payment, refund, or failure triggers an HTTP POST request to your configured webhook endpoint. Verify the X-Bank-Signature header using your webhook secret:

<?php
// PHP Webhook Receiver Example
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_BANK_SIGNATURE'] ?? '';
$secret = 'whsec_your_secret_key';

// Verify HMAC-SHA256 signature
$expected = hash_hmac('sha256', $payload, $secret);
if (!hash_equals($expected, $signature)) {
    http_response_code(401);
    exit('Invalid signature');
}

$event = json_decode($payload, true);

if ($event['event'] === 'payment.success') {
    $txId = $event['data']['transaction_id'];
    $orderRef = $event['data']['reference'];
    $amount = $event['data']['amount'];
    // Fulfill order in your database
}

http_response_code(200);
echo json_encode(['received' => true]);
?>

9. Idempotency Keys

To prevent accidental duplicate charges during network timeouts, send an Idempotency-Key header with a unique request UUID. If the same request is retried, the gateway safely returns the cached transaction without charging the customer again.

Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d

10. Standard Error Codes

Code HTTP Description
INVALID_API_KEY401Credentials are missing, invalid, or revoked.
INVALID_AMOUNT400Amount is missing or less than or equal to 0.
INVALID_CURRENCY400Currency code is not recognized or supported.
DUPLICATE_REFERENCE409A successful transaction with this reference already exists.
TRANSACTION_NOT_FOUND404Transaction reference does not match any record.
RATE_LIMITED429Too many requests. Back off and retry.
IDEMPOTENCY_CONFLICT409Idempotency key was re-used with different payload.