Simulating settlement
How can you simulate the settlement of a transaction in the sandbox.
Overview
You can simulate the settlement of a transaction (or part of a transaction) by using the Simulate settlement.
Simulating a transaction settlement
To simulate the settlement of a transaction, use the POST /simulate/settlement
operation and provide the parameters as shown in the table below.
Parameter | Type | Description |
---|---|---|
transaction_id required | string | The ID of the transaction to settle, for example 002e0f0e-e39d-4351-876c-afcad30d9c37 . |
amount | string | Transaction amount as a decimal string with two digits of precision, for example 45.50 . |
You can query this transaction using Retrieving transactions and Retrieving account balances.
An example of a request to settle a transaction is shown below.
curl --request POST \
--url https://sandbox.bond.tech/api/v0/simulate/settlement \
--header 'Accept: application/json' \
--header 'Authorization: YOUR-AUTHORIZATION' \
--header 'Content-Type: application/json' \
--header 'Identity: YOUR-IDENTITY' \
--data '
{
"transaction_id": "64875924-93d4-44f5-8682-f0c54ee8bff8",
"amount": "299.95"
}
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://sandbox.bond.tech/api/v0/simulate/settlement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'
request.body = "{\"transaction_id\":\"64875924-93d4-44f5-8682-f0c54ee8bff8\",\"amount\":\"299.95\"}"
response = http.request(request)
puts response.read_body
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Identity: 'YOUR-IDENTITY',
Authorization: 'YOUR-AUTHORIZATION'
},
body: JSON.stringify({transaction_id: '64875924-93d4-44f5-8682-f0c54ee8bff8', amount: '299.95'})
};
fetch('https://sandbox.bond.tech/api/v0/simulate/settlement', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://sandbox.bond.tech/api/v0/simulate/settlement"
payload = {
"transaction_id": "64875924-93d4-44f5-8682-f0c54ee8bff8",
"amount": "299.95"
}
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Identity": "YOUR-IDENTITY",
"Authorization": "YOUR-AUTHORIZATION"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/simulate/settlement");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
request.AddParameter("application/json", "{\"transaction_id\":\"64875924-93d4-44f5-8682-f0c54ee8bff8\",\"amount\":\"299.95\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"transaction_id\":\"64875924-93d4-44f5-8682-f0c54ee8bff8\",\"amount\":\"299.95\"}");
Request request = new Request.Builder()
.url("https://sandbox.bond.tech/api/v0/simulate/settlement")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Identity", "YOUR-IDENTITY")
.addHeader("Authorization", "YOUR-AUTHORIZATION")
.build();
Response response = client.newCall(request).execute();
An example of a response to a successful card settlement simulation is shown below.
{
"cardholder_presence_indicator":NULL,
"raw_statement_descriptor":"WAUSA USA",
"merchant_country":US,
"merchant_id":2245,
"payment_rail":"card",
"account_id":"cafaa034-d487-4533-a8f0-9ced465ffdaf",
"settled_date":"2021-07-20 22:29:00",
"original_transaction_id":"5fd776de-50a7-4f41-97f7-1c2b4c7836e6",
"customer_id":"b06d5406-7b65-4921-8806-bad23dd88bad",
"transaction_id":"64875924-93d4-44f5-8682-f0c54ee8bff8",
"amount_in_cents":"-299.95",
"prior_balance":"998.01",
"bond_brand_id":"e0cb152c-51dc-44b0-af3c-5c68341068da",
"merchant_state":"NY",
"merchant_city":"New York",
"card_id":"b2c13e2e-c323-47c1-b07e-9c233c9ebec6",
"fee":NULL,
"transaction_time":"2021-07-20 22:29:00",
"date_created":"2021-07-20 22:29:00.597522+00:00",
"transaction_type":"POS Purchase",
"date_updated":"2021-07-20 22:29:00.597528+00:00",
"merchant_zip_code":"98109",
"rewards_rate":NULL,,
"rewards":NULL,,
"mcc":"Online Shopping",
"uuid":"7db5d6b3-aa52-445b-b457-839fc810aa35",
"merchant_name":"Die Another Day",
"amount":"-299.95",
"transaction_state":"pending",
"origin_timestamp":"2021-07-20 22:29:00",
"exchange_rate":NULL,
"new_balance":"298.01",
"acquiring_institution_identification_code":NULL,
"transaction_response_code":NULL,
"merchant_address":NULL,
"currency_code":"USD"
}
For a complete specification and interactive examples, see Simulate settlement in the Bond API Reference.
Updated almost 3 years ago
Next Steps