Squad API Documentation
  • Home
  • Payments
    • Initiate Payment
    • Direct API Integration
    • Squad Payment Modal
    • Verify Transaction
    • Aggregator and Sub-merchants
  • Verify Transaction
  • Webhook & Redirect URL
    • Signature validation
  • Virtual Accounts
  • Test Cards
  • Payment Link
  • Refund API
  • Squad Woo Commerce Plugin
  • Disputes & Chargebacks
  • Wallet Balance
  • Transfer API
  • Squad POS
    • Getting Started
    • API Documentation
  • VALUE ADDED SERVICES
    • AIRTIME AND DATA
    • SMS
      • BUCKET
      • TEMPLATES
      • MESSAGES
    • Utilities
      • Cable Subscription
      • Electricity Subscription
Powered by GitBook
On this page

Was this helpful?

  1. VALUE ADDED SERVICES

SMS

These are a suite of APIs that allow you to vend SMS. Please note you are expected to fund your specified GTBank virtual account from which your VAS dashboard is credited.

PreviousAIRTIME AND DATANextBUCKET

Last updated 1 year ago

Was this helpful?

API KEYS AND AUTHORIZATION

  1. Once profiled, log in details will be sent to you

  2. Once logged in, you can retrieve keys and other credentials for calling API endpoints

The API endpoints are authorized using the key and secret, they should be passed as headers in the request.

Generating a Secret: This is done by using crypto to sign the strings ${client_id} ${user_id} ${current date in YYYY-MM-DD}.e.g for client 41, user 9 and date September 11, 2023, you should encrypt 41 9 2023-09-11. Use the key and IV gotten from your dashboard to do this.

Secret should be generated each day or on each request for security purposes

CODE SNIPPETS FOR ENCRYPTING SECRET

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

public string Encrypt(string text, string keyString, string ivString)
{

    using (RijndaelManaged myRijndael = new RijndaelManaged())
    {
        byte[] key = Encoding.ASCII.GetBytes(keyString);
        byte[] iv = Encoding.ASCII.GetBytes(ivString);
        byte[] encrypted;
        using (RijndaelManaged rijAlg = new RijndaelManaged())
        {
            ICryptoTransform encryptor = rijAlg.CreateEncryptor(key, iv);
            using (MemoryStream msEncrypt = new MemoryStream())
            {
                using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
                {
                    using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
                    {
                        swEncrypt.Write(text);
                    }
                    encrypted = msEncrypt.ToArray();
                }
            }
        }
        string base64String = Convert.ToBase64String(encrypted);
        return base64String;
    }
}
const crypto = require("crypto");

const encrypt = (text, keyString, ivString) => {
	const cipher = crypto.createCipheriv("aes256", keyString, ivString);
	let encrypted = cipher.update(text, "utf8", "base64");
	encrypted += cipher.final("base64");
	return encrypted;
};
function encrypt($text, $keyString, $ivString) {
    $cipher = "aes-256-cbc";
    $encrypted = openssl_encrypt($text, $cipher, $keyString, OPENSSL_RAW_DATA, $ivString);
    return base64_encode($encrypted);
}
Log into your account