Credits
List wallets
A customer’s credit per currency and credit unit: the credit on account, the usage not
invoiced yet and the balance left after it, with the wallet’s alerts and automatic top-up. The
customer’s own currency comes first, even when empty. With subscription_id, each wallet
counts only the credit that subscription can use.
GET
/
api
/
v1
/
customers
/
{id_or_alias}
/
wallets
List wallets
curl --request GET \
--url https://api.example.com/api/v1/customers/{id_or_alias}/wallets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/customers/{id_or_alias}/wallets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/customers/{id_or_alias}/wallets', 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/api/v1/customers/{id_or_alias}/wallets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/customers/{id_or_alias}/wallets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/customers/{id_or_alias}/wallets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/customers/{id_or_alias}/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"credit_on_account": 123,
"credit_on_account_usage_only": 123,
"low_balance_thresholds": [
123
],
"pauses_at_zero": true,
"subscription_credit": [
{
"credit_on_account": 123,
"subscription_id": "<string>"
}
],
"upcoming_credit": 123,
"usage_at_zero": "FOLLOW_PLAN",
"as_of": "2023-11-07T05:31:56Z",
"auto_top_up": {
"method": "FIXED",
"status": "ACTIVE",
"threshold": 123,
"amount": 123,
"customer_consent_attested_at": "2023-11-07T05:31:56Z",
"daily_cap": 123,
"last_error": "<string>",
"last_succeeded_at": "2023-11-07T05:31:56Z",
"maximum": 123,
"minimum": 123,
"monthly_cap": 123,
"payment_method_id": "<string>",
"suspended_at": "2023-11-07T05:31:56Z",
"target": 123
},
"balance": 123,
"credit_unit": "<string>",
"credit_unit_precision": 1,
"currency": "EUR",
"shared_balance": 123,
"unbilled_usage": 123,
"unit_price": "<string>",
"unit_price_currency": "EUR"
}
]
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}Authorizations
Query Parameters
⌘I
List wallets
curl --request GET \
--url https://api.example.com/api/v1/customers/{id_or_alias}/wallets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/customers/{id_or_alias}/wallets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/customers/{id_or_alias}/wallets', 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/api/v1/customers/{id_or_alias}/wallets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/customers/{id_or_alias}/wallets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/customers/{id_or_alias}/wallets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/customers/{id_or_alias}/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"credit_on_account": 123,
"credit_on_account_usage_only": 123,
"low_balance_thresholds": [
123
],
"pauses_at_zero": true,
"subscription_credit": [
{
"credit_on_account": 123,
"subscription_id": "<string>"
}
],
"upcoming_credit": 123,
"usage_at_zero": "FOLLOW_PLAN",
"as_of": "2023-11-07T05:31:56Z",
"auto_top_up": {
"method": "FIXED",
"status": "ACTIVE",
"threshold": 123,
"amount": 123,
"customer_consent_attested_at": "2023-11-07T05:31:56Z",
"daily_cap": 123,
"last_error": "<string>",
"last_succeeded_at": "2023-11-07T05:31:56Z",
"maximum": 123,
"minimum": 123,
"monthly_cap": 123,
"payment_method_id": "<string>",
"suspended_at": "2023-11-07T05:31:56Z",
"target": 123
},
"balance": 123,
"credit_unit": "<string>",
"credit_unit_precision": 1,
"currency": "EUR",
"shared_balance": 123,
"unbilled_usage": 123,
"unit_price": "<string>",
"unit_price_currency": "EUR"
}
]
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}{
"code": "BAD_REQUEST",
"message": "<string>"
}