List transactions
curl --request GET \
--url https://api.sarafa.site/v3/transactions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sarafa.site/v3/transactions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sarafa.site/v3/transactions', 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.sarafa.site/v3/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.sarafa.site/v3/transactions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sarafa.site/v3/transactions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sarafa.site/v3/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"transactions": [
{
"tx_reference": "TX7A2B9C4D1E0",
"transaction_type": "credit",
"product": "<string>",
"description": "<string>",
"amount": "<string>",
"total_amount": "<string>",
"total_fees": "<string>",
"channel": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"reference": "<string>"
}
],
"limit": 123,
"offset": 123
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}Accounts and transactions
Transaction history
Read your organization’s transactions, newest first.
GET
/
transactions
List transactions
curl --request GET \
--url https://api.sarafa.site/v3/transactions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sarafa.site/v3/transactions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sarafa.site/v3/transactions', 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.sarafa.site/v3/transactions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.sarafa.site/v3/transactions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sarafa.site/v3/transactions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sarafa.site/v3/transactions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"transactions": [
{
"tx_reference": "TX7A2B9C4D1E0",
"transaction_type": "credit",
"product": "<string>",
"description": "<string>",
"amount": "<string>",
"total_amount": "<string>",
"total_fees": "<string>",
"channel": "<string>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"reference": "<string>"
}
],
"limit": 123,
"offset": 123
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"status": "failed",
"error": "<string>",
"request_id": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}Use
The wallet must belong to your organization’s account; an unknown wallet returns HTTP
limit and offset to paginate. The default limit is 50, the maximum is 100, and the default offset is 0. The response contains transactions, limit, and offset.
curl "https://api.sarafa.site/v3/transactions?limit=50&offset=0" \
-H "Authorization: Bearer $SARAFA_API_KEY"
Read one wallet’s history
UseGET /v3/wallets/{currency}/transactions with the same query parameters and response shape:
curl "https://api.sarafa.site/v3/wallets/USD/transactions?limit=50&offset=0" \
-H "Authorization: Bearer $SARAFA_API_KEY"
404.
The transaction’s reference is your merchant reference, or null for records without an API reference. Use tx_reference to read payment details, including its quote, exchange details, and approval expiry where applicable.Authorizations
Use the full key from the merchant dashboard API section. Keep it on your server.
Query Parameters
Required range:
1 <= x <= 100Required range:
x >= 0