Skip to content

Initiate Charge

Create a payment invoice and return a checkout URL.

MethodPOST
URL/api/m1/initiate-charge
AuthBearer ZMPRO-… (live) or ZMDEV-… (test)

Body parameters

FieldRequiredExampleDescription
tx_refYestewrdvweerrr-04Your unique invoice reference. Must be unique per merchant.
amountYes100Amount to charge or transfer.
currencyYesNGNISO currency code (e.g. NGN, USD).
payment_optionsNoallComma list of rails, or all. Null uses merchant defaults.
expired_timeYes0Invoice TTL in minutes. 0 = no expiry.
redirect_urlNohttps://example.com/payment-statusCheckout return URL (overrides merchant setting).
metaNoOptional JSON metadata.
customerYesCustomer object. Required for some payment options.
customizationsNoCheckout title, description, logo.

Headers

HeaderValue
AuthorizationBearer ZMPRO-your-live-api-key
Content-Typeapplication/json

Request

bash
curl -X POST 'https://api.vizo.app/api/m1/initiate-charge' \
  -H 'Authorization: Bearer ZMPRO-your-live-api-key' \
  -H 'Content-Type: application/json' \
  -d '{
  "tx_ref": "tewrdvweerrr-04",
  "amount": 100,
  "currency": "NGN",
  "payment_options": "all",
  "expired_time": 0,
  "redirect_url": "https://example.com/payment-status",
  "meta": "",
  "customer": "",
  "customizations": ""
}'
ts
const response = await fetch('https://api.vizo.app/api/m1/initiate-charge', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer ZMPRO-your-live-api-key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "tx_ref": "tewrdvweerrr-04",
  "amount": 100,
  "currency": "NGN",
  "payment_options": "all",
  "expired_time": 0,
  "redirect_url": "https://example.com/payment-status",
  "meta": "",
  "customer": "",
  "customizations": ""
}),
});

const data = await response.json();
console.log(data);
py
import requests

url = "https://api.vizo.app/api/m1/initiate-charge"
headers = {
    "Authorization": "Bearer ZMPRO-your-live-api-key",
    "Content-Type": "application/json",
}
payload = {
  "tx_ref": "tewrdvweerrr-04",
  "amount": 100,
  "currency": "NGN",
  "payment_options": "all",
  "expired_time": 0,
  "redirect_url": "https://example.com/payment-status",
  "meta": "",
  "customer": "",
  "customizations": ""
}

response = requests.request("POST", url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
php
<?php

$ch = curl_init('https://api.vizo.app/api/m1/initiate-charge');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ZMPRO-your-live-api-key',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'tx_ref' => 'tewrdvweerrr-04',
        'amount' => 100,
        'currency' => 'NGN',
        'payment_options' => 'all',
        'expired_time' => 0,
        'redirect_url' => 'https://example.com/payment-status',
        'meta' => '',
        'customer' => '',
        'customizations' => ''
    ], JSON_UNESCAPED_SLASHES),
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo $status, PHP_EOL, $response, PHP_EOL;

Responses

Fail Initiate Charge — 200 OK

json
{
  "status": "FAILED",
  "data": null,
  "message": "Unique tx_ref required"
}

Initiate Charge — 200 OK

json
{
  "status": "SUCCESS",
  "data": {
    "mode": "redirect",
    "url": "https://dev.vizo.app:8086/i/g9KkkA38Ygn9"
  },
  "message": "Charge initiated"
}

ViZO Merchant API documentation