Back to home
INTEGRATION
PAYMENT FEATURES
AFTER PAYMENT
Card Tokenise and Charge
The Card Tokenize and Charge API allows you to charge a tokenized payment method.
After the initial successful payment with a customer's card, it is possible to store their card authorisation for future transactions. Merchants that are not PCI compliant can leverage our Simple Checkout or our Sdk Libraries to store the card token securely, which can be used for future charges.
Create Card Token
To commence the first charge, it is required to follow local regulations that necessitate users to authenticate their card through a two-factor authentication process in the initial charge transaction. This is done to verify that the card is valid and it belongs to the user initializing the transaction and that it can be charged for subsequent transactions. Additionally a minimum amount of NGN 50.00, GHS 1, KES 1, or USD 0.50 is required to be passed in the request body for the first charge.
Request Sample
The code snippet below shows an example response for creating a card token
1curl --location 'https://seerbitapi.com/api/v2/payments/create-token' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
4--data-raw '{
5 "publicKey": "YOUR_PUBLIC_KEY",
6 "amount": "50",
7 "fullName": "Jane Smith",
8 "mobileNumber": "03447522256",
9 "redirectUrl":"http://example.com",
10 "currency": "NGN",
11 "country": "NG",
12 "paymentReference": "204g4de74a7ib0j18dg6bi521aiaejf4",
13 "email": "janesmith@seerbit.com",
14 "paymentType": "CARD",
15 "cardNumber": "512348984984988883",
16 "expiryMonth": "01",
17 "expiryYear": "25",
18 "cvv":"000",
19 "pin":"2222"
20}'
1var request = require('request');
2var options = {
3 'method': 'POST',
4 'url': 'https://seerbitapi.com/api/v2/payments/create-token',
5 'headers': {
6 'Content-Type': 'application/json',
7 'Authorization': 'Bearer YOUR_ENCRYPTED_KEY'
8 },
9 body: JSON.stringify({
10 "publicKey": "YOUR_PUBLIC_KEY",
11 "amount": "50",
12 "fullName": "Jane Smith",
13 "mobileNumber": "03447522256",
14 "redirectUrl": "http://example.com",
15 "currency": "NGN",
16 "country": "NG",
17 "paymentReference": "204g4de74a7ib0j18dg6bi521aiaejf4",
18 "email": "janesmith@seerbit.com",
19 "paymentType": "CARD",
20 "cardNumber": "512348984984988883",
21 "expiryMonth": "01",
22 "expiryYear": "25",
23 "cvv": "000",
24 "pin": "2222"
25 })
26
27};
28request(options, function (error, response) {
29 if (error) throw new Error(error);
30 console.log(response.body);
31});
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://seerbitapi.com/api/v2/payments/create-token',
7 CURLOPT_RETURNTRANSFER => true,
8 CURLOPT_ENCODING => '',
9 CURLOPT_MAXREDIRS => 10,
10 CURLOPT_TIMEOUT => 0,
11 CURLOPT_FOLLOWLOCATION => true,
12 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 CURLOPT_CUSTOMREQUEST => 'POST',
14 CURLOPT_POSTFIELDS =>'{
15 "publicKey": "YOUR_PUBLIC_KEY",
16 "amount": "50",
17 "fullName": "Jane Smith",
18 "mobileNumber": "03447522256",
19 "redirectUrl":"http://example.com",
20 "currency": "NGN",
21 "country": "NG",
22 "paymentReference": "204g4de74a7ib0j18dg6bi521aiaejf4",
23 "email": "janesmith@seerbit.com",
24 "paymentType": "CARD",
25 "cardNumber": "512348984984988883",
26 "expiryMonth": "01",
27 "expiryYear": "25",
28 "cvv":"000",
29 "pin":"2222"
30}',
31 CURLOPT_HTTPHEADER => array(
32 'Content-Type: application/json',
33 'Authorization: Bearer YOUR_ENCRYPTED_KEY'
34 ),
35));
36
37$response = curl_exec($curl);
38
39curl_close($curl);
40echo $response;
Response Sample
The code snippet below shows an example response for creating a card token
1{
2 "status": "SUCCESS",
3 "data": {
4 "code": "S20",
5 "message": "Transaction is pending",
6 "payments": {
7 "paymentReference": "{{paymentReference}}",
8 "linkingReference": "SEERBIT60416746746373661414266005",
9 "redirectUrl": "https://seerbitapi.com/50E84E82C25D"
10 }
11 }
12}
Parameter Description
Name
Type
Description
Required?
public key
string
public key - this can be copied from the seerbit dashboard
Yes
amount
string
amount to be charged
Yes
fullName
string
customer's full name
Yes
mobileNumber
string
customer's mobile number
Yes
currency
string
currency in which you want to charge
Yes
country
string
country of the business or currency
Yes
email
string
customer's email
Yes
paymentType
string
pament type should be set to CARD
Yes
cardNumber
string
debit or credit card number
Yes
expiryMonth
string
debit or credit card expiry month. E.g 12 means december
Yes
expiryYear
string
debit or credit card exiry year. E.g 23 means 2023
Yes
cvv
string
digits at the back of the card
Yes
pin
string
card pin
Yes
redirectUrl
string
page to be redirected to after successful authentication
Yes
Name
Type
Description
Required?
public Key
string
public key - this can be copied from the SeerBit dashboard
Yes
amount
string
amount to be charged
Yes
fullname
string
customer's full name
Yes
mobile number
string
customer's mobile number
Yes
currency
string
currency in which you want to charge
Yes
country
string
country of the business or currency
Yes
email
string
customer's email
Yes
paymentType
string
payment type should be set to CARD
Yes
cardNumber
string
debit or credit card number
Yes
expiryMonth
string
debit or credit card expiry month. E.g 12 means december
Yes
expiryYear
string
debit or credit card expiry year. E.g 23 means 2023
Yes
cvv
string
customer's digits at the back of the card
Yes
pin
string
card pin
Yes
redirectURL
string
page to be redirected to after successful authentication
Yes
Get Card Authorization Code
After the first successful transaction, you can query the transaction with the payment reference endpoint to confirm the status of transaction. The queried payment reference returns the authorizationCode that will be used for subsequent charges. Below is a sample response.
Response Sample
1{
2 "status": "SUCCESS",
3 "data": {
4 "code": "00",
5 "message": "Successful",
6 "payments": {
7 "amount": 50,
8 "mobilenumber": "08387522256",
9 "publicKey": "{{publicKey}}",
10 "paymentType": "CARD",
11 "maskedPan": "5123-40xx-xxxx-0008",
12 "gatewayMessage": "Successful",
13 "gatewayCode": "00",
14 "gatewayref": "SEERBIT674774783883",
15 "businessName": "Green Technological Concepts",
16 "mode": "live",
17 "channelType": "MASTERCARD",
18 "cardBin": "5123",
19 "lastFourDigits": "0008",
20 "country": "NG",
21 "currency": "NGN",
22 "paymentReference": "{{paymentReference}}",
23 "transactionProcessTime": "2022-08-25 08:57:45.634",
24 "reason": "Successful",
25 "authorizationCode": "6636373737222"
26 },
27 "customers": {
28 "customerId": "SBT56736733yye663737",
29 "customerName": "Jane Smith",
30 "customerMobile": "08387522256",
31 "customerEmail": "seerbit@emaildomain.com"
32 }
33 }
34}
Parameter Description
Name
Description
authorizationCode
authorization code to charge a customer
customerId
unique customer identification
maskedPan
masked card number
Charge Authorisation Token
To charge a card token, simply send the authorizationCode along with the amount to be charged using the charge authorization API
Request Sample
The code snippet below shows an example request for charging a token
1curl --location 'https://seerbitapi.com/api/v2/payments/charge-token' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
4--data '{
5 "publicKey": "YOUR_PUBLIC_KEY",
6 "amount": "110",
7 "paymentReference": "charge_test_3451",
8 "authorizationCode": "ye773838jje8837abe"
9}'
1var request = require('request');
2var options = {
3 'method': 'POST',
4 'url': 'https://seerbitapi.com/api/v2/payments/charge-token',
5 'headers': {
6 'Content-Type': 'application/json',
7 'Authorization': 'Bearer YOUR_ENCRYPTED_KEY'
8 },
9 body: JSON.stringify({
10 "publicKey": "YOUR_PUBLIC_KEY",
11 "amount": "110",
12 "paymentReference": "charge_test_3451",
13 "authorizationCode": "ye773838jje8837abe"
14 })
15
16};
17request(options, function (error, response) {
18 if (error) throw new Error(error);
19 console.log(response.body);
20});
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://seerbitapi.com/api/v2/payments/charge-token',
7 CURLOPT_RETURNTRANSFER => true,
8 CURLOPT_ENCODING => '',
9 CURLOPT_MAXREDIRS => 10,
10 CURLOPT_TIMEOUT => 0,
11 CURLOPT_FOLLOWLOCATION => true,
12 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 CURLOPT_CUSTOMREQUEST => 'POST',
14 CURLOPT_POSTFIELDS =>'{
15 "publicKey": "YOUR_PUBLIC_KEY",
16 "amount": "110",
17 "paymentReference": "charge_test_3451",
18 "authorizationCode": "ye773838jje8837abe"
19}',
20 CURLOPT_HTTPHEADER => array(
21 'Content-Type: application/json',
22 'Authorization: Bearer YOUR_ENCRYPTED_KEY'
23 ),
24));
25
26$response = curl_exec($curl);
27
28curl_close($curl);
29echo $response;
Response Sample
The code snippet below shows an example response for charging a token
1{
2 "status": "SUCCESS",
3 "data": {
4 "code": "00",
5 "message": "APPROVED",
6 "payments": {
7 "paymentReference": "9288383999393",
8 "linkingReference": "SEERBIT43376378378377720196"
9 }
10 }
11}
Request Sample
The code snippet below shows an example response for bulk charging a token
1curl --location 'https://seerbitapi.com/api/v2/payments/bulk-tokenize-charge' \
2--header 'Content-Type: application/json' \
3--header 'Authorization: Bearer YOUR_ENCRYPTED_KEY' \
4--data '
5[
6 {
7 "publicKey": "publickKey",
8 "amount": "11",
9 "paymentReference": "reference",
10 "authorizationCode": "authorizationCode"
11 },
12 {
13 "publicKey": "publickKey",
14 "amount": "11",
15 "paymentReference": "reference",
16 "authorizationCode": "authorizationCode"
17 },
18 {
19 "publicKey": "publickKey",
20 "amount": "11",
21 "paymentReference": "reference",
22 "authorizationCode": "authorizationCode"
23 },
24 {
25 "publicKey": "publickKey",
26 "amount": "11",
27 "paymentReference": "reference",
28 "authorizationCode": "authorizationCode"
29 }
30]'
1var request = require('request');
2var options = {
3 'method': 'POST',
4 'url': 'https://seerbitapi.com/api/v2/payments/bulk-tokenize-charge',
5 'headers': {
6 'Content-Type': 'application/json',
7 'Authorization': 'Bearer YOUR_ENCRYPTED_KEY'
8 },
9 body: JSON.stringify([
10 {
11 "publicKey": "publickKey",
12 "amount": "11",
13 "paymentReference": "reference",
14 "authorizationCode": "authorizationCode"
15 },
16 {
17 "publicKey": "publickKey",
18 "amount": "11",
19 "paymentReference": "reference",
20 "authorizationCode": "authorizationCode"
21 },
22 {
23 "publicKey": "publickKey",
24 "amount": "11",
25 "paymentReference": "reference",
26 "authorizationCode": "authorizationCode"
27 },
28 {
29 "publicKey": "publickKey",
30 "amount": "11",
31 "paymentReference": "reference",
32 "authorizationCode": "authorizationCode"
33 }
34 ])
35
36};
37request(options, function (error, response) {
38 if (error) throw new Error(error);
39 console.log(response.body);
40});
1<?php
2
3$curl = curl_init();
4
5curl_setopt_array($curl, array(
6 CURLOPT_URL => 'https://seerbitapi.com/api/v2/payments/bulk-tokenize-charge',
7 CURLOPT_RETURNTRANSFER => true,
8 CURLOPT_ENCODING => '',
9 CURLOPT_MAXREDIRS => 10,
10 CURLOPT_TIMEOUT => 0,
11 CURLOPT_FOLLOWLOCATION => true,
12 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13 CURLOPT_CUSTOMREQUEST => 'POST',
14 CURLOPT_POSTFIELDS =>'
15[
16 {
17 "publicKey": "publickKey",
18 "amount": "11",
19 "paymentReference": "reference",
20 "authorizationCode": "authorizationCode"
21 },
22 {
23 "publicKey": "publickKey",
24 "amount": "11",
25 "paymentReference": "reference",
26 "authorizationCode": "authorizationCode"
27 },
28 {
29 "publicKey": "publickKey",
30 "amount": "11",
31 "paymentReference": "reference",
32 "authorizationCode": "authorizationCode"
33 },
34 {
35 "publicKey": "publickKey",
36 "amount": "11",
37 "paymentReference": "reference",
38 "authorizationCode": "authorizationCode"
39 }
40]',
41 CURLOPT_HTTPHEADER => array(
42 'Content-Type: application/json',
43 'Authorization: Bearer YOUR_ENCRYPTED_KEY'
44 ),
45));
46
47$response = curl_exec($curl);
48
49curl_close($curl);
50echo $response;
Response Sample
The code snippet below shows an example response for bulk charging a token
1{
2 "code": "00",
3 "message": "Successful",
4 "payload": {
5 "batchId": "d4wnvzc"
6 }
7}
Query Bulk Charge with BacthId
Response Sample
The code snippet below shows an example response for querying a bulkchargeToken with the batchId
1{
2 "code": "00",
3 "message": "Successful",
4 "payload": {
5 "content": [
6 {
7 "id": 7,
8 "authorizationCode": "authocode",
9 "statusCode": "00",
10 "message": "Successful",
11 "createdAt": "2022-10-12T09:58:40.102",
12 "updatedAt": "2022-10-12T09:58:40.102",
13 "batchId": "k2auyutyr",
14 "currency": "NGN",
15 "cardBin": "5123400",
16 "cardLastFourDigits": "0739",
17 "cardType": "VISA",
18 "amount": "10.00"
19 },
20 {
21 "id": 8,
22 "authorizationCode": "authocode",
23 "statusCode": "00",
24 "message": "Successful",
25 "createdAt": "2022-10-12T09:58:46.443",
26 "updatedAt": "2022-10-12T09:58:46.443",
27 "batchId": "kuiuyu",
28 "currency": "NGN",
29 "cardBin": "5123400",
30 "cardLastFourDigits": "0008",
31 "cardType": "VISA",
32 "amount": "15.00"
33 }
34 ],
35 "pageable": {
36 "sort": {
37 "sorted": true,
38 "unsorted": false,
39 "empty": false
40 },
41 "pageNumber": 0,
42 "pageSize": 10,
43 "offset": 0,
44 "paged": true,
45 "unpaged": false
46 },
47 "last": true,
48 "totalElements": 2,
49 "totalPages": 1,
50 "sort": {
51 "sorted": true,
52 "unsorted": false,
53 "empty": false
54 },
55 "first": true,
56 "numberOfElements": 2,
57 "size": 10,
58 "number": 0,
59 "empty": false
60 }
61}
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.