Authorise & Capture (Verve Card)

Authorisation

Request Sample
The code snippet below shows an example response for requesting authorisation
1curl --location 'https://seerbitapi.com/api/v2/payments/authorise' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Basic {token}' \
4--data-raw '{
5	"publicKey": "SBPUBK_Z************************",
6	"amount": "11.00",
7	"fullName": "WXABCTCQ APHAJXLU",
8	"mobileNumber": "59800000000",
9	"currency": "NGN",
10	"country": "NG",
11	"paymentReference": "1752584260",
12	"email": "tobi.girl@mailinator.com",
13	"cardNumber": "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
14	"expiryMonth": "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
15	"expiryYear": "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
16	"cvv": "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
17	"callbackUrl": null,
18	"redirectUrl": null,
19	"paymentType": "CARD",
20	"pin": 1234 (Cannot be null)
21	
22}'
1const axios = require('axios');
2// Define the request payload
3const requestData = {
4  publicKey: "SBPUBK_Z************************",
5  amount: "11.00",
6  fullName: "WXABCTCQ APHAJXLU",
7  mobileNumber: "59800000000",
8  currency: "NGN",
9  country: "NG",
10  paymentReference: "1752584260",
11  email: "tobi.girl@mailinator.com",
12  cardNumber: "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
13  expiryMonth: "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
14  expiryYear: "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
15  cvv: "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
16  callbackUrl: null,
17  redirectUrl: null,
18  paymentType: "CARD",
19  pin: 1234 // Cannot be null
20};
21// Define the request headers
22const headers = {
23  'Content-Type': 'application/json',
24  'Authorization': 'Basic {token}'
25};
26// Make the POST request
27axios.post('https://seerbitapi.com/api/v2/payments/authorise', requestData, { headers })
28  .then(response => {
29    console.log('Response:', response.data);
30  })
31  .catch(error => {
32    console.error('Error:', error.response.data);
33  });
1<?php
2// Define the request data as an associative array
3$requestData = array(
4    "publicKey" => "SBPUBK_Z************************",
5    "amount" => "11.00",
6    "fullName" => "WXABCTCQ APHAJXLU",
7    "mobileNumber" => "59800000000",
8    "currency" => "NGN",
9    "country" => "NG",
10    "paymentReference" => "1752584260",
11    "email" => "tobi.girl@mailinator.com",
12    "cardNumber" => "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
13    "expiryMonth" => "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
14    "expiryYear" => "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
15    "cvv" => "CV-44b6c334-d730-4c81-bed5-78a0421ed2e3",
16    "callbackUrl" => null,
17    "redirectUrl" => null,
18    "paymentType" => "CARD",
19    "pin" => 1234 // Cannot be null
20);
21// Convert the request data to JSON format
22$requestJson = json_encode($requestData);
23// Initialize cURL session
24$ch = curl_init();
25// Set the cURL options
26curl_setopt($ch, CURLOPT_URL, "https://seerbitapi.com/api/v2/payments/authorise");
27curl_setopt($ch, CURLOPT_POST, true);
28curl_setopt($ch, CURLOPT_POSTFIELDS, $requestJson);
29curl_setopt($ch, CURLOPT_HTTPHEADER, array(
30    'Content-Type: application/json',
31    'Authorization: Basic {token}' // Replace {token} with your actual token
32));
33curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
34// Execute the cURL request
35$responseJson = curl_exec($ch);
36// Check for errors
37if ($responseJson === false) {
38    echo "Error: " . curl_error($ch);
39} else {
40    // Decode the JSON response
41    $response = json_decode($responseJson, true);
42    // Output the response
43    print_r($response);
44}
45// Close cURL session
46curl_close($ch);
47?>
Response Sample
The code snippet below shows an example response for creating a card token
1{
2"status": "SUCCESS",
3"data": {
4"code": "00",
5"payments": {
6"paymentReference": "sskallalalssssssslalll1",
7"linkingReference": "SEERBIT263904991709891608906",
8"status": "AUTHORIZED",
9"card": {
10"bin": "479356",
11"last4": "5619",
12"token": "tk_5d5dd7bb-3450-44fb-8587-6edaef17a679"
13}
14},
15"message": "APPROVED"
16}
17}

Case 1: This service is called only when there is a successful authorisation and merchant wants to complete the transaction.

The following use cases below describes the next line of actin for Auth and Capture transactions:
Request Sample
The code snippet below shows an example response for requesting authorisation
1curl --location 'https://seerbitapi.com/api/v2/payments/capture' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Basic {token}' \
4--data-raw 
5'{
6	"paymentReference":"skkalalalallallalalala",
7	"publicKey":"SBPUBK_OMX6ZNRZPLIHQ9Y0ZG6FCNR0EAYIGIAT",
8	"currency":"NGN",
9	"country":"NG",
10	"productDescription":"TEST DESCRIPTION",
11	"amount":"5"
12}'
1Nodejs:
2const https = require('https');
3const data = JSON.stringify({
4  paymentReference: "skkalalalallallalalala",
5  publicKey: "SBPUBK_OMX6ZNRZPLIHQ9Y0ZG6FCNR0EAYIGIAT",
6  currency: "NGN",
7  country: "NG",
8  productDescription: "TEST DESCRIPTION",
9  amount: "5"
10});
11const options = {
12  hostname: 'seerbitapi.com',
13  path: '/api/v2/payments/capture',
14  method: 'POST',
15  headers: {
16    'Content-Type': 'application/json',
17    'Authorization': 'Basic {token}' // Replace {token} with your actual token
18  }
19};
20const req = https.request(options, (res) => {
21  let response = '';
22  res.on('data', (chunk) => {
23    response += chunk;
24  });
25  res.on('end', () => {
26    console.log('Response:');
27    console.log(JSON.parse(response));
28  });
29});
30req.on('error', (error) => {
31  console.error('Error:', error);
32});
33req.write(data);
34req.end();
1<?php
2$data = json_encode(array(
3    "paymentReference" => "skkalalalallallalalala",
4    "publicKey" => "SBPUBK_OMX6ZNRZPLIHQ9Y0ZG6FCNR0EAYIGIAT",
5    "currency" => "NGN",
6    "country" => "NG",
7    "productDescription" => "TEST DESCRIPTION",
8    "amount" => "5"
9));
10$url = "https://seerbitapi.com/api/v2/payments/capture";
11$token = "{token}"; // Replace {token} with your actual token
12$options = array(
13    'http' => array(
14        'header'  => "Content-Type: application/json\r\n" .
15                     "Authorization: Basic $token\r\n",
16        'method'  => 'POST',
17        'content' => $data
18    )
19);
20$context  = stream_context_create($options);
21$response = file_get_contents($url, false, $context);
22if ($response === false) {
23    echo "Error: Unable to connect to the server.";
24} else {
25    echo "Response:\n";
26    var_dump(json_decode($response, true));
27}
28?>
Response Sample
1{
2"status": "SUCCESS",
3"data": {
4"code": "00",
5"payments": {
6"linkingReference": "F849599451588076316099",
7"status": "CAPTURED"
8},
9"message": "Successful" }
10}
Need something else?
If you have any questions or need general help, visit our support page
Signup for developer update
You can unsubscribe at any time. Read our privacy policy.