Suscripción
Vista previa de compra de un número adicional (On Demand)
Calcula el costo de comprar N número(s) extra sin cobrar. Requiere una clave de alcance TENANT (403 para una clave de número). Para tenants del plan Free señala la conversión a On Demand: el número gratuito pasa a ser pagado/ilimitado y el nuevo también (pagas por número/mes). On Demand = mensajes ilimitados en todos los números.
Rol con una clave de cuenta o token OAuth: Owner o Admin (billing:read).
Requiere una clave de alcance tenant.
GET
/
v1
/
subscription
/
extra-numbers
Vista previa de la compra de un número extra (On Demand)
curl --request GET \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/subscription/extra-numbers', 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://pilotstatus.com.br/v1/subscription/extra-numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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://pilotstatus.com.br/v1/subscription/extra-numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/subscription/extra-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": "FREE",
"requiresConversion": true,
"explanation": {
"pt": "Sua conta passa para o plano On Demand: mensagens ilimitadas e R$ 29,90/mês por número conectado. No On Demand todo número é pago — o número que você já usa deixa de ser gratuito. Com o novo, são 2 números a R$ 29,90: R$ 59,80/mês.",
"en": "Your account moves to the On Demand plan: unlimited messages and R$ 29.90/month per connected number. On On Demand every number is paid — the number you already use stops being free. With the new one, that is 2 numbers at R$ 29.90: R$ 59.80/month."
},
"currentNumbers": 1,
"requested": 1,
"billedQuantity": 2,
"currency": "BRL",
"unitPriceMonthly": 29.9,
"proratedUnitPrice": 14.95,
"proratedTotal": 29.9,
"remainingDays": 15,
"totalDaysInCycle": 30,
"walletBalance": 0,
"hasSavedCard": false,
"fundingSource": "none",
"canFund": false,
"unitPriceBRL": 29.9,
"monthlyTotalBRL": 59.8
}{
"error": "Unauthorized"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}Parámetros de consulta
Respuesta
Vista previa: tenant Free con 1 número conectado que compra 1 (se convierte a On Demand). proratedTotal se cobra ahora; monthlyTotalBRL se repite en cada ciclo.
¿Esta página le ayudó?
⌘I
Vista previa de la compra de un número extra (On Demand)
curl --request GET \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/subscription/extra-numbers', 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://pilotstatus.com.br/v1/subscription/extra-numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <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://pilotstatus.com.br/v1/subscription/extra-numbers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/subscription/extra-numbers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": "FREE",
"requiresConversion": true,
"explanation": {
"pt": "Sua conta passa para o plano On Demand: mensagens ilimitadas e R$ 29,90/mês por número conectado. No On Demand todo número é pago — o número que você já usa deixa de ser gratuito. Com o novo, são 2 números a R$ 29,90: R$ 59,80/mês.",
"en": "Your account moves to the On Demand plan: unlimited messages and R$ 29.90/month per connected number. On On Demand every number is paid — the number you already use stops being free. With the new one, that is 2 numbers at R$ 29.90: R$ 59.80/month."
},
"currentNumbers": 1,
"requested": 1,
"billedQuantity": 2,
"currency": "BRL",
"unitPriceMonthly": 29.9,
"proratedUnitPrice": 14.95,
"proratedTotal": 29.9,
"remainingDays": 15,
"totalDaysInCycle": 30,
"walletBalance": 0,
"hasSavedCard": false,
"fundingSource": "none",
"canFund": false,
"unitPriceBRL": 29.9,
"monthlyTotalBRL": 59.8
}{
"error": "Unauthorized"
}{
"error": "This endpoint requires a tenant-scoped API key",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}