# Cards Issuance

<mark style="color:green;">`POST`</mark> {{base\_url}}/business/vcard-issuance

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | SECRET\_KEY |

#### Request Body

| Name                                         | Type   | Description                                                  |
| -------------------------------------------- | ------ | ------------------------------------------------------------ |
| cardbrand<mark style="color:red;">\*</mark>  | Sting  | Card brand you want to issued e.g Mastercard, Visa           |
| currency<mark style="color:red;">\*</mark>   | String | USD for USD Virtual Card or NGN for NGN Virtual card         |
| amount<mark style="color:red;">\*</mark>     |        | Amount to pre-fund the card with after issuing               |
| trackingid<mark style="color:red;">\*</mark> | String | Customer tracking ID returned from the card account endpoint |

{% hint style="danger" %}
Your secret keys are to be kept secret and only stored on your servers. Do not pass your secret key to the front-end language where it can be exploited.
{% endhint %}

Take a look at how you might do this:

{% tabs %}
{% tab title="cURL" %}

```php
curl --location '{{base_url}}/business/vcard-issuance' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SECRET_KEY' \
--data '{
    "currency": "USD",
    "trackingid": "9239293",
    "cardbrand": "Mastercard",
    "amount": 5
}'
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "currency": "USD",
  "trackingid": "9239293",
  "cardbrand": "Mastercard",
  "amount": 5
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: '{{base_url}}/business/vcard-issuance'
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer SECRET_KEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP - cURL" %}

```php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '{{base_url}}/business/vcard-issuance',
  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 =>'{
    "currency": "USD",
    "trackingid": "9239293",
    "cardbrand": "Mastercard",
    "amount": 5
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer SECRET_KEY'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Dart" %}

```dart
var headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer SECRET_KEY'
};
var request = http.Request('POST', Uri.parse('{{base_url}}/business/vcard-issuance'));
request.body = json.encode({
  "currency": "USD",
  "trackingid": "9239293",
  "cardbrand": "Mastercard",
  "amount": 5
});
request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}

```

{% endtab %}
{% endtabs %}

## Sample response

{% tabs %}
{% tab title="Successful" %}

```json
{
    "status": true,
    "responsecode": "01",
    "message": "Card Issuance Processing",
    "txref": "0621121102020",
    "charged": 6,
    "currency": "USD"
}
```

{% endtab %}

{% tab title="Failed" %}

```
{
    "status": false
    "responsecode": "00",
    "message": "Insufficient wallet balance for this transaction",
    "txref": "",
    "charged": ""
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
When the card is successfully processed, we will notify you via webhook notification with the card details and card ID. Event\_type as transactions and Paid\_through as virtualcard
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.1app.online/cards-virtual-and-physical/virtual-card/cards-issuance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
