Simulate PIN-debit balance inquiry
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry \
--header 'Content-Type: application/json' \
--data '
{
"card_token": "**CARD_TOKEN**"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry"
payload = { "card_token": "**CARD_TOKEN**" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({card_token: '**CARD_TOKEN**'})
};
fetch('https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'card_token' => '**CARD_TOKEN**'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry"
payload := strings.NewReader("{\n \"card_token\": \"**CARD_TOKEN**\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry")
.header("Content-Type", "application/json")
.body("{\n \"card_token\": \"**CARD_TOKEN**\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_token\": \"**CARD_TOKEN**\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"type": "pindebit.balanceinquiry",
"state": "CLEARED",
"token": "**PINDEBIT_BALANCEINQUIRY_TRANSACTION_TOKEN**",
"user_token": "**USER_TOKEN**",
"card_token": "**CARD_TOKEN**",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"created_time": "2025-02-22T18:08:39.000Z",
"user_transaction_time": "2025-02-22T18:08:39.000Z",
"settlement_date": "2025-02-22T00:00:00.000Z",
"amount": 0,
"request_amount": 0,
"gpa": {
"ledger_balance": 250,
"available_balance": 250
},
"currency_code": "USD",
"currency_conversion": {
"original_amount": 0,
"conversion_rate": 1,
"original_currency_code": "840"
},
"network": "VISA",
"subnetwork": "VISANETDEBIT",
"acquirer_fee_amount": 0,
"fraud": {
"network": {
"transaction_risk_score": 93,
"account_risk_score": "1"
}
},
"card_acceptor": {
"mid": "000000000011111",
"mcc": "6411",
"name": "Marqeta Storefront",
"city": "St. Petersburg",
"state": "FL",
"postal_code": "33705"
}
}
}{
"error_code": "<string>",
"error_message": "<string>"
}PIN-Debit
Simulate PIN-debit balance inquiry
Use this endpoint to simulate a balance inquiry via the card network.
POST
/
simulations
/
cardtransactions
/
pindebit.balanceinquiry
Simulate PIN-debit balance inquiry
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry \
--header 'Content-Type: application/json' \
--data '
{
"card_token": "**CARD_TOKEN**"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry"
payload = { "card_token": "**CARD_TOKEN**" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({card_token: '**CARD_TOKEN**'})
};
fetch('https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'card_token' => '**CARD_TOKEN**'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry"
payload := strings.NewReader("{\n \"card_token\": \"**CARD_TOKEN**\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry")
.header("Content-Type", "application/json")
.body("{\n \"card_token\": \"**CARD_TOKEN**\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/simulations/cardtransactions/pindebit.balanceinquiry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_token\": \"**CARD_TOKEN**\"\n}"
response = http.request(request)
puts response.read_body{
"transaction": {
"type": "pindebit.balanceinquiry",
"state": "CLEARED",
"token": "**PINDEBIT_BALANCEINQUIRY_TRANSACTION_TOKEN**",
"user_token": "**USER_TOKEN**",
"card_token": "**CARD_TOKEN**",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"created_time": "2025-02-22T18:08:39.000Z",
"user_transaction_time": "2025-02-22T18:08:39.000Z",
"settlement_date": "2025-02-22T00:00:00.000Z",
"amount": 0,
"request_amount": 0,
"gpa": {
"ledger_balance": 250,
"available_balance": 250
},
"currency_code": "USD",
"currency_conversion": {
"original_amount": 0,
"conversion_rate": 1,
"original_currency_code": "840"
},
"network": "VISA",
"subnetwork": "VISANETDEBIT",
"acquirer_fee_amount": 0,
"fraud": {
"network": {
"transaction_risk_score": 93,
"account_risk_score": "1"
}
},
"card_acceptor": {
"mid": "000000000011111",
"mcc": "6411",
"name": "Marqeta Storefront",
"city": "St. Petersburg",
"state": "FL",
"postal_code": "33705"
}
}
}{
"error_code": "<string>",
"error_message": "<string>"
}Use this endpoint to simulate a balance inquiry via the card network. This is a non-financial transaction.
You can view the full request body structure on the Simulations 2.0 — Card Transactions page.
Request body
See the full request body structure at Request body.Sample request body
JSON
{
"card_token": "**CARD_TOKEN**",
"account_type": "savings",
"card_acceptor": {
"mid": "11111",
"partial_approval_capable": "true"
},
"network": "VISA"
}
Response body
See Card Transaction Simulation Response.Sample response body
JSON
{
"transaction": {
"type": "pindebit.balanceinquiry",
"state": "CLEARED",
"token": "**PINDEBIT_BALANCEINQUIRY_TRANSACTION_TOKEN**",
"user_token": "**USER_TOKEN**",
"card_token": "**CARD_TOKEN**",
"response": {
"code": "0000",
"memo": "Approved or completed successfully"
},
"created_time": "2025-02-22T18:08:39Z",
"user_transaction_time": "2025-02-22T18:08:39Z",
"settlement_date": "2025-02-22T00:00:00Z",
"amount": 0,
"request_amount": 0,
"gpa": {
"ledger_balance": 250,
"available_balance": 250
},
"currency_code": "USD",
"currency_conversion": {
"original_amount": 0,
"conversion_rate": 1,
"original_currency_code": "840"
},
"network": "VISA",
"subnetwork": "VISANETDEBIT",
"acquirer_fee_amount": 0,
"fraud": {
"network": {
"transaction_risk_score": 93,
"account_risk_score": "1"
}
},
"card_acceptor": {
"mid": "000000000011111",
"mcc": "6411",
"name": "Marqeta Storefront",
"city": "St. Petersburg",
"state": "FL",
"postal_code": "33705"
}
}
}
Body
application/json
Response
Created
Contains information about the simulated transaction.
Contains information about the transaction.
Show child attributes
Show child attributes
Was this page helpful?