Cotizar una suscripción DID
Catálogo, cotización, pago y seguimiento de pedidos.
POST /api/v1/orders/quotePermiso: catalog:read
Permiso: catalog:read. Envíe didId, cycle (monthly/semiannually/yearly), paymentMethod (pix/card), quantity=1 opcional y couponCode opcional (1–80 letras, números, guiones o guiones bajos). Devuelve totalAmount en centavos, recurrencia y confirmaciones de SMS requeridas. No crea pagos ni reservas. Requisitos de perfil, capacidad o disponibilidad no cumplidos: 409.
Durante las ofertas temporales de números móviles, los ciclos disponibles y la inclusión de SMS pueden variar. Consulta siempre una cotización: did.smsEnabled indica si el plan incluye SMS, y acknowledgements.mobileMonthlySms.required indica si debes enviar mobileMonthlySmsAcknowledged=true después del consentimiento del cliente. A pesar del nombre, estos campos se aplican a cualquier ciclo móvil sin SMS. La cotización no garantiza la oferta; las condiciones se validan de nuevo al crear el pago. Los pagos emitidos durante la oferta conservan sus condiciones hasta el vencimiento del propio pago. Al finalizar la oferta, las nuevas compras siguen las condiciones vigentes; las suscripciones completadas conservan su ciclo y la condición de SMS en las renovaciones mientras sigan vigentes. Esto no garantiza el precio. Se mantienen los requisitos de cuenta, verificación, límites, disponibilidad y un número por pedido.
Cuando una cuenta está en revisión de seguridad, las consultas y operaciones se bloquean con HTTP 403 y código account_security_review, incluso con tokens emitidos previamente. No intente eludir la restricción ni repetir automáticamente. El acceso se restablece después de la liberación administrativa; se mantienen los demás límites y restricciones. Los webhooks pendientes y los eventos del período se suprimen sin reenvío automático. La facturación y los vencimientos siguen las reglas existentes. Siga la revisión en https://novodid.com/seguranca/atendimento. Solo el ticket vinculado a la revisión permite lectura, respuestas y archivos adjuntos en el sitio autenticado. Los demás tickets y la API pública continúan bloqueados. El cliente debe esperar el primer mensaje del equipo y puede enviar una sola respuesta por cada nuevo mensaje del soporte, incluidos los archivos solicitados.
Cuerpo de la solicitud
{
"didId": 1234,
"quantity": 1,
"cycle": "monthly",
"paymentMethod": "pix",
"fixedDidSmsAcknowledged": true
}Respuesta exitosa (200)
{
"did": {
"id": 1234,
"number": "551130001234",
"kind": "fixed",
"smsEnabled": false
},
"quantity": 1,
"paymentMethod": "pix",
"pricing": {
"currency": "BRL",
"baseMonthlyAmount": 1499,
"cycle": "monthly",
"cycleMonths": 1,
"subtotalAmount": 1499,
"totalDiscountPercent": 0,
"discountedAmount": 1499,
"cardFeeAmount": 0,
"totalAmount": 1499
},
"recurring": true,
"reserved": false,
"acknowledgements": {
"fixedDidSms": {
"required": true,
"message": "Confirme que está ciente de que este número fixo não recebe SMS antes de assinar."
},
"mobileMonthlySms": {
"required": false,
"message": null
}
}
}Ejemplo de error
{
"error": {
"code": "did_unavailable",
"message": "Número indisponível para compra."
}
}curl
curl -X POST \
-H "Authorization: Bearer $NOVODID_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"didId":1234,"quantity":1,"cycle":"monthly","paymentMethod":"pix","fixedDidSmsAcknowledged":true}' \
"https://novodid.com/api/v1/orders/quote"Node
const response = await fetch("https://novodid.com/api/v1/orders/quote", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NOVODID_API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"didId": 1234,
"quantity": 1,
"cycle": "monthly",
"paymentMethod": "pix",
"fixedDidSmsAcknowledged": true
})
});
const payload = await response.json();
if (!response.ok) {
throw new Error(payload.error?.message || "Erro na API NovoDID");
}
console.log({ status: response.status });Python
import os
import requests
response = requests.post(
"https://novodid.com/api/v1/orders/quote",
headers={"Authorization": f"Bearer {os.environ['NOVODID_API_TOKEN']}"},
json={
"didId": 1234,
"quantity": 1,
"cycle": "monthly",
"paymentMethod": "pix",
"fixedDidSmsAcknowledged": True
},
timeout=30,
)
payload = response.json()
response.raise_for_status()
print({"status": response.status_code})Go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://novodid.com/api/v1/orders/quote", strings.NewReader(`{"didId":1234,"quantity":1,"cycle":"monthly","paymentMethod":"pix","fixedDidSmsAcknowledged":true}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("NOVODID_API_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
_, _ = io.Copy(io.Discard, res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("NovoDID API HTTP %d", res.StatusCode))
}
fmt.Println(res.StatusCode)
}Rust
use serde_json::json;
use reqwest::blocking::Client;
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.post("https://novodid.com/api/v1/orders/quote")
.bearer_auth(env::var("NOVODID_API_TOKEN")?)
.json(&json!({
"didId": 1234,
"quantity": 1,
"cycle": "monthly",
"paymentMethod": "pix",
"fixedDidSmsAcknowledged": true
}))
.send()?;
let status = response.status();
let _payload = response.text()?;
if !status.is_success() {
return Err(format!("NovoDID API HTTP {}", status).into());
}
println!("HTTP {}", status);
Ok(())
}PHP
<?php
$ch = curl_init("https://novodid.com/api/v1/orders/quote");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("NOVODID_API_TOKEN"),
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => '{"didId":1234,"quantity":1,"cycle":"monthly","paymentMethod":"pix","fixedDidSmsAcknowledged":true}',
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($response === false || $status >= 300) {
throw new RuntimeException("NovoDID API HTTP " . $status);
}
echo $status . PHP_EOL;Ruby
require "net/http"
uri = URI("https://novodid.com/api/v1/orders/quote")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("NOVODID_API_TOKEN")}"
request["Content-Type"] = "application/json"
request.body = %q({"didId":1234,"quantity":1,"cycle":"monthly","paymentMethod":"pix","fixedDidSmsAcknowledged":true})
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
raise "NovoDID API HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
puts response.codeC#
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://novodid.com/api/v1/orders/quote");
request.Headers.Authorization = new AuthenticationHeaderValue(
"Bearer",
Environment.GetEnvironmentVariable("NOVODID_API_TOKEN")
);
request.Content = new StringContent(
"""
{
"didId": 1234,
"quantity": 1,
"cycle": "monthly",
"paymentMethod": "pix",
"fixedDidSmsAcknowledged": true
}
""",
Encoding.UTF8,
"application/json"
);
using var response = await client.SendAsync(request);
var payload = await response.Content.ReadAsStringAsync();
response.EnsureSuccessStatusCode();
Console.WriteLine(response.StatusCode);
