JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
amount: '25.00',
currency: 'USD'
})
};
fetch('https://api.example.com/ledger/top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/ledger/top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD"
}
'import requests
url = "https://api.example.com/ledger/top-up"
payload = {
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ledger/top-up"
payload := strings.NewReader("{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/ledger/top-up")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ledger/top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD",
"balance": "125.00"
}{
"code": 123,
"message": "<string>"
}Simulator
Post ledgertop up
Credits an account balance so cards on that account can transact. The account must be active and already hold a balance in the requested currency.
POST
/
ledger
/
top-up
JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
amount: '25.00',
currency: 'USD'
})
};
fetch('https://api.example.com/ledger/top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.example.com/ledger/top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD"
}
'import requests
url = "https://api.example.com/ledger/top-up"
payload = {
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/ledger/top-up"
payload := strings.NewReader("{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/ledger/top-up")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/ledger/top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"amount\": \"25.00\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": "25.00",
"currency": "USD",
"balance": "125.00"
}{
"code": 123,
"message": "<string>"
}Body
application/json
Response
The request has succeeded.