USD Cards
All the APIs to issue and manage a card
This documentation explains how you can issue USD cards to your customers, your customers can make payments worth $5,000 or $10,000 monthly (depending on the card's limit) using this card. We'll also be assuming that you have finished the integration process of creating a cardholder to continue this implementation.
Create a card
Use this endpoint to create a card for a verified cardholder.
In the sandbox environment, you'll need to fund your sandbox-issuing wallet before you'll be able to create a card or fund one. You can use this endpoint to fund your issuing wallet with some large amount that can cover you through your test.
Mastercard Cards
The Mastercard product also has two card limits, $5,000 and $10,000. To create a card with a $5,000 limit you must pre-fund the card at creation with at least $3 and to create a card with a limit of $10,000 you'll need to fund the card with at least $4 at creation.
These minimum funds are held down and will be used to pay the card's Monthly maintenance fee in subsequent months.
If the customer doesn't doesn't do a transaction for three months the card eventually gets deleted and the get card details data carries an is_deleted value of true. Before a card gets deleted we send a webhook notification some days before to remind the user to fund his card to avoid deletion
The cards are also PIN-secured cards, so the user has to select a PIN on their card at the point of card creation. If you send an empty pin field the card's pin is defaulted to the 7th and 10th digit of the card PAN number.
The pin value in the create card payload must be 4 digits and encrypted before passing it as a parameter to call the API, we use an open-source package called AES-Anywhere for this. The encryption key is the live or test secret key for your account, you can find these keys on the homepage of your dashboard.
See Examples Below
$ pip install aes-everywhere
from AesEverywhere import aes256
# encryption
encrypted = aes256.encrypt('4 digit pin', 'Bridgecard Secret Key')
encrypted = encrypted.decode()
print(encrypted)
$ npm install aes-everywhere
var AES256 = require('aes-everywhere');
// or
// import AES256 from 'aes-everywhere';
// encryption
var encrypted = AES256.encrypt('4 digit pin', 'Bridgecard Secret Key')
console.log(encrypted);$ composer require mervick/aes-everywhere
require '../../vendor/mervick/aes-everywhere/php/src/AES256.php';
use mervick\aesEverywhere\AES256;
$encrypt = AES256::encrypt('4 digit pin', 'Bridgecard Secret Key')
import "github.com/mervick/aes-everywhere/go/aes256"
// encryption
encrypted := aes256.Encrypt("4 digit pin", "Bridgecard Secret Key")Now that you have the encrypted PIN you can go ahead to call the API below
curl --location --request POST 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card' \
--header 'token: Bearer *****' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual" || "physical",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_limit": "500000" || "1000000",
"transaction_reference:"",
"funding_amount": "300",
"pin" : "39sksksie3902023020dj03020203039",
"meta_data": {"user_id": "d0658fedf828420786e4a7083fa"}
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card"
payload = json.dumps({
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_limit": "500000" || "1000000",
"funding_amount": "300",
"pin" : "39sksksie3902023020dj03020203039",
"transaction_reference":"",
"meta_data": {
"user_id": "d0658fedf828420786e4a7083fa"
}
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_limit": "500000" || "1000000",
"transaction_reference":"",
"funding_amount": "300",
"pin" : "39sksksie3902023020dj03020203039",
"meta_data": {
"user_id": "d0658fedf828420786e4a7083fa"
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "cardholder_id": "d0658fedf8284207866d96183fa",\n "card_type": "virtual",\n "card_brand": "Mastercard",\n "card_currency": "USD",\n "card_limit": "500000" || "1000000",\n "pin" : "39sksksie3902023020dj03020203039",\n "funding_amount": "300",\n "meta_data": {"user_id": "d0658fedf828420786e4a7083fa"}\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card"
method := "POST"
payload := strings.NewReader(`{
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_limit": "500000" || "1000000",
"funding_amount": "300",
"transaction_reference":"",
"pin" : "39sksksie3902023020dj03020203039",
"meta_data": {"user_id": "d0658fedf828420786e4a7083fa"}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Activate Physical Dollar Card
Note: Only for physical USD cards.
Use this endpoint to activate a physical card for a verified cardholder.
curl --location --request POST 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/activate_physical_card' \
--header 'token: Bearer *****' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardholder_id": "37383839939030",
"card_type": "physical",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_token_number": "37383839939030",
"meta_data": {}
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/activate_physical_card"
payload = json.dumps({
"cardholder_id": "37383839939030",
"card_type": "physical",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_token_number": "37383839939030",
"meta_data": {}
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/activate_physical_card',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"cardholder_id": "37383839939030",
"card_type": "physical",
"card_brand": "Mastercard",
"card_currency": "USD",
"card_token_number": "37383839939030",
"meta_data": {}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
pyth<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/activate_physical_card');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "cardholder_id": "d0658fedf8284207866d96183fa",\n "card_type": "physical",\n "card_brand": "Mastercard",\n "card_currency": "USD",\n "card_token_number: "38393030303030" \n"meta_data": {"user_id": "d0658fedf828420786e4a7083fa"}\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/activate_physical_card"
method := "POST"
payload := strings.NewReader(`{
"cardholder_id": "37383839939030",
"card_type": "physical",
"card_brand": "Mastercard",
"card_currency": "USD",
"
": "37383839939030",
"meta_data": {}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Get card details
Use this endpoint to fetch the details for a card you created.
Because a card's data contains sensitive information like the card number, CVV, and expiry date the details are encrypted when they're sent over to you but are decrypted automatically when they get to your server.
We strongly advise that you do not store the card data on your server except if you're PCI-DSS certified.
We have provided you with two endpoints to keep you compliant.
Use these endpoints below when the user doesn't really need to see the card details, for example in a screen where you show them the list of cards they have, or where you display general information about the card like the last 4 digits etc.
sandbox: http://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details
production: http://issuecards.api.bridgecard.co/v1/issuing/cards/get_card_details
You can also use this other endpoint when you need to display the card details to the user may be at the point when they need to make a payment or when they click the view card details button on your app
sandbox:
https://issuecards-api-bridgecard-co.relay.evervault.com/v1/issuing/sandbox/cards/get_card_details
production:
https://issuecards-api-bridgecard-co.relay.evervault.com/v1/issuing/cards/get_card_details
We rate limit this endpoint once every 3 seconds for a specific card_id(get_card_details)
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details?card_id=216ef11a58bf468baeb9cdbb97777777' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details?card_id=216ef11a58bf468baeb9cdbb97777777"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details?card_id=216ef11a58bf468baeb9cdbb97777777',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details?card_id=216ef11a58bf468baeb9cdbb97777777');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_details?card_id=216ef11a58bf468baeb9cdbb97777777"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Get card balance
Use this API to fetch the balance of a card. We provide you with 3 balances for each card when you call this API. A. Balance: This is the total amount on a card, which includes the maintenance fee held and the amount available to spend for transactions. B. Book Balance: This balance is the same as the "BALANCE" field explained above. c. Available Balance: This is the total amount available for the user to spend and also unload from their card, it's the "BALANCE" minus the card's monthly maintenance fee held.
We rate limit this endpoint once every 3 seconds for a specific card_id(get_card_balance)
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_balance?card_id=216ef11a999f468baeb9cdbb94765865' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_balance?card_id=216ef11a58bf468baeb9cdbb94765865"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_balance?card_id=216ef11a58bf468baeb9cdbb94765865',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_balance?card_id=216ef11a58bf468baeb9cdbb94765865');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_balance?card_id=216ef11a58bf468baeb9cdbb94765865"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Fund card
You can use this endpoint to fund a card.
PS: In the sandbox environment, you'll need to fund your sandbox-issuing wallet before you can create a card or fund one. You can use this endpoint to fund your issuing wallet with some large amount that can cover you through your test.
We rate limit this endpoint once every 5 mins for a specific card_id(fund_card)
curl --location --request PATCH 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_card_asynchronously' \
--header 'token: Bearer *****' \
--header 'Content-Type: application/json' \
--data-raw '{
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "100",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765865",
"currency": "USD"
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_card_asynchronously"
payload = json.dumps({
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "100",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765865",
"currency": "USD"
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_card_asynchronously',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "100",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765865",
"currency": "USD"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_card_asynchronously');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "card_id": "216ef11a58bf468baeb9cdbb94765865",\n "amount": "100",\n "transaction_reference": "216ef11a58bf468baeb9cdbb94765865",\n "currency": "USD"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_card_asynchronously"
method := "PATCH"
payload := strings.NewReader(`{
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "100",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765865",
"currency": "USD"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Unload a card
This endpoint allows you to withdraw funds from a card.
We rate limit this endpoint once every 5 mins for a specific card_id(unload_card)
curl --location --request PATCH 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unload_card_asynchronously' \
--header 'token: Bearer ****' \
--header 'Content-Type: application/json' \
--data-raw '{
"card_id": "216ef11a58bf468baeb9cdbb965",
"amount": "0",
"transaction_reference": "216ef11a58bf468baeb9cdbb965",
"currency": "USD"
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unload_card_asynchronously"
payload = json.dumps({
"card_id": "216ef11a58bf468baeb9cdbb965",
"amount": "0",
"transaction_reference": "216ef11a58bf468baeb9cdbb965",
"currency": "USD"
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unload_card_asynchronously',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "0",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765111",
"currency": "USD"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unload_card_asynchronously');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "card_id": "216ef11a58bf468baeb9cdbb999030",\n "amount": "0",\n "transaction_reference": "216ef11a58bf468baeb9cdbb94765111",\n "currency": "USD"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unload_card_asynchronously"
method := "PATCH"
payload := strings.NewReader(`{
"card_id": "216ef11a58bf468baeb9cdbb94765865",
"amount": "100",
"transaction_reference": "216ef11a58bf468baeb9cdbb94765865",
"currency": "USD"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Mock a debit transaction
You can use this endpoint to create a debit transaction on a card in the sandbox environment to see how a purchase will look.
curl --location --request PATCH 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/mock_debit_transaction' \
--header 'token: Bearer ****' \
--header 'Content-Type: application/json' \
--data-raw '{
"card_id": "216ef11a58bf468baeb9cdbb965"
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/mock_debit_transaction"
payload = json.dumps({
"card_id": "216ef11a58bf468baeb9cdbb965"
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/mock_debit_transaction',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"card_id": "216ef11a58bf468baeb9cdbb94765865"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/mock_debit_transaction');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "card_id": "216ef11a58bf468baeb9cdbb999030"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/mock_debit_transaction"
method := "PATCH"
payload := strings.NewReader(`{
"card_id": "216ef11a58bf468baeb9cdbb94765865"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Get card transactions
Use this endpoint to get all the transactions on a card.
Please note that all transactions are reported in the GMT time zone and you'll need to convert it to your own time zone if this is not your time zone.
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transactions?card_id=70b34986c13c4026a9c1607e27eabc49&page=1' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transactions?card_id=70b34986c13c4026a9c1607e27eabc49&page=1"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transactions?card_id=70b34986c13c4026a9c1607e27eabc49&page=1',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transactions?card_id=70b34986c13c4026a9c1607e27eabc49&page=1');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transactions?card_id=70b34986c13c4026a9c1607e27eabc49&page=1"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}We provide transaction enrichment for all card transactions, you can use this feature to improve the user experience on your app. Read more here.
We rate limit this endpoint once every 3 seconds for a specific card_id and a unique page(get_card_transaction_history)
Get card transaction by transaction ID
You can use this endpoint to get a specific transaction by the client_transaction_reference from a list of transactions on a card. If the transaction reference originates from Bridgecard (for example in the case of a debit transactions), you can use the bridgecard_transaction_reference instead.
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Get card transaction status
You can use this endpoint to verify the status of a transaction whether funding or unloading. This way you can know if the transaction is still pending or is successful.
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_status?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_status?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_status?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_status?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_status?card_id=70b34986c13c4026a9c1607e27eabc49&client_transaction_reference=a7887279b"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Freeze card
This endpoint allows your users to freeze their card. After freezing a card the is_active field in the get card details endpoint is immediately updated to False.
curl --location --request PATCH 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/freeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/freeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/freeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/freeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/freeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b"
method := "PATCH"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Unfreeze card
This endpoint allows your users to unfreeze their card. When you unfreeze a card the is_active field in the get card details endpoint is immediately updated to True.
curl --location --request PATCH 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b' \
--header 'token: Bearer *****' \
--data-raw ''
import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b');
$request->setMethod('PATCH');
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b"
method := "PATCH"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Get all cardholder cards
This endpoint returns all the cards assigned to a cardholder in a list.
curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cardholder_cards?cardholder_id=d0658fedf82861e4a7083fa' \
--header 'token: Bearer *****' \
--data-raw ''import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cardholder_cards?cardholder_id=d0658fedf82861e4a7083fa"
payload = ""
headers = {
'token': 'Bearer *****'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cardholder_cards?cardholder_id=d0658fedf82861e4a7083fa',
'headers': {
'token': 'Bearer *****'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cardholder_cards?cardholder_id=d0658fedf82861e4a7083fa');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cardholder_cards?cardholder_id=d0658fedf82861e4a7083fa"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Delete a card
This endpoint allows you to delete a card and unassign it from a cardholder. Please note that before you delete a card you'll need to unload the card first so that you don't lose the funds on the card.
curl --location --request DELETE 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/delete_card/44faae6059834696b2ad9eecc94ca955' \
--header 'accept: application/json' \
--header 'token: Bearer at_live_***'import requests
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/delete_card/44faae6059834696b2ad9eecc94ca955"
payload = {}
headers = {
'accept': 'application/json',
'token': 'Bearer at_live_***'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/delete_card/44faae6059834696b2ad9eecc94ca955',
'headers': {
'accept': 'application/json',
'token': 'Bearer at_live_***'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/delete_card/44faae6059834696b2ad9eecc94ca955');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'accept' => 'application/json',
'token' => 'Bearer at_live_***'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/delete_card/44faae6059834696b2ad9eecc94ca955"
method := "DELETE"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("accept", "application/json")
req.Header.Add("token", "Bearer at_live_***")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Migrate a card (Deprecated )
This endpoint allows you to migrate a card across our supported card brands i.e from Visa to Mastercard. We automatically default your users card pin to the 7th to 10th characters of your their card number if you don't send a PIN field in the API call.
curl --location --request POST 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/migrate_card' \
--header 'token: Bearer *****' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_id": "d0658feddddf8284207866d96183fa",
"card_type": "virtual" || "physical",
"target_card_brand": "Mastercard",
"target_card_currency": "USD",
"card_limit": "500000" || "1000000",
"pin" : "39sksksie3902023020dj03020203039",
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/migrate_card"
payload = json.dumps({
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"target_card_brand": "Mastercard",
"target_card_currency": "USD",
"card_limit": "500000" || "1000000",
"pin" : "39sksksie3902023020dj03020203039",
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/migrate_card',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"target_card_brand": "Mastercard",
"target_card_currency": "USD",
"card_limit": "500000" || "1000000",
"pin" : "39sksksie3902023020dj03020203039",
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/migrate_card');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "cardholder_id": "d0658fedf8284207866d96183fa",\n "card_id": "d0658fedf8284207866d96183fa",\n "card_type": "virtual",\n "target_card_brand": "Mastercard",\n "target_card_currency": "USD",\n "pin" : "39sksksie3902023020dj03020203039",\n}');
try {
$response = $request->send();
if ($response->getStatus() == 201) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/create_card"
method := "POST"
payload := strings.NewReader(`{
"cardholder_id": "d0658fedf8284207866d96183fa",
"card_id": "d0658fedf8284207866d96183fa",
"card_type": "virtual",
"target_card_brand": "Mastercard",
"target_card_currency": "USD",
"card_limit": "500000" || "1000000",
"pin" : "39sksksie3902023020dj03020203039",
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Update card pin
Use this endpoint to update the card pin, incase the user wants to change their pin at creation or if they forget it. The card pin should be encrypted before calling this API, we use an open-source package called AES-Anywhere for this. See Examples Below
$ pip install aes-everywhere
from AesEverywhere import aes256
# encryption
encrypted = aes256.encrypt('3d secure pin', 'Bridgecard Secret Key')
encrypted = encrypted.decode()
print(encrypted)
$ npm install aes-everywhere
var AES256 = require('aes-everywhere');
// or
// import AES256 from 'aes-everywhere';
// encryption
var encrypted = AES256.encrypt('3d secure pin', 'Bridgecard Secret Key')
console.log(encrypted);$ composer require mervick/aes-everywhere
require '../../vendor/mervick/aes-everywhere/php/src/AES256.php';
use mervick\aesEverywhere\AES256;
$encrypt = AES256::encrypt('3d secure pin', 'Bridgecard Secret Key')
import "github.com/mervick/aes-everywhere/go/aes256"
// encryption
encrypted := aes256.Encrypt("3d secure pin", "Bridgecard Secret Key")Then use the encrypted details to call the API below
curl --location --request POST 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/update_card_pin' \
--header 'token: Bearer *****' \
--header 'Content-Type: application/json' \
--data-raw '{
"card_id": "8389303030030c460e9250",
"card_pin": "encrypted pin"
}'import requests
import json
url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/set_3d_secure_pin"
payload = json.dumps({
"card_id": "8389303030030c460e9250",
"card_pin": "encrypted pin"
})
headers = {
'token': 'Bearer *****',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/set_3d_secure_pin',
'headers': {
'token': 'Bearer *****',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"card_id": "8389303030030c460e9250",
"card_pin": "encrypted pin"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
p<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/set_3d_secure_pin');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'token' => 'Bearer *****',
'Content-Type' => 'application/json'
));
$request->setBody('{\n "card_id": "8389303030030c460e9250",\n "card_pin": "encrypted pin"\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage(package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/set_3d_secure_pin"
method := "POST"
payload := strings.NewReader(`{
"card_id": "8389303030030c460e9250",
"card_pin": "encrypted pin"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("token", "Bearer *****")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}Managing Declines
A card that has up to 15 consecutive declines due to insufficient balance, would be deleted on the 15th decline. For each of the declines, we will send you this webhook event and the decline reason (decline_reason). In the case of these transactions will be "Insufficient balance to pay the merchant charge and transaction fee for this transaction, please top up your card and try again." If a card ends up being deleted because it violated this rule, you'll get this webhook event and the number of declines will reset every time the user funds the card.
A card that has a negative balance and another merchant or the same merchant processes another negative transaction to that same card, that card would also be deleted as well. If a card ends up being deleted because it violated this rule, you'll get this webhook event.
Last updated