### Get All States using Node.js Source: https://docs.bridgecard.co/reference/api-reference/misc This Node.js example shows how to retrieve states by making a GET request. Remember to include your API token in the 'token' header. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cardholder/get_all_states?country=Nigeria', 'headers': { 'accept': 'application/json', 'token': 'Bearer at_live_****' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Fetch Card Balance using Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example uses the 'request' library to get the card balance. Remember to replace '*****' with your token. ```javascript 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); }); ``` -------------------------------- ### Get FX Rate using Node.js Source: https://docs.bridgecard.co/reference/api-reference/misc This Node.js example shows how to retrieve FX rates. Remember to substitute 'xxxxx' with your authentication token. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/cards/fx-rate', 'headers': { 'accept': 'application/json', 'token': 'Bearer xxxxx' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get All Cardholder Cards using Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example shows how to fetch all cards for a cardholder using the 'request' module. Remember to substitute '*****' with your token. ```javascript 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); }); ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.bridgecard.co/reference/api-reference/misc Perform an HTTP GET request to the current page URL with the `ask` query parameter to ask a question. The question should be specific and self-contained. The response will contain a direct answer and relevant excerpts from the documentation. ```http GET https://docs.bridgecard.co/reference/api-reference/misc.md?ask= ``` -------------------------------- ### Get Card Transactions with Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example demonstrates how to retrieve card transactions using the `request` module. Make sure to install the `request` package. ```javascript 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); }); ``` -------------------------------- ### Get All States using Go Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program demonstrates how to make an HTTP GET request to retrieve states. The API token must be included in the 'token' header for authentication. ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cardholder/get_all_states?country=Nigeria" method := "GET" 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)) } ``` -------------------------------- ### Get Card Details using Token (Go) Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program demonstrates how to fetch card details by making an HTTP GET request with a token. It includes error handling for the request and response processing. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards-api-bridgecard-co.relay.evervault.com/v1/issuing/cards/get_card_details_from_token?token=6419a7034aa44f1c886a2ade32a97436" method := "GET" payload := strings.NewReader(``) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } 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)) } ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.bridgecard.co/reference To get information not explicitly present on a page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.bridgecard.co/reference.md?ask= ``` -------------------------------- ### Querying Documentation with `ask` Parameter Source: https://docs.bridgecard.co/reference/api-reference/webhook-events To get additional information not explicitly on the page, perform an HTTP GET request with the `ask` query parameter. The question should be specific and self-contained. ```http GET https://docs.bridgecard.co/reference/api-reference/webhook-events.md?ask= ``` -------------------------------- ### Get Issuing Wallet Balance with Go Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program shows how to make a GET request to retrieve the issuing wallet balance. Update '*****' with your token. ```Go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_issuing_wallet_balance" 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)) } ``` -------------------------------- ### Query Documentation with `ask` Parameter Source: https://docs.bridgecard.co/introduction To get additional information not directly present on the page, perform an HTTP GET request to the current page URL and include the `ask` query parameter with your specific question. ```http GET https://docs.bridgecard.co/introduction.md?ask= ``` -------------------------------- ### Get Card Transactions with Go Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Go program demonstrates how to make an HTTP GET request to retrieve card transactions. It includes necessary imports for HTTP requests and I/O operations. ```go 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)) } ``` -------------------------------- ### Querying Documentation with 'ask' Parameter Source: https://docs.bridgecard.co/reference/api-reference/potential-spend-notification-beta To get additional information not directly on the page, you can query the documentation dynamically. Perform an HTTP GET request to the page URL with the 'ask' query parameter, followed by your specific question. ```http GET https://docs.bridgecard.co/reference/api-reference/potential-spend-notification-beta.md?ask= ``` -------------------------------- ### Unfreeze Card using Node.js Source: https://docs.bridgecard.co/reference/api-reference/naira-cards This Node.js example shows how to unfreeze a card. Remember to replace '*****' with your valid token. ```javascript var request = require('request'); var options = { 'method': 'PATCH', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/naira_cards/unfreeze_card?card_id=3d0220250f6b4addbfef1c5ffa39250b', 'headers': { 'token': 'Bearer *****' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Fund Issuing Wallet with Node.js Source: https://docs.bridgecard.co/reference/api-reference/misc This Node.js example shows how to fund your issuing wallet. Remember to replace '*****' with your token. ```javascript var request = require('request'); var options = { 'method': 'PATCH', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_issuing_wallet?currency=NGNorUSD', 'headers': { 'token': 'Bearer *****', 'Content-Type': 'application/json' }, body: JSON.stringify({ "amount": "0", "currency": "NGN or USD" }) }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Fetch Card Details using Go Source: https://docs.bridgecard.co/reference/api-reference/naira-cards This Go program demonstrates fetching card details. It uses the standard net/http package. Remember to replace '*****' with your token. ```go 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 Cardholder Details using Node.js Source: https://docs.bridgecard.co/reference/api-reference/cardholder This Node.js example retrieves cardholder details using the 'request' module. Ensure you have the module installed and replace 'Bearer xxxxx' with your token and the cardholder ID with a valid one. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cardholder/get_cardholder?cardholder_id=e416a9a188af40b78b8afd740e835d68', 'headers': { 'token': 'Bearer xxxxx' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get Card Transaction by Transaction ID Source: https://docs.bridgecard.co/reference/api-reference/usd-cards 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. ```APIDOC ## GET /v1/issuing/sandbox/cards/get_card_transaction_by_id ### Description Retrieves a specific card transaction using its unique identifier. This endpoint supports querying by either the `client_transaction_reference` or the `bridgecard_transaction_reference`. ### Method GET ### Endpoint `https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_card_transaction_by_id` ### Query Parameters - **card_id** (string) - Required - The unique identifier of the card. - **client_transaction_reference** (string) - Required - The client-defined reference for the transaction. - **bridgecard_transaction_reference** (string) - Optional - The Bridgecard-generated reference for the transaction. ### Headers - **token** (string) - Required - Bearer token for authentication. ### Request Example ```bash 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 *****' ``` ### Response #### Success Response (200) Returns the details of the requested card transaction. - **status** (string) - Indicates the status of the operation (e.g., "success"). - **message** (string) - A message describing the result of the operation. - **data** (object) - Contains the transaction details: - **amount** (string) - The transaction amount. - **bridgecard_transaction_reference** (string) - The Bridgecard transaction reference. - **card_id** (string) - The ID of the card associated with the transaction. - **card_transaction_type** (string) - The type of the transaction (e.g., "DEBIT"). - **cardholder_id** (string) - The ID of the cardholder. - **client_transaction_reference** (string) - The client-defined transaction reference. - **currency** (string) - The currency of the transaction. - **description** (string) - A description of the transaction. - **issuing_app_id** (string) - The ID of the issuing application. - **livemode** (boolean) - Indicates if the transaction is in live mode. - **transaction_date** (string) - The date and time of the transaction. - **transaction_timestamp** (integer) - The Unix timestamp of the transaction. - **merchant_category_code** (string) - The merchant category code (can be null). #### Response Example (200) ```json { "status": "success", "message": "Card transaction history was fetched successfully", "data": { "amount": "0", "bridgecard_transaction_reference": "7832a4d6371e4643aba4aa1f3c7030ab", "card_id": "70b34986c13c4026a9c1607e27eabc49", "card_transaction_type": "DEBIT", "cardholder_id": "d0658fedf8284207866d961e4a7083fa", "client_transaction_reference": "5c3598c8152446ba8093d058d8b59a1e", "currency": "USD", "description": "Apple Inc. US", "issuing_app_id": "842352f4-8a6f-4a19-89c6-4e8a240a2355", "livemode": false, "transaction_date": "2022-08-08 02:48:15", "transaction_timestamp": 1659923295, "merchant_category_code": "123478" } } ``` #### Error Response (400) Returned when the provided `card_id` is invalid. - **message** (string) - An error message indicating the issue. #### Response Example (400) ```json { "message": "Invalid card ID, there's no card with this ID." } ``` ``` -------------------------------- ### Query Documentation with `ask` Parameter Source: https://docs.bridgecard.co/reference/api-reference Perform an HTTP GET request to query the documentation dynamically. Use this when the answer is not explicitly present, you need clarification, or want to retrieve related documentation sections. ```http GET https://docs.bridgecard.co/reference/api-reference.md?ask= ``` -------------------------------- ### Fund Card Asynchronously with Go Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Go program shows how to fund a card asynchronously. It uses the standard net/http package. Ensure your token is valid and the issuing wallet is funded in the sandbox. ```go 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)) } ``` -------------------------------- ### Get All Issued Cards (Node.js) Source: https://docs.bridgecard.co/reference/api-reference/misc This Node.js example demonstrates how to retrieve all issued cards using the 'request' module. Remember to substitute '*****' with your token. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cards?page=1', 'headers': { 'token': 'Bearer *****' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get Naira Card Balance (Go) Source: https://docs.bridgecard.co/reference/api-reference/naira-cards This Go program demonstrates how to fetch a Naira card's balance using the standard net/http package. It constructs the request, adds headers, and prints the response body. ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/naira_cards/get_card_balance?cardholder_id=12jjh2h2bcasdsjhds8s7ssd" method := "GET" 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 *******") 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 Issuing Wallet with Go Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program demonstrates how to fund your issuing wallet. It includes necessary imports and error handling. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_issuing_wallet?currency=NGNorUSD" method := "PATCH" payload := strings.NewReader(`{ "amount": "0" }`) 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 FX Rate using PHP Source: https://docs.bridgecard.co/reference/api-reference/misc This PHP script fetches FX rates. Ensure you have the HTTP_Request2 library installed and replace 'xxxxx' with your token. ```php setUrl('https://issuecards.api.bridgecard.co/v1/issuing/cards/fx-rate'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $request->setHeader(array( 'accept' => 'application/json', 'token' => 'Bearer xxxxx' )); 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(); } ``` -------------------------------- ### Get All Cardholder Cards using Go Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Go program demonstrates how to fetch all cards for a cardholder. Replace '*****' with your authentication token. ```go 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)) } ``` -------------------------------- ### Migrate Card using Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example shows how to migrate a card using the 'request' library. Ensure your token is correctly set in the headers. The PIN is optional. ```javascript 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); }); ``` -------------------------------- ### Get Card Details Response Source: https://docs.bridgecard.co/reference/api-reference/naira-cards Example of a successful response when retrieving card details. It includes sensitive information like expiry dates and metadata. ```json { "expiry_month": "ev:RFVC:f24e5mMw/sVAQxtl:AgQHRjIQa7BzqhGXYuZwV/lXqiTb8Uq07nBYWWbuu46I:i05HSrBrHf2hKfn0cUDTcYnX:$", "expiry_year": "ev:RFVC:2b0lTiBTfLcht3ju:AgQHRjIQa7BzqhGXYuZwV/lXqiTb8Uq07nBYWWbuu46I:JtZ1xVK3hJnFrW+sMjC1P7BP2LY:$", "is_active": true, "issuing_app_id": "842352f4-8a6f-4a19-89c6-4e8a240a2355", "last_4": "8649", "livemode": false, "meta_data": { "user_id": "d0658fedf8284207866d961e4a7083fa" }, "balance": "0", "blocked_due_due_to_fraud": false, "pin_3ds_activated": true } } ``` -------------------------------- ### Get Issuing Wallet Balance with Node.js Source: https://docs.bridgecard.co/reference/api-reference/misc This Node.js example uses the 'request' module to retrieve the issuing wallet balance. Remember to replace '*****' with your token. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_issuing_wallet_balance', 'headers': { 'token': 'Bearer *****' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get Card Transactions with Python Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Python script uses the `requests` library to fetch transactions for a given card ID and page. Ensure you have the `requests` library installed. ```Python 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) ``` -------------------------------- ### Get Card Details Response Source: https://docs.bridgecard.co/reference/api-reference/usd-cards Example of a successful response when retrieving card details. It includes sensitive information like CVV and expiry, alongside card status and balance. ```json { "cvv": "ev:RFVC:b9Qu3KGE+LBIhZEo:AgQHRjIQa7BzqhGXYuZwV/lXqiTb8Uq07nBYWWbuu46I:BJhJBGa/87QT8YCCLoCWvh9STg:$", "expiry_month": "ev:RFVC:f24e5mMw/sVAQxtl:AgQHRjIQa7BzqhGXYuZwV/lXqiTb8Uq07nBYWWbuu46I:i05HSrBrHf2hKfn0cUDTcYnX:$", "expiry_year": "ev:RFVC:2b0lTiBTfLcht3ju:AgQHRjIQa7BzqhGXYuZwV/lXqiTb8Uq07nBYWWbuu46I:JtZ1xVK3hJnFrW+sMjC1P7BP2LY:$", "is_active": true, "is_deleted": false, "issuing_app_id": "842352f4-8a6f-4a19-89c6-4e8a240a2355", "last_4": "8649", "livemode": false, "meta_data": { "user_id": "d0658fedf8284207866d961e4a7083fa" }, "balance": "900", "available_balance": "600", "book_balance": "900", "blocked_due_to_fraud": false, "pin_3ds_activated": true } ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://docs.bridgecard.co/introduction/definitions Perform an HTTP GET request to query the documentation dynamically. Use the 'ask' query parameter with a specific, natural language question. ```http GET https://docs.bridgecard.co/introduction/definitions.md?ask= ``` -------------------------------- ### Fund Naira Card using Go Source: https://docs.bridgecard.co/reference/api-reference/naira-cards Go program to fund a Naira card. This example demonstrates making an HTTP POST request with the necessary headers and payload. Ensure your token is valid. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/naira_cards/fund_naira_card" method := "POST" payload := strings.NewReader(`{`+" "+` "card_id": "dsjdg7d8s7d78s8auhdskd",`+" "+` "amount": "100",`+" "+` "transaction_reference": "473783839939393030"`+" "+` }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("accept", "application/json") req.Header.Add("token", "sdssda") 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 Transaction Status using Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example demonstrates how to check a card transaction's status using the `request` library. Remember to substitute '*****' with your valid token. ```javascript 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); }); ``` -------------------------------- ### Fund Card Asynchronously with Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example shows how to fund a card asynchronously. It uses the 'request' library. Ensure your token is valid and the issuing wallet is funded in the sandbox. ```javascript 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); }); ``` -------------------------------- ### Get Naira Card Balance (NodeJS) Source: https://docs.bridgecard.co/reference/api-reference/naira-cards This NodeJS example demonstrates how to retrieve a Naira card's balance using the 'request' module. It configures the request method, URL, and headers. ```javascript var request = require('request'); var options = { 'method': 'GET', 'url': 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/naira_cards/get_card_balance?cardholder_id=12jjh2h2bcasdsjhds8s7ssd', 'headers': { 'accept': 'application/json', 'token': 'Bearer *******' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); }); ``` -------------------------------- ### Get Card Transaction by ID using Node.js Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Node.js example shows how to retrieve a card transaction using the `request` module. It configures the request method, URL, and headers, including the authorization token. ```javascript 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); }); ``` -------------------------------- ### Migrate Card using Go Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Go program demonstrates migrating a card. It constructs an HTTP POST request with the required headers and payload. The PIN is optional. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/migrate_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)) } ``` -------------------------------- ### Get Card Details using Token (PHP) Source: https://docs.bridgecard.co/reference/api-reference/misc Use this snippet to retrieve card details by providing a token in the URL. Ensure the HTTP_Request2 library is installed. Handles successful responses and potential request exceptions. ```php $request->setUrl('https://issuecards-api-bridgecard-co.relay.evervault.com/v1/issuing/cards/get_card_details_from_token?token=6419a7034aa44f1c886a2ade32a97436'); $request->setMethod(HTTP_Request2::METHOD_GET); $request->setConfig(array( 'follow_redirects' => TRUE )); $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(); } ``` -------------------------------- ### Generate Card Token (Go) Source: https://docs.bridgecard.co/reference/api-reference/transaction-enrichment This Go program shows how to generate a token for card details. Replace 'at_live_xxxxx' with your API token. ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/cards/generate_token_for_card_details?card_id=b7fc2fa1f2249e2ff" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("token", "Bearer at_live_xxxxx") 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 States using cURL Source: https://docs.bridgecard.co/reference/api-reference/misc Use this cURL command to make a GET request to the Get All States endpoint. Ensure you replace 'at_live_****' with your actual token. ```bash curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cardholder/get_all_states?country=Nigeria' \ --header 'accept: application/json' \ --header 'token: Bearer at_live_****' ``` -------------------------------- ### Fetch Card Balance using Go Source: https://docs.bridgecard.co/reference/api-reference/usd-cards This Go program shows how to make an HTTP GET request to retrieve card balance information. It includes error handling for the request and response. ```go 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 Issuing Wallet with Python Source: https://docs.bridgecard.co/reference/api-reference/misc This Python script demonstrates how to fund your issuing wallet using the requests library. Replace '*****' with your token. ```python import requests import json url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/fund_issuing_wallet?currency=NGNorUSD" payload = json.dumps({ "amount": "0" }) headers = { 'token': 'Bearer *****', 'Content-Type': 'application/json' } response = requests.request("PATCH", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### Get All Issued Cards (Python) Source: https://docs.bridgecard.co/reference/api-reference/misc This Python script uses the requests library to get all issued cards. Replace '*****' with your Bearer token. ```python import requests url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cards?page=1" payload = "" headers = { 'token': 'Bearer *****' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### Generate Card Token for Card Details (Go) Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program demonstrates how to make an API request to generate a token for retrieving card details. It includes necessary imports for HTTP requests and string manipulation. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/cards/generate_token_for_card_details?card_id=38f18939933303039393" 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)) } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.bridgecard.co/introduction/card-products Perform an HTTP GET request to query the documentation dynamically. Use this when the answer is not explicitly present, for clarification, or to retrieve related documentation sections. ```http GET https://docs.bridgecard.co/introduction/card-products.md?ask= ``` -------------------------------- ### Install AES-Anywhere Package Source: https://docs.bridgecard.co/reference/api-reference/naira-cards Install the AES-Anywhere package using pip. This package is used for encrypting the card PIN before API calls. ```bash $ pip install aes-everywhere ``` -------------------------------- ### Get Card Transactions with cURL Source: https://docs.bridgecard.co/reference/api-reference/usd-cards Use this cURL command to make a GET request to retrieve transactions for a specific card ID and page. ```cURL 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 '' ``` -------------------------------- ### Issuing_account_topup.successful Webhook Example Source: https://docs.bridgecard.co/reference/api-reference/webhook-events This webhook is triggered after a successful top-up to your issuing wallet. It contains information about the environment, issuing application ID, and the amount that was topped up. ```json { "environment": “production”, "issuing_app_id": “9ujinoncpsni3943198393939930ke", "data": { "event": "issuing_account_topup.successful", "data": { "amount_topped_up_in_cents": 200 }, }, } ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.bridgecard.co/reference/api-reference/rate-limit Perform an HTTP GET request to the current page URL with the `ask` query parameter to retrieve additional information not directly present on the page. The question should be specific and self-contained. ```http GET https://docs.bridgecard.co/reference/api-reference/rate-limit.md?ask= ``` -------------------------------- ### Get Issuing Wallet Balance with Python Source: https://docs.bridgecard.co/reference/api-reference/misc This Python script uses the 'requests' library to get the issuing wallet balance. Replace '*****' with your token. ```Python import requests url = "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_issuing_wallet_balance" payload = "" headers = { 'token': 'Bearer *****' } response = requests.request("GET", url, headers=headers, data=payload) print(response.text) ``` -------------------------------- ### Get All Issued Cards (Go) Source: https://docs.bridgecard.co/reference/api-reference/misc This Go program retrieves all issued cards. It makes a GET request to the API endpoint, requiring your token to be inserted in place of '*****'. ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://issuecards.api.bridgecard.co/v1/issuing/sandbox/cards/get_all_cards?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)) } ``` -------------------------------- ### Get FX Rate using cURL Source: https://docs.bridgecard.co/reference/api-reference/misc Use this cURL command to make a GET request to the FX rate endpoint. Ensure you replace 'xxxxx' with your actual token. ```bash curl --location --request GET 'https://issuecards.api.bridgecard.co/v1/issuing/cards/fx-rate' \ --header 'accept: application/json' \ --header 'token: Bearer xxxxx' ```