cURL
curl --request POST \
--url https://api.example.com/v1/account/wallet/top-up \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"amountMinor": 2,
"currency": "<string>",
"provider": "<string>"
}
'import requests
url = "https://api.example.com/v1/account/wallet/top-up"
payload = {
"amountMinor": 2,
"currency": "<string>",
"provider": "<string>"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-CSRF-Token': '<x-csrf-token>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amountMinor: 2, currency: '<string>', provider: '<string>'})
};
fetch('https://api.example.com/v1/account/wallet/top-up', 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.example.com/v1/account/wallet/top-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amountMinor' => 2,
'currency' => '<string>',
'provider' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-CSRF-Token: <x-csrf-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/wallet/top-up"
payload := strings.NewReader("{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/v1/account/wallet/top-up")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/wallet/top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "<string>",
"amountMinor": 123,
"state": "<string>",
"payment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "<string>",
"status": "<string>",
"amountMinor": 123,
"currency": "<string>",
"handoff": "hosted",
"checkoutUrl": "<string>"
},
"paymentProblem": {
"code": "provider_unavailable",
"detail": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}account
Post v1accountwallettop up
Opens a top-up order through the same order, webhook, and reconciliation pipeline a plan uses. The caller’s key becomes the order’s key, so a retried request credits the same top-up rather than a second one. The order and its payment are two steps: when the order exists but the provider refused the intent, the response is still 201 with the order and paymentProblem in place of payment, because the order is the customer’s and can be paid from its own screen by any method that settles it.
POST
/
v1
/
account
/
wallet
/
top-up
cURL
curl --request POST \
--url https://api.example.com/v1/account/wallet/top-up \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-CSRF-Token: <x-csrf-token>' \
--data '
{
"amountMinor": 2,
"currency": "<string>",
"provider": "<string>"
}
'import requests
url = "https://api.example.com/v1/account/wallet/top-up"
payload = {
"amountMinor": 2,
"currency": "<string>",
"provider": "<string>"
}
headers = {
"X-CSRF-Token": "<x-csrf-token>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-CSRF-Token': '<x-csrf-token>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amountMinor: 2, currency: '<string>', provider: '<string>'})
};
fetch('https://api.example.com/v1/account/wallet/top-up', 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.example.com/v1/account/wallet/top-up",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amountMinor' => 2,
'currency' => '<string>',
'provider' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-CSRF-Token: <x-csrf-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/account/wallet/top-up"
payload := strings.NewReader("{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CSRF-Token", "<x-csrf-token>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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/v1/account/wallet/top-up")
.header("X-CSRF-Token", "<x-csrf-token>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/account/wallet/top-up")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CSRF-Token"] = '<x-csrf-token>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountMinor\": 2,\n \"currency\": \"<string>\",\n \"provider\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"currency": "<string>",
"amountMinor": 123,
"state": "<string>",
"payment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "<string>",
"status": "<string>",
"amountMinor": 123,
"currency": "<string>",
"handoff": "hosted",
"checkoutUrl": "<string>"
},
"paymentProblem": {
"code": "provider_unavailable",
"detail": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"request_id": "<string>"
}Headers
Echoes the token from the current session. Required on every unsafe method.
Required string length:
8 - 128Body
application/json