This API will help to create new Virtual Cards.

Introduction

The PruPal Create Card API enables you to create Virtual Card. This documentation offers comprehensive guidance on utilizing this API effectively.

Request Parameters

The API expects the following parameters in the request:

PropertyPresenceTypeDescription
api_keyMandatorystringCollect API KEY From Account
card_holderMandatorystringCard Holder Name
email_addressMandatorystringCard Holder Email Address
preload_balanceMandatorystringPreload Balance

Success Response Parameters

PropertyTypeDescription
statusstringtrue
messagestringCard Create Successfully
card_idstring7448
datestring23 May, 2024

Error Response Parameters

PropertyTypeDescription
statusstringfalse
messagestringThe message associated with the status, explains the status.

Sample Request

<?php

$curl = curl_init();

$data = [
    'api_key' => 'YOUR_API_KEY',
    'card_holder' => 'My Name',
    'email_address' => '[email protected]',
    'preload_balance' => '5'
];

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.prupal.com/create',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'accept: application/json',
        'content-type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode($data)
]);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    $error_msg = curl_error($curl);
}

curl_close($curl);

if (isset($error_msg)) {
    // Handle error here
    echo "cURL Error: " . $error_msg;
} else {
    // Handle response here
    echo "Response: " . $response;
}

Sample Response

{
  "status": "true",
  "message": "Card Create Successfully",
  "card_id": "7448",
  "date": "23 May, 2024"
}