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 API.

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 an account balance.

An example of a request to settle a transaction is shown below.

curl --request POST \
     --url https://sandbox.bond.tech/api/v0.1/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.1/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.1/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.1/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.1/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.1/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.

{
  "transaction_id": "3fd4356b-a64b-4d2f-8699-cbb2b76e1d52",
  "customer_id": "08ebf96f-d3e2-4a50-8a52-d5677c3c9825",
  "card_id": "7c216d02-e5ca-4d88-b8da-90b912a34081",
  "raw_statement_descriptor": "Amazon.com Amzn.com/billWAUSA USA",
  "account_id": "4b9cecad-8081-49aa-ab71-d273d64fb50e",
  "bond_brand_id": "91b8a931-c86d-462b-9db5-eded20b26bd9",
  "payment_rail": "card",
  "amount": "-4.99",
  "amount_in_cents": "-499",
  "currency_code": "USD",
  "exchange_rate": null,
  "transaction_type": "POS Purchase",
  "cardholder_presence_indicator": null,
  "original_transaction_id": null,
  "merchant_name": "Amazon.Com Amzn.Com/Billwausa Usa",
  "merchant_id": null,
  "merchant_address": null,
  "merchant_country": null,
  "merchant_city": "string",
  "merchant_state": "string",
  "merchant_zip_code": "string",
  "mcc": "Online Shopping",
  "settled_date": "2021-07-20 22:29:00",
  "new_balance": "298.01",
  "prior_balance": "303",
  "transaction_time": "2021-07-20 22:29:00",
  "date_created": "2021-07-20 22:29:00",
  "date_updated": "2021-07-20 22:29:00",
  "fee": null,
  "rewards_rate": null,
  "rewards": null,
  "transaction_state": "pending",
  "origin_timestamp": "2021-07-20 22:29:00",
  "transaction_response_code": null,
  "acquiring_institution_identification_code": null
}

For a complete specification and interactive examples, see Simulate settlement in the Bond API Reference.


Did this page help you?