Create Card PAN
POST {api-url}/createCardPAN?ns={community}
Use this endpoint to create a new physical or virtual Card PAN.
Creating a card assigns a new physical or virtual Card PAN to a user. A user may only own a single active card per VoucherType. If a user already possesses a card for the specified VoucherType, this endpoint will automatically act as a Top-Up operation, adding funds to the existing card.
To create an unlinked, floating card, leave Username blank and set Amount to 0.
Parameters
Section titled βParametersβ| Field | Type | Requirement | Description |
|---|---|---|---|
CardPAN | String | Optional | The PAN to target. Optional if VoucherType and Username are used to create a new card. |
CardPANReference | String | Optional | Can be used instead of CardPAN to top up or target a specific card. |
Amount | String | Required | The amount in cents to top up or initialize the card with. |
Currency | String | Required | The currency of the amount. |
VoucherType | String | Optional | The type of voucher linked to the card. |
AutoCreateVoucher | String | Optional | Whether to automatically create vouchers during shortfalls. (true or false) |
Username | String | Optional | The username of the card owner. If empty and Amount is 0, creates a floating unlinked card. |
IDNumber | String | Optional | The ID number of the user. |
StoreID | String | Required | A unique identifier for the funding store. |
Metadata | String | Optional | Any other detail to store with this transaction. |
Example Body
Section titled βExample Bodyβ{ "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""}Parameters
Section titled βParametersβ| Field | Type | Description |
|---|---|---|
TID | String | TID of the executed operation. |
CardPAN | String | The 13-digit Primary Account Number assigned. |
CardPANReference | String | The Reference linked to the Card PAN. |
Date | String | The date the card was created (YYYY/MM/DD). |
Time | String | The time the card was created (HH:MM). |
State | String | Transaction state (Success or Failed). |
Status | String | Transaction status code (1 or negative error code). |
Error | String | Failure reason, if applicable. |
Example Body
Section titled βExample Bodyβ{ "TID": "15000000000", "CardPAN": "5003456789012", "CardPANReference": "3K9XJ1L2M", "Date": "2026/03/19", "Time": "12:00", "State": "Success", "Status": "1", "Error": ""}curl -X POST '{api-url}/createCardPAN?ns={community}' \-H 'Authorization: bearer YOUR_TOKEN' \-H 'Content-Type: application/json' \-d '{"CardPAN":"","CardPANReference":"","Amount":"10000","Currency":"ZAR","VoucherType":"168Cash","AutoCreateVoucher":"true","Username":"27820000000","IDNumber":"","StoreID":"Celbux","Metadata":""}'using System;using System.Net.Http;using System.Text;using System.Threading.Tasks;
class Program{ static async Task Main(string[] args) { var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "{api-url}/createCardPAN?ns={community}"); request.Headers.Add("Authorization", "bearer YOUR_TOKEN");
var jsonPayload = @"{ ""CardPAN"": """", ""CardPANReference"": """", ""Amount"": ""10000"", ""Currency"": ""ZAR"", ""VoucherType"": ""168Cash"", ""AutoCreateVoucher"": ""true"", ""Username"": ""27820000000"", ""IDNumber"": """", ""StoreID"": ""Celbux"", ""Metadata"": """"}"; request.Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request); response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); }}package main
import ( "fmt" "io/ioutil" "net/http" "strings")
func main() { url := "{api-url}/createCardPAN?ns={community}" payload := strings.NewReader(`{"CardPAN":"","CardPANReference":"","Amount":"10000","Currency":"ZAR","VoucherType":"168Cash","AutoCreateVoucher":"true","Username":"27820000000","IDNumber":"","StoreID":"Celbux","Metadata":""}`)
req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "bearer YOUR_TOKEN") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req) defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body) fmt.Println(string(body))}import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;
public class ApiRequest { public static void main(String[] args) throws Exception { var payload = """ { "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""} """;
var request = HttpRequest.newBuilder() .uri(URI.create("{api-url}/createCardPAN?ns={community}")) .header("Authorization", "bearer YOUR_TOKEN") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(payload)) .build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); }}// Requires Node.js v18+(async () => { const url = '{api-url}/createCardPAN?ns={community}'; const payload = { "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""};
try { const response = await fetch(url, { method: 'POST', headers: { 'Authorization': 'bearer YOUR_TOKEN', 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); const data = await response.json(); console.log(data); } catch (error) { console.error('Error:', error); }})();<?php$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => '{api-url}/createCardPAN?ns={community}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '{ "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""}', CURLOPT_HTTPHEADER => array( 'Authorization: bearer YOUR_TOKEN', 'Content-Type: application/json' ),));
$response = curl_exec($curl);curl_close($curl);echo $response;import requestsimport json
url = "{api-url}/createCardPAN?ns={community}"payload = { "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""}
headers = { "Authorization": "bearer YOUR_TOKEN", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)print(response.json())require 'uri'require 'net/http'require 'json'
url = URI("{api-url}/createCardPAN?ns={community}")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Post.new(url)request["Authorization"] = 'bearer YOUR_TOKEN'request["Content-Type"] = 'application/json'
request.body = JSON.dump({ "CardPAN": "", "CardPANReference": "", "Amount": "10000", "Currency": "ZAR", "VoucherType": "168Cash", "AutoCreateVoucher": "true", "Username": "27820000000", "IDNumber": "", "StoreID": "Celbux", "Metadata": ""})
response = http.request(request)puts response.read_body