Pagar cargo de número adicional
Paga, ahora, el cobro pendiente de número extra de UN número y levanta su bloqueo de envío. Un número extra (un número que supera la capacidad que pagó el workspace) se cobra cuando el número se conecta por PRIMERA vez, no cuando se crea. Cuando ese cobro es rechazado (tarjeta rechazada, sin fondos) el número sigue conectado pero el envío desde él queda bloqueado: POST /v1/messages/send responde 409 NUMBER_BLOCKED con reason: "extra_charge_unpaid", y extraChargeUnpaidSince se define en el número en GET /v1/numbers y GET /v1/numbers/{id}. Esta llamada compra ese número extra (primero con los créditos de la billetera, el resto con la tarjeta guardada) y responde status: "paid". Cuando no se debe nada por el número responde status: "not_required" y no cobra nada, así que es seguro repetirla. Sin cuerpo de solicitud. Una recarga de la billetera o una tarjeta recién guardada reintenta el cobro por sí sola, sin esta llamada. Efecto real: cobra. En el plan Free esta llamada nunca cobra: responde 402 PLAN_NUMBER_LIMIT_REACHED hasta que se compre el número extra explícitamente o se mejore el plan.
Requiere una key de alcance tenant. Con un token OAuth / MCP, solo el Owner del workspace puede llamarla (billing:manage).
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/pay \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/pay"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/pay', 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/numbers/{id}/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/numbers/{id}/pay"
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/numbers/{id}/pay")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyRespuesta
Ya no se debe nada por este número. paid: se compró un número extra y se levantó el bloqueo de envío. not_required: no se debía nada por este número (nunca estuvo bloqueado, ya estaba pago o tu capacidad ahora lo cubre) y no se cobró nada.
¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/numbers/{id}/pay \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/numbers/{id}/pay"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/numbers/{id}/pay', 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/numbers/{id}/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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/numbers/{id}/pay"
req, _ := http.NewRequest("POST", 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.post("https://pilotstatus.com.br/v1/numbers/{id}/pay")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/numbers/{id}/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body