Ledgers
Retrieve a Ledger's Payments
This endpoint returns all payment-related operations in a specific ledger. Operation types that can be returned by this endpoint include: create_account, payment, path_payment, and account_merge.
GET
/
ledgers
/
{sequence}
/
payments
Retrieve a Ledger's Payments
curl --request GET \
--url https://horizon-testnet.stellar.org/ledgers/{sequence}/paymentsimport requests
url = "https://horizon-testnet.stellar.org/ledgers/{sequence}/payments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://horizon-testnet.stellar.org/ledgers/{sequence}/payments', 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://horizon-testnet.stellar.org/ledgers/{sequence}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://horizon-testnet.stellar.org/ledgers/{sequence}/payments"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://horizon-testnet.stellar.org/ledgers/{sequence}/payments")
.asString();require 'uri'
require 'net/http'
url = URI("https://horizon-testnet.stellar.org/ledgers/{sequence}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=&limit=1&order=asc"
},
"next": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=118202550867476481&limit=1&order=asc"
},
"prev": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=118202550867476481&limit=1&order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/operations/118202550867476481"
},
"transaction": {
"href": "https://horizon-testnet.stellar.org/transactions/971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea"
},
"effects": {
"href": "https://horizon-testnet.stellar.org/operations/118202550867476481/effects"
},
"succeeds": {
"href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=118202550867476481"
},
"precedes": {
"href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=118202550867476481"
}
},
"id": "118202550867476481",
"paging_token": "118202550867476481",
"transaction_successful": true,
"source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"type": "payment",
"type_i": 1,
"created_at": "2019-12-30T22:35:49Z",
"transaction_hash": "971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea",
"asset_type": "credit_alphanum4",
"asset_code": "NODL",
"asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
"from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"to": "GDGJS7AXAUFDZARIRDVZ5V7CFW6XY47WSBE2OVLCCGCDWOE7INKYN3PS",
"amount": "0.0000017"
}
]
}
}Query Parameters
Retrieve a Ledger's Payments
curl --request GET \
--url https://horizon-testnet.stellar.org/ledgers/{sequence}/paymentsimport requests
url = "https://horizon-testnet.stellar.org/ledgers/{sequence}/payments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://horizon-testnet.stellar.org/ledgers/{sequence}/payments', 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://horizon-testnet.stellar.org/ledgers/{sequence}/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://horizon-testnet.stellar.org/ledgers/{sequence}/payments"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://horizon-testnet.stellar.org/ledgers/{sequence}/payments")
.asString();require 'uri'
require 'net/http'
url = URI("https://horizon-testnet.stellar.org/ledgers/{sequence}/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=&limit=1&order=asc"
},
"next": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=118202550867476481&limit=1&order=asc"
},
"prev": {
"href": "https://horizon-testnet.stellar.org/ledgers/27521176/payments?cursor=118202550867476481&limit=1&order=desc"
}
},
"_embedded": {
"records": [
{
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/operations/118202550867476481"
},
"transaction": {
"href": "https://horizon-testnet.stellar.org/transactions/971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea"
},
"effects": {
"href": "https://horizon-testnet.stellar.org/operations/118202550867476481/effects"
},
"succeeds": {
"href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=118202550867476481"
},
"precedes": {
"href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=118202550867476481"
}
},
"id": "118202550867476481",
"paging_token": "118202550867476481",
"transaction_successful": true,
"source_account": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"type": "payment",
"type_i": 1,
"created_at": "2019-12-30T22:35:49Z",
"transaction_hash": "971454b84a82baa38afa975e9eb4ff2632821b5a3e7f7993a7e20bbd9d7633ea",
"asset_type": "credit_alphanum4",
"asset_code": "NODL",
"asset_issuer": "GB2Y3AWXVROM2BHFQKQPTWKIOI3TZEBBD3LTKTVQTKEPXGOBE742NODL",
"from": "GDQWI6FKB72DPOJE4CGYCFQZKRPQQIOYXRMZ5KEVGXMG6UUTGJMBCASH",
"to": "GDGJS7AXAUFDZARIRDVZ5V7CFW6XY47WSBE2OVLCCGCDWOE7INKYN3PS",
"amount": "0.0000017"
}
]
}
}