Adjust Wallet Balance
curl --request POST \
--url https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"description": "<string>"
}
'import requests
url = "https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust"
payload = {
"amount": 123,
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, description: '<string>'})
};
fetch('https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust', 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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust",
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([
'amount' => 123,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust"
payload := strings.NewReader("{\n \"amount\": 123,\n \"description\": \"<string>\"\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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust")
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 \"amount\": 123,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"balance": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Billing API
Adjust Wallet Balance
Endpoint to change the balance for a wallet.
It will add the amount to the wallet if the amount is positive and burn the amount if it is negative. The amount is ISO 4217 currency code compliant meaning that 100 as an input for USD marketplace will be 1 USD.
POST
/
public
/
v1
/
billing-service
/
vendors
/
{external-vendor-id}
/
wallets
/
{wallet-id}
/
adjust
Adjust Wallet Balance
curl --request POST \
--url https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"description": "<string>"
}
'import requests
url = "https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust"
payload = {
"amount": 123,
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, description: '<string>'})
};
fetch('https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust', 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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust",
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([
'amount' => 123,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust"
payload := strings.NewReader("{\n \"amount\": 123,\n \"description\": \"<string>\"\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.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/billing-service/vendors/{external-vendor-id}/wallets/{wallet-id}/adjust")
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 \"amount\": 123,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"balance": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Autorisations
A valid API key generated in Topsort's UI. Use the TSE API key if calling auctions or events API, otherwise use the TSC API key.
Paramètres de chemin
The External ID of the Vendor to retrieve.
Minimum string length:
1The ID of the wallet to retrieve.
Corps
application/json
Réponse
Successful Response
Resulting balance of an adjustment. ISO 4217 standard
Cette page vous a-t-elle été utile ?
⌘I