Opay Charge
curl --request POST \
--url https://api.zerocash.tech/api/b2b/fiat/deposit/opay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100,
"currency": "NGN",
"email": "john.stewart@gmail.com",
"externalReference": "nvcmnvnmclmlv",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://x.com/"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100,
currency: 'NGN',
email: 'john.stewart@gmail.com',
externalReference: 'nvcmnvnmclmlv',
successRedirectUrl: 'https://www.google.com/',
failureRedirectUrl: 'https://x.com/'
})
};
fetch('https://api.zerocash.tech/api/b2b/fiat/deposit/opay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerocash.tech/api/b2b/fiat/deposit/opay"
payload = {
"amount": 100,
"currency": "NGN",
"email": "john.stewart@gmail.com",
"externalReference": "nvcmnvnmclmlv",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://x.com/"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zerocash.tech/api/b2b/fiat/deposit/opay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 100,
'currency' => 'NGN',
'email' => 'john.stewart@gmail.com',
'externalReference' => 'nvcmnvnmclmlv',
'successRedirectUrl' => 'https://www.google.com/',
'failureRedirectUrl' => 'https://x.com/'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerocash.tech/api/b2b/fiat/deposit/opay"
payload := strings.NewReader("{\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"email\": \"john.stewart@gmail.com\",\n \"externalReference\": \"nvcmnvnmclmlv\",\n \"successRedirectUrl\": \"https://www.google.com/\",\n \"failureRedirectUrl\": \"https://x.com/\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"message": "Transaction initiated successfully.",
"data": {
"transactionId": "6VOWReShlbh4MzXu8kbQ"
}
}{}Charges
Opay Charge
Accept payments via OPay. Charges are processed asynchronously; some transactions require a redirect to complete authentication before funds are captured.
POST
/
api
/
b2b
/
fiat
/
deposit
/
opay
Opay Charge
curl --request POST \
--url https://api.zerocash.tech/api/b2b/fiat/deposit/opay \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100,
"currency": "NGN",
"email": "john.stewart@gmail.com",
"externalReference": "nvcmnvnmclmlv",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://x.com/"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 100,
currency: 'NGN',
email: 'john.stewart@gmail.com',
externalReference: 'nvcmnvnmclmlv',
successRedirectUrl: 'https://www.google.com/',
failureRedirectUrl: 'https://x.com/'
})
};
fetch('https://api.zerocash.tech/api/b2b/fiat/deposit/opay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerocash.tech/api/b2b/fiat/deposit/opay"
payload = {
"amount": 100,
"currency": "NGN",
"email": "john.stewart@gmail.com",
"externalReference": "nvcmnvnmclmlv",
"successRedirectUrl": "https://www.google.com/",
"failureRedirectUrl": "https://x.com/"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.zerocash.tech/api/b2b/fiat/deposit/opay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 100,
'currency' => 'NGN',
'email' => 'john.stewart@gmail.com',
'externalReference' => 'nvcmnvnmclmlv',
'successRedirectUrl' => 'https://www.google.com/',
'failureRedirectUrl' => 'https://x.com/'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerocash.tech/api/b2b/fiat/deposit/opay"
payload := strings.NewReader("{\n \"amount\": 100,\n \"currency\": \"NGN\",\n \"email\": \"john.stewart@gmail.com\",\n \"externalReference\": \"nvcmnvnmclmlv\",\n \"successRedirectUrl\": \"https://www.google.com/\",\n \"failureRedirectUrl\": \"https://x.com/\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"message": "Transaction initiated successfully.",
"data": {
"transactionId": "6VOWReShlbh4MzXu8kbQ"
}
}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
A unique ID of your liking to reconcile transactions internally.
3-letter currency code. Defaults to NGN.
Customer's email address.
The redirect url for a successful transaction
The redirect url for a failed transaction
⌘I