Assinatura
Comprar número extra (On Demand)
Compra N número(s) extra(s). Requer key escopada a TENANT. Tenant Grátis é convertido para On Demand (cobra o número grátis convertido + o novo) — exige confirm:true, senão retorna 409 CONFIRMATION_REQUIRED com a prévia. Com cartão salvo (Planos → Cartão) cobra na hora; senão devolve para pagar. Efeito real: cobra de verdade. Só Stripe.
Requer uma chave com escopo de tenant.
POST
/
v1
/
subscription
/
extra-numbers
Comprar número extra (On Demand)
curl --request POST \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quantity": 1,
"confirm": true
}
'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
payload = {
"quantity": 1,
"confirm": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({quantity: 1, confirm: true})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quantity' => 1,
'confirm' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/subscription/extra-numbers"
payload := strings.NewReader("{\n \"quantity\": 1,\n \"confirm\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 1,\n \"confirm\": true\n}")
.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::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 1,\n \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"charged": true,
"plan": "ON_DEMAND",
"paidExtraNumbers": 2,
"proratedTotal": 29.9,
"currency": "BRL",
"creditsUsed": 0,
"cardCharged": 29.9,
"maxNumbers": 2,
"currentNumberCount": 1,
"monthlyTotalBRL": 59.8
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Number-scoped keys cannot call tenant endpoints",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Confirmação necessária: comprar um número extra converte o plano Grátis em On Demand (todos os números passam a ser cobrados). Reenvie com confirm:true.",
"code": "CONFIRMATION_REQUIRED",
"preview": {
"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": "Too many requests"
}Autorizações
apiKeyapiKeyId
Sua chave de API ps_
Corpo
application/json
Resposta
Comprou 1 (com confirmação). O custo proporcional foi coberto por créditos da carteira e/ou cartão salvo.
Esta página foi útil?
⌘I
Comprar número extra (On Demand)
curl --request POST \
--url https://pilotstatus.com.br/v1/subscription/extra-numbers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quantity": 1,
"confirm": true
}
'import requests
url = "https://pilotstatus.com.br/v1/subscription/extra-numbers"
payload = {
"quantity": 1,
"confirm": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({quantity: 1, confirm: true})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quantity' => 1,
'confirm' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/subscription/extra-numbers"
payload := strings.NewReader("{\n \"quantity\": 1,\n \"confirm\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/subscription/extra-numbers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 1,\n \"confirm\": true\n}")
.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::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 1,\n \"confirm\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"charged": true,
"plan": "ON_DEMAND",
"paidExtraNumbers": 2,
"proratedTotal": 29.9,
"currency": "BRL",
"creditsUsed": 0,
"cardCharged": 29.9,
"maxNumbers": 2,
"currentNumberCount": 1,
"monthlyTotalBRL": 59.8
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Number-scoped keys cannot call tenant endpoints",
"code": "NUMBER_SCOPE_NOT_ALLOWED"
}{
"error": "Confirmação necessária: comprar um número extra converte o plano Grátis em On Demand (todos os números passam a ser cobrados). Reenvie com confirm:true.",
"code": "CONFIRMATION_REQUIRED",
"preview": {
"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": "Too many requests"
}