Initiate Subscription
curl --request POST \
--url https://seerbitapi.com/api/v2/recurring/subscribes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"publicKey": "SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u",
"paymentReference": "TPR2181t55PKR540RPP1U1W4392WO",
"planId": "",
"cardNumber": "5123450000000008",
"expiryMonth": "05",
"callbackUrl": "https://www.google.com",
"expiryYear": "21",
"cvv": "100",
"amount": "1000.00",
"currency": "NGN",
"productDescription": "Pilot Test Subscription",
"productId": "Terrain",
"country": "NG",
"startDate": "2020-02-25 00:00:00",
"cardName": "Kolade Samuel",
"billingCycle": "WEEKLY",
"email": "akintoyekolawole@gmail.com",
"mobileNumber": 8033456500,
"customerId": "12345678901234",
"pin": 999,
"type": "3DSECURE",
"billingPeriod": "1",
"subscriptionAmount": true
}
'import requests
url = "https://seerbitapi.com/api/v2/recurring/subscribes"
payload = {
"publicKey": "SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u",
"paymentReference": "TPR2181t55PKR540RPP1U1W4392WO",
"planId": "",
"cardNumber": "5123450000000008",
"expiryMonth": "05",
"callbackUrl": "https://www.google.com",
"expiryYear": "21",
"cvv": "100",
"amount": "1000.00",
"currency": "NGN",
"productDescription": "Pilot Test Subscription",
"productId": "Terrain",
"country": "NG",
"startDate": "2020-02-25 00:00:00",
"cardName": "Kolade Samuel",
"billingCycle": "WEEKLY",
"email": "akintoyekolawole@gmail.com",
"mobileNumber": 8033456500,
"customerId": "12345678901234",
"pin": 999,
"type": "3DSECURE",
"billingPeriod": "1",
"subscriptionAmount": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
publicKey: 'SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u',
paymentReference: 'TPR2181t55PKR540RPP1U1W4392WO',
planId: '',
cardNumber: '5123450000000008',
expiryMonth: '05',
callbackUrl: 'https://www.google.com',
expiryYear: '21',
cvv: '100',
amount: '1000.00',
currency: 'NGN',
productDescription: 'Pilot Test Subscription',
productId: 'Terrain',
country: 'NG',
startDate: '2020-02-25 00:00:00',
cardName: 'Kolade Samuel',
billingCycle: 'WEEKLY',
email: 'akintoyekolawole@gmail.com',
mobileNumber: 8033456500,
customerId: '12345678901234',
pin: 999,
type: '3DSECURE',
billingPeriod: '1',
subscriptionAmount: true
})
};
fetch('https://seerbitapi.com/api/v2/recurring/subscribes', 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://seerbitapi.com/api/v2/recurring/subscribes",
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([
'publicKey' => 'SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u',
'paymentReference' => 'TPR2181t55PKR540RPP1U1W4392WO',
'planId' => '',
'cardNumber' => '5123450000000008',
'expiryMonth' => '05',
'callbackUrl' => 'https://www.google.com',
'expiryYear' => '21',
'cvv' => '100',
'amount' => '1000.00',
'currency' => 'NGN',
'productDescription' => 'Pilot Test Subscription',
'productId' => 'Terrain',
'country' => 'NG',
'startDate' => '2020-02-25 00:00:00',
'cardName' => 'Kolade Samuel',
'billingCycle' => 'WEEKLY',
'email' => 'akintoyekolawole@gmail.com',
'mobileNumber' => 8033456500,
'customerId' => '12345678901234',
'pin' => 999,
'type' => '3DSECURE',
'billingPeriod' => '1',
'subscriptionAmount' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://seerbitapi.com/api/v2/recurring/subscribes"
payload := strings.NewReader("{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://seerbitapi.com/api/v2/recurring/subscribes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://seerbitapi.com/api/v2/recurring/subscribes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"data": {
"code": "S20",
"payments": {
"paymentReference": "TPR2181t55PER540RPP1U1W4392WO",
"linkingReference": "F365652421603189345033",
"redirectUrl": "https://staging.seerbitapigateway.com/seerbit/card-dispatch?sredref=F365652421603189345033"
},
"message": "Transaction is pending"
}
}RECURRENT
Initiate Subscription
To complete this transaction, merchant is expected to redirect to the 3DSecure site via the redirect URL provided with the response below. However if the redirect url is not returned and the code is S20 and the message is transaction is pending, the Validate OTP endpoint should be called as the customer would have received a token either by email or sms on the customers phone. To get the subscription created or the status of a subscription for the customer, the GET Subscription endpoint is called by passing the paymentReference as billingId.
POST
/
recurring
/
subscribes
Initiate Subscription
curl --request POST \
--url https://seerbitapi.com/api/v2/recurring/subscribes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"publicKey": "SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u",
"paymentReference": "TPR2181t55PKR540RPP1U1W4392WO",
"planId": "",
"cardNumber": "5123450000000008",
"expiryMonth": "05",
"callbackUrl": "https://www.google.com",
"expiryYear": "21",
"cvv": "100",
"amount": "1000.00",
"currency": "NGN",
"productDescription": "Pilot Test Subscription",
"productId": "Terrain",
"country": "NG",
"startDate": "2020-02-25 00:00:00",
"cardName": "Kolade Samuel",
"billingCycle": "WEEKLY",
"email": "akintoyekolawole@gmail.com",
"mobileNumber": 8033456500,
"customerId": "12345678901234",
"pin": 999,
"type": "3DSECURE",
"billingPeriod": "1",
"subscriptionAmount": true
}
'import requests
url = "https://seerbitapi.com/api/v2/recurring/subscribes"
payload = {
"publicKey": "SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u",
"paymentReference": "TPR2181t55PKR540RPP1U1W4392WO",
"planId": "",
"cardNumber": "5123450000000008",
"expiryMonth": "05",
"callbackUrl": "https://www.google.com",
"expiryYear": "21",
"cvv": "100",
"amount": "1000.00",
"currency": "NGN",
"productDescription": "Pilot Test Subscription",
"productId": "Terrain",
"country": "NG",
"startDate": "2020-02-25 00:00:00",
"cardName": "Kolade Samuel",
"billingCycle": "WEEKLY",
"email": "akintoyekolawole@gmail.com",
"mobileNumber": 8033456500,
"customerId": "12345678901234",
"pin": 999,
"type": "3DSECURE",
"billingPeriod": "1",
"subscriptionAmount": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
publicKey: 'SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u',
paymentReference: 'TPR2181t55PKR540RPP1U1W4392WO',
planId: '',
cardNumber: '5123450000000008',
expiryMonth: '05',
callbackUrl: 'https://www.google.com',
expiryYear: '21',
cvv: '100',
amount: '1000.00',
currency: 'NGN',
productDescription: 'Pilot Test Subscription',
productId: 'Terrain',
country: 'NG',
startDate: '2020-02-25 00:00:00',
cardName: 'Kolade Samuel',
billingCycle: 'WEEKLY',
email: 'akintoyekolawole@gmail.com',
mobileNumber: 8033456500,
customerId: '12345678901234',
pin: 999,
type: '3DSECURE',
billingPeriod: '1',
subscriptionAmount: true
})
};
fetch('https://seerbitapi.com/api/v2/recurring/subscribes', 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://seerbitapi.com/api/v2/recurring/subscribes",
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([
'publicKey' => 'SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u',
'paymentReference' => 'TPR2181t55PKR540RPP1U1W4392WO',
'planId' => '',
'cardNumber' => '5123450000000008',
'expiryMonth' => '05',
'callbackUrl' => 'https://www.google.com',
'expiryYear' => '21',
'cvv' => '100',
'amount' => '1000.00',
'currency' => 'NGN',
'productDescription' => 'Pilot Test Subscription',
'productId' => 'Terrain',
'country' => 'NG',
'startDate' => '2020-02-25 00:00:00',
'cardName' => 'Kolade Samuel',
'billingCycle' => 'WEEKLY',
'email' => 'akintoyekolawole@gmail.com',
'mobileNumber' => 8033456500,
'customerId' => '12345678901234',
'pin' => 999,
'type' => '3DSECURE',
'billingPeriod' => '1',
'subscriptionAmount' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://seerbitapi.com/api/v2/recurring/subscribes"
payload := strings.NewReader("{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://seerbitapi.com/api/v2/recurring/subscribes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://seerbitapi.com/api/v2/recurring/subscribes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"publicKey\": \"SBTESTPUBK_9sN3TuLgW6a9redEfY48cKKkUa09Pz2u\",\n \"paymentReference\": \"TPR2181t55PKR540RPP1U1W4392WO\",\n \"planId\": \"\",\n \"cardNumber\": \"5123450000000008\",\n \"expiryMonth\": \"05\",\n \"callbackUrl\": \"https://www.google.com\",\n \"expiryYear\": \"21\",\n \"cvv\": \"100\",\n \"amount\": \"1000.00\",\n \"currency\": \"NGN\",\n \"productDescription\": \"Pilot Test Subscription\",\n \"productId\": \"Terrain\",\n \"country\": \"NG\",\n \"startDate\": \"2020-02-25 00:00:00\",\n \"cardName\": \"Kolade Samuel\",\n \"billingCycle\": \"WEEKLY\",\n \"email\": \"akintoyekolawole@gmail.com\",\n \"mobileNumber\": 8033456500,\n \"customerId\": \"12345678901234\",\n \"pin\": 999,\n \"type\": \"3DSECURE\",\n \"billingPeriod\": \"1\",\n \"subscriptionAmount\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"data": {
"code": "S20",
"payments": {
"paymentReference": "TPR2181t55PER540RPP1U1W4392WO",
"linkingReference": "F365652421603189345033",
"redirectUrl": "https://staging.seerbitapigateway.com/seerbit/card-dispatch?sredref=F365652421603189345033"
},
"message": "Transaction is pending"
}
}Authorizations
Body
application/json
The body is of type object.
Response
The response is of type InitiateSubscriptionResponse · object.