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.
curl --request GET \
--url 'https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments'import requests
url = "https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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"
}
]
}
}20 Compute Units.
Reference: Here
Path Parameters
The sequence number of a specific ledger.
0
Query Parameters
A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record.
6606617478959105
A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc.
asc, desc The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10.
10
Set to true to include failed operations in results. Options include true and false.
true, false Set to transactions to include the transactions which created each of the operations in the response.
curl --request GET \
--url 'https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments'import requests
url = "https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ledgers/{sequence}/payments")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE>/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"
}
]
}
}