curl --request POST \
--url https://api.sandbox.lead.bank/v2/simulate/ach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"scenario": "incoming_payment",
"amount": 5000,
"currency": "USD",
"transaction_type": "credit",
"account_number_id": "account_number_xyz123",
"sec_code": "WEB",
"statement_descriptor": "P2P Credit",
"company_name": "Lorum Inc.",
"company_identification": "1234567890",
"counterparty": {
"routing_number": "021000021"
}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/simulate/ach"
payload = {
"scenario": "incoming_payment",
"amount": 5000,
"currency": "USD",
"transaction_type": "credit",
"account_number_id": "account_number_xyz123",
"sec_code": "WEB",
"statement_descriptor": "P2P Credit",
"company_name": "Lorum Inc.",
"company_identification": "1234567890",
"counterparty": { "routing_number": "021000021" }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scenario: 'incoming_payment',
amount: 5000,
currency: 'USD',
transaction_type: 'credit',
account_number_id: 'account_number_xyz123',
sec_code: 'WEB',
statement_descriptor: 'P2P Credit',
company_name: 'Lorum Inc.',
company_identification: '1234567890',
counterparty: {routing_number: '021000021'}
})
};
fetch('https://api.sandbox.lead.bank/v2/simulate/ach', 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://api.sandbox.lead.bank/v2/simulate/ach",
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([
'scenario' => 'incoming_payment',
'amount' => 5000,
'currency' => 'USD',
'transaction_type' => 'credit',
'account_number_id' => 'account_number_xyz123',
'sec_code' => 'WEB',
'statement_descriptor' => 'P2P Credit',
'company_name' => 'Lorum Inc.',
'company_identification' => '1234567890',
'counterparty' => [
'routing_number' => '021000021'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.sandbox.lead.bank/v2/simulate/ach"
payload := strings.NewReader("{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.lead.bank/v2/simulate/ach")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/simulate/ach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}"
response = http.request(request)
puts response.read_body{}Simulate ACH
Simulates an ACH scenario in sandbox. Set scenario to choose what happens; each scenario takes the fields listed in its request shape. The response body is empty; read the ACH with Retrieve an ACH V2, the list endpoint, or its webhook. Available in Sandbox only.
If the ACH isn’t in a state the scenario allows, the call returns 422 object_state_mismatched with errors[].code object_status_not_permitted, and the message names the required state. For example, incoming_return on an ACH still in scheduled. If two calls race on the same ACH, the first wins and the other returns 409 object_modified_concurrently; fetch the ACH and retry.
curl --request POST \
--url https://api.sandbox.lead.bank/v2/simulate/ach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"scenario": "incoming_payment",
"amount": 5000,
"currency": "USD",
"transaction_type": "credit",
"account_number_id": "account_number_xyz123",
"sec_code": "WEB",
"statement_descriptor": "P2P Credit",
"company_name": "Lorum Inc.",
"company_identification": "1234567890",
"counterparty": {
"routing_number": "021000021"
}
}
'import requests
url = "https://api.sandbox.lead.bank/v2/simulate/ach"
payload = {
"scenario": "incoming_payment",
"amount": 5000,
"currency": "USD",
"transaction_type": "credit",
"account_number_id": "account_number_xyz123",
"sec_code": "WEB",
"statement_descriptor": "P2P Credit",
"company_name": "Lorum Inc.",
"company_identification": "1234567890",
"counterparty": { "routing_number": "021000021" }
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scenario: 'incoming_payment',
amount: 5000,
currency: 'USD',
transaction_type: 'credit',
account_number_id: 'account_number_xyz123',
sec_code: 'WEB',
statement_descriptor: 'P2P Credit',
company_name: 'Lorum Inc.',
company_identification: '1234567890',
counterparty: {routing_number: '021000021'}
})
};
fetch('https://api.sandbox.lead.bank/v2/simulate/ach', 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://api.sandbox.lead.bank/v2/simulate/ach",
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([
'scenario' => 'incoming_payment',
'amount' => 5000,
'currency' => 'USD',
'transaction_type' => 'credit',
'account_number_id' => 'account_number_xyz123',
'sec_code' => 'WEB',
'statement_descriptor' => 'P2P Credit',
'company_name' => 'Lorum Inc.',
'company_identification' => '1234567890',
'counterparty' => [
'routing_number' => '021000021'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://api.sandbox.lead.bank/v2/simulate/ach"
payload := strings.NewReader("{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://api.sandbox.lead.bank/v2/simulate/ach")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/simulate/ach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scenario\": \"incoming_payment\",\n \"amount\": 5000,\n \"currency\": \"USD\",\n \"transaction_type\": \"credit\",\n \"account_number_id\": \"account_number_xyz123\",\n \"sec_code\": \"WEB\",\n \"statement_descriptor\": \"P2P Credit\",\n \"company_name\": \"Lorum Inc.\",\n \"company_identification\": \"1234567890\",\n \"counterparty\": {\n \"routing_number\": \"021000021\"\n }\n}"
response = http.request(request)
puts response.read_body{}Authorizations
Headers
Body
- Incoming payment
- Incoming return
Simulates an incoming ACH originated by another financial institution. The entry is created in scheduled and stays there until you advance it.
Standard Entry Class (SEC) code for this ACH object. This list covers every code Lead can receive on incoming ACH. Outgoing ACH accept a narrower list, OutgoingSecCode, which is what Lead originates.
PPD, CCD, ARC, BOC, CIE, CTX, IAT, POP, POS, RCK, TEL, WEB, ADV, DNE, ENR, MTE, SHR, TRC, TRX, COR "WEB"
Response
The simulation was accepted. The response body is empty.
The response is of type object.
Was this page helpful?

