# Cards Details

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

#### Headers

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

#### Request Body

| Name                                     | Type  | Description |
| ---------------------------------------- | ----- | ----------- |
| cardid<mark style="color:red;">\*</mark> | Sting | Card ID     |

{% hint style="danger" %}
Your secret keys are to be kept confidential and stored only 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/carddetails' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SECRET_KEY' \
--data '{
    "cardid": "021109a9-4bfa-4321-02ca-dc91e9a7b4"
}'
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "cardid": "021109a9-4bfa-4321-02ca-dc91e9a7b4"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: '{{base_url}}/business/carddetails'
  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/carddetails',
  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 =>'{
    "cardid": "021109a9-4bfa-4321-02ca-dc91e9a7b4"
}',
  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/carddetails'));
request.body = json.encode({
  "cardid": "021109a9-4bfa-4321-02ca-dc91e9a7b4"
});
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,
    "message": "Card details retrieved",
    "responsecode": "01",
    "available_bal": "612,304.27",
    "usericon": "https://oacloud.oneappgo.com/media_library/oneapp-personal/65b0dc7a31f253.37195213.png",
    "cardstatus": "active",
    "cardbrand": "VERVE",
    "cardtype": "Physical",
    "cardpan": "583007********0000",
    "expiryyr": "27",
    "expirymonth": "06",
    "cvv": "",
    "holdername": "John Doe",
    "customerid": "01057-e48b-4e45-ddc1-0c91ec1988",
    "card_id": "021109a9-4bfa-4321-02ca-dc91e9a7b4",
    "currency": "USD",
    "created_at": "Sat, 22-06-2024 09:08 pm",
    "lastupdate": "Sat, 22-06-2024 09:08 pm",
    "dstatus": "1",
    "defaultpin": "0000"
}
```

{% endtab %}
{% endtabs %}
