> For a complete page index, fetch https://docs.transak.com/llms.txt # Get Saved Cards GET https://api-gateway-stg.transak.com/api/v2/payment-instrument/status The **Get Saved Cards** is an **authenticated API** that retrieves the user's saved credit/debit cards. Reference: https://docs.transak.com/api/whitelabel/payments/headless-cards/get-saved-cards ## Request ### Query parameters - `paymentInstrumentId` (string, required) — Payment instrument identifier. Only `credit_debit_card` is supported for retrieving saved cards. ### Headers - `x-user-ip` (string, required) — End user's originating IP. More details [here](/guides/mandatory-security-changes#user-ip-header-in-apis) - `x-api-key` (string, required) — Partner API Key present in Transak Dashboard. - `authorization` (string, optional) — Authorization token is the accessToken received from the API -` api/v2/auth/verify` Note: This is not applicable for [Auth Reliance Flows](/features/auth-reliance) - `x-user-identifier` (string, optional) — Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) - `x-access-token` (string, optional) — Your Partner Access Token. Please refer [here](/guides/how-to-create-partner-access-token) for a tutorial on generating your access token. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) ## Response ### 200 200 - Success - `data` (ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaData, required) ## Errors ### 401 Unauthorized Error 401 - Unauthorized - `error` (ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaError, required) ### 500 Internal Server Error 500 - Internal Server Error - `error` (ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaError, required) ## Types ### ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaData - `paymentInstruments` (ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstruments, required) ### ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaError - `statusCode` (integer, required) - `message` (string, required) ### ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstruments - `credit_debit_card` (ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstrumentsCreditDebitCard, optional) ### ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstrumentsCreditDebitCard - `cards` (list of ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstrumentsCreditDebitCardCardsItems, required) ### ApiV2PaymentInstrumentStatusGetResponsesContentApplicationJsonSchemaDataPaymentInstrumentsCreditDebitCardCardsItems - `paymentIdentifierId` (string, optional) - `bin` (string, optional) - `last4` (string, optional) - `scheme` (string, optional) - `expiryMonth` (integer, optional) - `expiryYear` (integer, optional) ## Examples **Response** ```json { "data": { "paymentInstruments": { "credit_debit_card": { "cards": [ { "paymentIdentifierId": "6a3bb239134657c1abdc245d", "bin": "48003376", "last4": "5182", "scheme": "VISA", "expiryMonth": 10, "expiryYear": 2033 } ] } } } } ``` **SDK Code** ```python Success import requests url = "https://api-gateway-stg.transak.com/api/v2/payment-instrument/status" querystring = {"paymentInstrumentId":"credit_debit_card"} headers = { "x-api-key": "", "x-user-ip": "" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Success const url = 'https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card'; const options = {method: 'GET', headers: {'x-api-key': '', 'x-user-ip': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") req.Header.Add("x-user-ip", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' request["x-user-ip"] = '' response = http.request(request) puts response.read_body ``` ```java Success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card") .header("x-api-key", "") .header("x-user-ip", "") .asString(); ``` ```php Success request('GET', 'https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card', [ 'headers' => [ 'x-api-key' => '', 'x-user-ip' => '', ], ]); echo $response->getBody(); ``` ```csharp Success using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card"); var request = new RestRequest(Method.GET); request.AddHeader("x-api-key", ""); request.AddHeader("x-user-ip", ""); IRestResponse response = client.Execute(request); ``` ```swift Success import Foundation let headers = [ "x-api-key": "", "x-user-ip": "" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/payment-instrument/status?paymentInstrumentId=credit_debit_card")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```