Get prepaid credit
curl --request GET \
--url https://api.withallo.com/v2/api/partner/credit \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/partner/credit"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/partner/credit', 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.withallo.com/v2/api/partner/credit",
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: <api-key>"
],
]);
$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.withallo.com/v2/api/partner/credit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.withallo.com/v2/api/partner/credit")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"balance_cents": 120000,
"currency": "eur",
"prepaid": true,
"last_top_up": {
"amount_cents": 150000,
"currency": "eur",
"at": "2026-10-01T09:12:44Z"
},
"top_ups": [
{
"amount_cents": 150000,
"currency": "eur",
"invoice_id": "in_1Q2w3E4r5T6y7U8i",
"at": "2026-10-01T09:12:44Z"
}
]
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Partner
Obtenir le crédit prépayé
Returns the prepaid credit you have left and your recent top-ups. Allo pays what you buy through the Partner API from this credit first, then charges your card on file for the rest. Without enough credit and without a card, a request that charges fails with 402 PARTNER_CREDIT_INSUFFICIENT and nothing is created. Requires the PARTNER scope and a Discounted licence (reseller) partner contract.
GET
/
v2
/
api
/
partner
/
credit
Get prepaid credit
curl --request GET \
--url https://api.withallo.com/v2/api/partner/credit \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/partner/credit"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/partner/credit', 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.withallo.com/v2/api/partner/credit",
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: <api-key>"
],
]);
$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.withallo.com/v2/api/partner/credit"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.withallo.com/v2/api/partner/credit")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/credit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"balance_cents": 120000,
"currency": "eur",
"prepaid": true,
"last_top_up": {
"amount_cents": 150000,
"currency": "eur",
"at": "2026-10-01T09:12:44Z"
},
"top_ups": [
{
"amount_cents": 150000,
"currency": "eur",
"invoice_id": "in_1Q2w3E4r5T6y7U8i",
"at": "2026-10-01T09:12:44Z"
}
]
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Scope requis :
PARTNERComment les montants partenaires sont payés
Tout ce que vous achetez pour vos comptes se paie de la même façon : nouveaux comptes, renouvellements, numéros supplémentaires, sièges des membres et eSIM.- Allo prélève d’abord votre crédit prépayé.
- Si le crédit ne couvre pas tout le montant, Allo débite le reste sur la carte de votre compte de facturation.
- Si le crédit ne couvre pas le montant et qu’aucune carte n’est enregistrée, la requête échoue avec
402 PARTNER_CREDIT_INSUFFICIENT. Rien n’est créé ni débité.
Réponse
balance_centsest le crédit restant, dans la plus petite unité decurrency(centimes pour EUR et USD). Il vaut0avant votre premier rechargement.currencyest en minuscules, par exempleeur. Il est absent avant votre premier rechargement.prepaidvauttruedès qu’au moins un rechargement a été ajouté à votre crédit.last_top_upest votre dernier rechargement :amount_cents,currencyetat. Il est absent si vous n’en avez aucun.top_upsliste vos 20 derniers rechargements, du plus récent au plus ancien. Chacun porteamount_cents(hors taxes),currency,invoice_idetat.
PARTNER_CONTRACT_CANNOT_PROVISION, et un compte qui n’est pas un partenaire activé reçoit PARTNER_ACCESS_REQUIRED.Cette page vous a-t-elle été utile ?