Fetch transactions by customer ID
curl --request GET \
--url https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}', 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-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-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"
"net/http"
"io"
)
func main() {
url := "https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
{
"merchant_id": "d9b40fe2-25a1-43b5-88aa-ab473004b782",
"id": "c59c1766-4ab8-45e5-8de3-d0c842a31d61",
"sender_wallet_id": null,
"receiver_wallet_id": null,
"transaction_id": "E6TH890JID",
"asset_code": "busd",
"amount": "4.09723734",
"reference_id": "8h8c1766-4ab8-45e5-8de3-d0c842a31d61",
"status": "PENDING",
"created_at": "2025-04-29T10:15:04.974Z",
"updated_at": "2025-04-29T14:53:25.820Z",
"crypto_transaction_id": null,
"network": null,
"transaction_type": "INTERNAL TRANSFER",
"transaction_mode": "DEBIT",
"exchange_rate": "1.50",
"withdrawal_recipient_name": null,
"fee": null,
"balance": "0.00000000",
"reason": null,
"customer_id": "ddf723ee-5558-442d-b46f-4e3d42817448",
"recipient_currency": null,
"recipient_country": null,
"bank_name": null,
"bank_code": null,
"address": null,
"bank_account": null
}
],
"pagination": {
"total": 3,
"page": 1,
"limit": 10,
"totalPages": 1
}
}{
"status": "error",
"message": "Invalid date format. Please use YYYY-MM-DD",
"code": "INVALID_DATE_FORMAT"
}{
"status": "error",
"message": "Customer not found",
"code": "CUSTOMER_NOT_FOUND"
}Transactions
Get by Customer ID
API reference for fetching transactions by customer ID
GET
/
customers
/
transactions
/
by_customer_id
/
{customer_id}
Fetch transactions by customer ID
curl --request GET \
--url https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}', 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-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-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"
"net/http"
"io"
)
func main() {
url := "https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.stablestack.com/api/customers/transactions/by_customer_id/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": [
{
"merchant_id": "d9b40fe2-25a1-43b5-88aa-ab473004b782",
"id": "c59c1766-4ab8-45e5-8de3-d0c842a31d61",
"sender_wallet_id": null,
"receiver_wallet_id": null,
"transaction_id": "E6TH890JID",
"asset_code": "busd",
"amount": "4.09723734",
"reference_id": "8h8c1766-4ab8-45e5-8de3-d0c842a31d61",
"status": "PENDING",
"created_at": "2025-04-29T10:15:04.974Z",
"updated_at": "2025-04-29T14:53:25.820Z",
"crypto_transaction_id": null,
"network": null,
"transaction_type": "INTERNAL TRANSFER",
"transaction_mode": "DEBIT",
"exchange_rate": "1.50",
"withdrawal_recipient_name": null,
"fee": null,
"balance": "0.00000000",
"reason": null,
"customer_id": "ddf723ee-5558-442d-b46f-4e3d42817448",
"recipient_currency": null,
"recipient_country": null,
"bank_name": null,
"bank_code": null,
"address": null,
"bank_account": null
}
],
"pagination": {
"total": 3,
"page": 1,
"limit": 10,
"totalPages": 1
}
}{
"status": "error",
"message": "Invalid date format. Please use YYYY-MM-DD",
"code": "INVALID_DATE_FORMAT"
}{
"status": "error",
"message": "Customer not found",
"code": "CUSTOMER_NOT_FOUND"
}Retrieves a paginated list of transactions for a specific customer with filtering options.
Key Features:
- Returns all transactions associated with a customer ID
- Supports filtering by status, type, mode, currency, and date range
- Includes search functionality by transaction ID
- Provides pagination metadata
- Returns complete transaction details including merchant information
Path Parameters:
customer_id: The customer’s unique identifier (UUID, required)
Query Parameters:
search: Search by transaction ID (partial or full match)status: Filter by transaction status (PENDING,COMPLETED,FAILED,REVERSED)transaction_type: Filter by type (DEPOSIT,PAYOUT,INTERNAL TRANSFER)transaction_mode: Filter by mode (CREDIT,DEBIT)currency: Filter by currency (USDC,USDT)start_date: Filter by start date (format:YYYY-MM-DD)end_date: Filter by end date (format:YYYY-MM-DD)page: Page number (default: 1)limit: Items per page (default: 20, max: 100)
Headers
Path Parameters
Query Parameters
Available options:
PENDING, COMPLETED, FAILED, REVERSED Available options:
DEPOSIT, PAYOUT, INTERNAL TRANSFER Available options:
CREDIT, DEBIT Required range:
x >= 1Required range:
1 <= x <= 100