Simulate debit
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"account_number": "**ACCOUNT_NUMBER**",
"settlement_date": "2025-02-03T13:22:42Z"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit"
payload = {
"amount": 10,
"account_number": "**ACCOUNT_NUMBER**",
"settlement_date": "2025-02-03T13:22:42Z"
}
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({
amount: 10,
account_number: '**ACCOUNT_NUMBER**',
settlement_date: '2025-02-03T13:22:42Z'
})
};
fetch('https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit', 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/directdeposits/debit",
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([
'amount' => 10,
'account_number' => '**ACCOUNT_NUMBER**',
'settlement_date' => '2025-02-03T13:22:42Z'
]),
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/directdeposits/debit"
payload := strings.NewReader("{\n \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\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/directdeposits/debit")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit")
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 \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\n}"
response = http.request(request)
puts response.read_body{
"token": "**DIRECT_DEPOSIT_TOKEN**",
"user_token": "**USER_TOKEN**",
"type": "DEBIT",
"state": "PENDING",
"state_reason": "testing",
"amount": 10,
"created_time": "2025-03-23T19:34:05Z",
"direct_deposit_account_token": "**DIRECT_DEPOSIT_ACCT_TOKEN**",
"last_modified_time": "2025-03-23T19:34:05Z",
"settlement_date": "2025-02-03T13:22:42Z"
}{
"error_code": "<string>",
"error_message": "<string>"
}Simulations 2.0 — Direct Deposits
Simulate debit
Simulates a direct deposit debit from a deposit account
POST
/
simulations
/
directdeposits
/
debit
Simulate debit
curl --request POST \
--url https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"account_number": "**ACCOUNT_NUMBER**",
"settlement_date": "2025-02-03T13:22:42Z"
}
'import requests
url = "https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit"
payload = {
"amount": 10,
"account_number": "**ACCOUNT_NUMBER**",
"settlement_date": "2025-02-03T13:22:42Z"
}
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({
amount: 10,
account_number: '**ACCOUNT_NUMBER**',
settlement_date: '2025-02-03T13:22:42Z'
})
};
fetch('https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit', 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/directdeposits/debit",
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([
'amount' => 10,
'account_number' => '**ACCOUNT_NUMBER**',
'settlement_date' => '2025-02-03T13:22:42Z'
]),
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/directdeposits/debit"
payload := strings.NewReader("{\n \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\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/directdeposits/debit")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox-api.marqeta.com/v3/simulations/directdeposits/debit")
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 \"amount\": 10,\n \"account_number\": \"**ACCOUNT_NUMBER**\",\n \"settlement_date\": \"2025-02-03T13:22:42Z\"\n}"
response = http.request(request)
puts response.read_body{
"token": "**DIRECT_DEPOSIT_TOKEN**",
"user_token": "**USER_TOKEN**",
"type": "DEBIT",
"state": "PENDING",
"state_reason": "testing",
"amount": 10,
"created_time": "2025-03-23T19:34:05Z",
"direct_deposit_account_token": "**DIRECT_DEPOSIT_ACCT_TOKEN**",
"last_modified_time": "2025-03-23T19:34:05Z",
"settlement_date": "2025-02-03T13:22:42Z"
}{
"error_code": "<string>",
"error_message": "<string>"
}Use this endpoint to simulate debiting funds from a deposit account.
Simulate a direct deposit of funds to a user account by including the deposit account number of the account to be debited. You can find the account number in the
account_number field of the response when you create a new deposit account. Alternatively, you can retrieve it by sending a GET request to the /depositaccounts/user/{user_token} endpoint. For more information, see Direct Deposit.Body
application/json
Unique identifier of the direct deposit transaction.
If you do not include a token, the system generates one automatically. This token is used in other API calls. Marqeta recommends that you enter a string that you can remember for the token, rather than having the system generate a token for you. This value cannot be updated.
Maximum string length:
36Response
Created
Was this page helpful?