Initiate Payment Checkout
curl --request POST \
--url https://business-api.userivo.co/business/v1/payments/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 50000,
"currency": "NGN",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"reference": "my_custom_ref_123",
"redirectUrl": "https://example.com/payment-success"
}
'import requests
url = "https://business-api.userivo.co/business/v1/payments/initiate"
payload = {
"amount": 50000,
"currency": "NGN",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"reference": "my_custom_ref_123",
"redirectUrl": "https://example.com/payment-success"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 50000,
currency: 'NGN',
customer: {email: 'customer@example.com', name: 'John Doe'},
reference: 'my_custom_ref_123',
redirectUrl: 'https://example.com/payment-success'
})
};
fetch('https://business-api.userivo.co/business/v1/payments/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://business-api.userivo.co/business/v1/payments/initiate",
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' => 50000,
'currency' => 'NGN',
'customer' => [
'email' => 'customer@example.com',
'name' => 'John Doe'
],
'reference' => 'my_custom_ref_123',
'redirectUrl' => 'https://example.com/payment-success'
]),
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://business-api.userivo.co/business/v1/payments/initiate"
payload := strings.NewReader("{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\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))
}HttpResponse<String> response = Unirest.post("https://business-api.userivo.co/business/v1/payments/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://business-api.userivo.co/business/v1/payments/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Payment link created successfully",
"data": {
"reference": "my_custom_ref_123",
"code": "abc123def456",
"link": "https://payment.userivo.co/checkout/abc123def456"
}
}Payments
Initiate Payment Checkout
Initiates a new payment checkout session.
POST
/
payments
/
initiate
Initiate Payment Checkout
curl --request POST \
--url https://business-api.userivo.co/business/v1/payments/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 50000,
"currency": "NGN",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"reference": "my_custom_ref_123",
"redirectUrl": "https://example.com/payment-success"
}
'import requests
url = "https://business-api.userivo.co/business/v1/payments/initiate"
payload = {
"amount": 50000,
"currency": "NGN",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"reference": "my_custom_ref_123",
"redirectUrl": "https://example.com/payment-success"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 50000,
currency: 'NGN',
customer: {email: 'customer@example.com', name: 'John Doe'},
reference: 'my_custom_ref_123',
redirectUrl: 'https://example.com/payment-success'
})
};
fetch('https://business-api.userivo.co/business/v1/payments/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://business-api.userivo.co/business/v1/payments/initiate",
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' => 50000,
'currency' => 'NGN',
'customer' => [
'email' => 'customer@example.com',
'name' => 'John Doe'
],
'reference' => 'my_custom_ref_123',
'redirectUrl' => 'https://example.com/payment-success'
]),
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://business-api.userivo.co/business/v1/payments/initiate"
payload := strings.NewReader("{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\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))
}HttpResponse<String> response = Unirest.post("https://business-api.userivo.co/business/v1/payments/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://business-api.userivo.co/business/v1/payments/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 50000,\n \"currency\": \"NGN\",\n \"customer\": {\n \"email\": \"customer@example.com\",\n \"name\": \"John Doe\"\n },\n \"reference\": \"my_custom_ref_123\",\n \"redirectUrl\": \"https://example.com/payment-success\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Payment link created successfully",
"data": {
"reference": "my_custom_ref_123",
"code": "abc123def456",
"link": "https://payment.userivo.co/checkout/abc123def456"
}
}Authorizations
Your Business API Key
Body
application/json
Response
200 - application/json
Payment checkout initiated successfully.
