Get number price
curl --request GET \
--url https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price"
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/accounts/{id}/numbers/price', 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/accounts/{id}/numbers/price",
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/accounts/{id}/numbers/price"
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/accounts/{id}/numbers/price")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price")
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": {
"included": false,
"unit_amount_before_discount": 1000,
"amount_due_now": 540,
"currency": "eur",
"interval": "MONTHLY"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}Partner
Obtenir le prix d'un numéro
Returns what adding one more number to the account costs today. When the account already pays for a free number slot, included is true and amount_due_now is 0. Otherwise amount_due_now is the charge for the rest of the account’s current billing period, net of the subscription’s discount, tax included. Requires the PARTNER scope.
GET
/
v2
/
api
/
partner
/
accounts
/
{id}
/
numbers
/
price
Get number price
curl --request GET \
--url https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price"
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/accounts/{id}/numbers/price', 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/accounts/{id}/numbers/price",
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/accounts/{id}/numbers/price"
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/accounts/{id}/numbers/price")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/partner/accounts/{id}/numbers/price")
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": {
"included": false,
"unit_amount_before_discount": 1000,
"amount_due_now": 540,
"currency": "eur",
"interval": "MONTHLY"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}{
"error": {}
}{
"error": {}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {}
}Scope requis :
PARTNERincludedvauttruequand le compte paie déjà un emplacement de numéro qu’aucun numéro n’occupe. Le prochain numéro ne coûte alors rien, etamount_due_nowvaut0.amount_due_nowest le montant qu’Allo débite à l’ajout du numéro : le reste de la période de facturation en cours du compte, avec la remise de l’abonnement appliquée, taxes comprises.unit_amount_before_discountest le prix d’un numéro pour une période de facturation complète, avant toute remise.- Les montants sont exprimés dans la plus petite unité de
currency(centimes pour EUR et USD).currencyest en minuscules, par exempleeur. intervalest la périodicité de facturation de l’abonnement du compte :MONTHLYouYEARLY.- Un compte que votre API key n’a pas créé, ou déjà désactivé, renvoie
404 PARTNER_ACCOUNT_NOT_FOUND.
Cette page vous a-t-elle été utile ?