Retrieving transactions
How to retrieve one or more of a customer's transactions and the transaction details.
Overview
Bond provides an API that let's you retrieve either all the transactions for a specific customer or details of a specific transaction.
Retrieving all transactions
To retrieve a list of all transactions, use the GET /transactions
operation and provide the query parameters as shown in the table below.
Attribute | Type | Description |
---|---|---|
customer_id | string | The unique ID used to reference a customer or business resource. |
account_id | string | The UUID of the account. Each customer_id can have more than one account_id associated with it. |
payment_type | string | ach , card , or account .For details, see Payment Types. |
start_date | string | Starting date from which to include transactions, of the from YYY-MM-DD , for example 2020-01-01 . |
end_date | date | End date at which to include transactions, of the from YYY-MM-DD , for example 2021-07-20 . |
page | int32 | The required page number to return. |
count | int32 | Number of transactions to return per page. One of: 1 , 2 , 5 , 10 , 20 , 50 , 100 , 1000 , 5000 , 10000 |
order_by | string | desc or asc . |
transaction_state | string | The transaction state to be included. One of: failed , declined , pending , cancelled , completed , returned . |
An example of a response to a successful request to retrieve all transactions is shown below.
curl --request GET \
--url 'https://sandbox.bond.tech/api/v0.1/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed' \
--header 'Accept: application/json' \
--header 'Authorization: YOUR-AUTHORIZATION' \
--header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://sandbox.bond.tech/api/v0.1/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'
response = http.request(request)
puts response.read_body
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Identity: 'YOUR-IDENTITY',
Authorization: 'YOUR-AUTHORIZATION'
}
};
fetch('https://sandbox.bond.tech/api/v0.1/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed', 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/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed"
headers = {
"Accept": "application/json",
"Identity": "YOUR-IDENTITY",
"Authorization": "YOUR-AUTHORIZATION"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0.1/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://sandbox.bond.tech/api/v0.1/transactions?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&account_id=0bebf64a-a74b-42f4-9af9-8e5ac7b07cf4&payment_type=card&start_date=2019-12-01&end_date=2022-12-31&page=1&count=20&order_by=asc&transaction_state=completed")
.get()
.addHeader("Accept", "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 request to retrieve all transactions is shown below.
{
"page": 1,
"pages": 1,
"count": 2,
"next_page": null,
"transactions": [
{
"transaction_id": "b9b8da9a-5ff2-4e5c-84ee-587b7d092f6b",
"bond_brand_id": "8ed5c9fe-581b-490a-9dcb-3302db235a4b",
"customer_id": "6493109c-7cb5-4f21-9d19-d9c3901d452d",
"account_id": "9dc86a8a-4c12-4107-84a8-e7cf6a76586f",
"payment_type": "card",
"transaction_type": "credit",
"transaction_state": "completed",
"previous_transaction_id": null,
"state": "pending",
"amount": "5.30",
"currency": "USD",
"created_time": "2021-02-02T22:27:13+00:00",
"updated_time": "2021-03-02T20:39:56+00:00",
"details": {
"card_id": "71efc729-830f-455f-9525-281c19bb4bb4",
"mcc": "3542",
"mcc_description": "matrix dynamic eyeballs",
"currency": "USD",
"exchange_rate": "0.00",
"merchant_id": "9le8DI5z8am54O3b",
"merchant_name": "Baldwin, Wright and Martinez",
"merchant_city": "New Nathanshire",
"merchant_state": "Missouri",
"merchant_country": "Colombia",
"merchant_postal_code": "34100",
"merchant_currency": "",
"merchant_amount": "",
"exchange_rate": "",
"cardholder_presence": true,
"statement_descriptor": "Target #4744",
"arn": "000091556011",
"fraud_rule_triggered": "spend_velocity"
}
},
{
"transaction_id": "6460856a-e431-4d5f-a6d2-deb87c01042f",
"bond_brand_id": "4b3fab91-7b67-4300-95f7-437dacac5e78",
"customer_id": "00b9a8ed-03b5-4ce4-a0dd-9bb47aefd2b0",
"account_id": "9e5f7953-743d-46d0-88ae-dacc395e8030",
"payment_type": "ach",
"transaction_type": "credit",
"transaction_state": "completed",
"previous_transaction_id": null,
"state": "pending",
"amount": "3.22",
"currency": "USD",
"created_time": "2021-01-17T06:37:44+00:00",
"updated_time": "2021-03-04T01:09:46+00:00",
"details": {
"card_id": "21775c4e-c74e-40e8-83ec-1e2c9781d587",
"external_account_id": "d6517906-a318-43b5-849f-0b42032c0a1f",
"class_code": "ppd",
"direction": "credit",
"network": "ach",
"description": "Testing",
"failure_reason": "Invalid ACH routing number",
"return_code": "R13"
}
}
]
}
To retrieve details for a single transaction, use the GET /transactions/{transaction_id}
operation with no further parameters.
For a complete specification and interactive examples, see Retrieving transactions in the Bond API Reference.
Retrieving details of a specific transaction
To retrieve the details of a specific transaction, use the GET /transactions/{transaction_id}
operation with no further parameters.
An example of a response to a successful request to retrieve all transactions is shown below.
{
"transaction_id": "b9b8da9a-5ff2-4e5c-84ee-587b7d092f6b",
"bond_brand_id": "8ed5c9fe-581b-490a-9dcb-3302db235a4b",
"customer_id": "6493109c-7cb5-4f21-9d19-d9c3901d452d",
"account_id": "9dc86a8a-4c12-4107-84a8-e7cf6a76586f",
"payment_type": "card",
"transaction_type": "credit",
"previous_transaction_id": null,
"state": "pending",
"amount": "5.30",
"currency": "USD",
"created_time": "2021-02-02T22:27:13+00:00",
"updated_time": "2021-03-02T20:39:56+00:00",
"balances": {
"prior_balance": "68.83",
"new_balance": "63.53"
},
"details": {
"card_id": "71efc729-830f-455f-9525-281c19bb4bb4",
"mcc": "3542",
"mcc_description": "matrix dynamic eyeballs",
"currency": "USD",
"exchange_rate": "1.0",
"merchant_id": "9le8DI5z8am54O3b",
"merchant_name": "Baldwin, Wright and Martinez",
"merchant_city": "New Nathanshire",
"merchant_state": "Missouri",
"merchant_country": "Colombia",
"merchant_postal_code": "34100",
"merchant_currency": "USD",
"merchant_amount": "5.30",
"cardholder_presence": true,
"statement_descriptor": "Target #4744",
"arn": "000091556011",
"fraud_rule_triggered": "spend_velocity"
}
}
For a complete specification and interactive examples, see Retrieving details for a specific transaction in the Bond API Reference.
Retrieving a transaction's history
To retrieve the history for a specific transaction, use the GET /transactions/{transaction_id}/history
operation with the parameters as shown in the following table.
Attribute | Type | Description |
---|---|---|
page | int32 | The required page number to return. |
count | int32 | Number of transactions to return per page. One of: 1 , 2 , 5 , 10 , 20 , 50 |
An example of a request to retrieve a transaction's history is shown below.
curl --request GET \
--url 'https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10' \
--header 'Accept: application/json' \
--header 'Authorization: YOUR-AUTHENTICATION' \
--header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHENTICATION'
response = http.request(request)
puts response.read_body
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Identity: 'YOUR-IDENTITY',
Authorization: 'YOUR-AUTHENTICATION'
}
};
fetch('https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10"
headers = {
"Accept": "application/json",
"Identity": "YOUR-IDENTITY",
"Authorization": "YOUR-AUTHENTICATION"
}
response = requests.get(url, headers=headers)
print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHENTICATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://sandbox.bond.tech/api/v0/transactions/3fa85f64-5717-4562-b3fc-2c963f66afa6/history?page=1&count=10")
.get()
.addHeader("Accept", "application/json")
.addHeader("Identity", "YOUR-IDENTITY")
.addHeader("Authorization", "YOUR-AUTHENTICATION")
.build();
Response response = client.newCall(request).execute();
An example of a response to a successful request to retrieve a transaction's history is shown below.
{
"page": 1,
"pages": 1,
"count": 1,
"next_page": 0,
"transactions": [
{
"transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"bond_brand_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"payment_type": "card",
"transaction_type": "POS Purchase",
"previous_transaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"state": "completed",
"amount": "306.00",
"currency": "USD",
"created_time": "2022-08-03T08:03:49.367Z",
"updated_time": "2022-08-03T08:03:49.367Z",
"balances": {
"prior_balance": "306.00",
"new_balance": "306.00"
},
"details": {
"card_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"external_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"class_code": "string",
"direction": "string",
"network": "string",
"description": "string",
"failure_reason": "string",
"return_code": "string"
}
}
]
}
For a complete specification and interactive examples, see Retrieving transaction history in the Bond API Reference.
Updated about 2 years ago