{"openapi":"3.1.0","info":{"title":"Ativa SMS Reseller API","version":"1","description":"Resell temporary numbers for receiving SMS verification codes. Human-readable documentation: https://www.ativasms.store/en/developers (Portuguese: https://www.ativasms.store/desenvolvedores). Amounts are integer cents in the currency given by `moeda`; dates are ISO 8601 UTC. Field names and error codes are in Portuguese. Test keys (ativa_test_) use fictional balance and numbers.","termsOfService":"https://www.ativasms.store/en/reseller-terms","contact":{"email":"contato@ativasms.store"}},"servers":[{"url":"https://www.ativasms.store/api/v1"}],"security":[{"chave":[]}],"externalDocs":{"description":"API documentation","url":"https://www.ativasms.store/en/developers"},"paths":{"/saldo":{"get":{"operationId":"saldo","summary":"Account balance","description":"No parameters. Returns the balance in the account currency (BRL or USD). Test mode always uses BRL and fictional funds.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Saldo"},"example":{"saldo_centavos":10000,"moeda":"BRL"}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/servicos":{"get":{"operationId":"servicos","summary":"Available services","description":"No parameters. Returns all available services, without duplicates or blocked services. The example shows one entry; test mode also includes teste_falha (Teste sem código). API field names and service labels stay in Portuguese regardless of the documentation language.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Servico"}},"example":[{"codigo":"wa","nome":"WhatsApp"}]}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/paises":{"get":{"operationId":"paises","summary":"Countries","description":"No parameters. Returns all countries. Use codigo in queries and purchases; iso is uppercase and ddi is the dialing code. The example shows one entry.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Pais"}},"example":[{"codigo":73,"iso":"BR","nome":"Brasil","ddi":"+55"}]}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/opcoes":{"get":{"operationId":"opcoes","summary":"Purchase options for a service and country","description":"Required query parameters: servico (a code from the services list) and pais (a numeric country code). Returns up to 6 options in ascending preco_centavos order; the result may be []. opcao is an opaque identifier: op_ followed by 12 hexadecimal characters. Pass back the returned value without interpreting it. preco_centavos is the reseller's charge; preco_site_centavos is the website reference price, both in the stated currency. prazo_min is the time limit; taxa_sucesso may be null; estoque reports availability and recomendada marks a suggested option. This example uses the fictional test option.","parameters":[{"name":"servico","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-z0-9_]{1,20}$"}},{"name":"pais","in":"query","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","maxItems":6,"items":{"$ref":"#/components/schemas/Opcao"}},"example":[{"opcao":"op_000000000001","preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","prazo_min":20,"taxa_sucesso":null,"estoque":100,"recomendada":false}]}}},"400":{"description":"parametro_invalido or servico_bloqueado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/numeros":{"post":{"operationId":"comprarNumero","summary":"Buy a number","description":"Required JSON fields: servico (1–20 lowercase letters, digits or _; an allowed service), pais (a valid integer country code), preco_maximo_centavos (a positive integer) and cliente_ref (an anonymous identifier, 1–64 letters, digits or . _ : -; never an email address or personal identifier). opcao is optional and may be null; omitting it selects the cheapest option. Send Idempotency-Key. A new purchase returns 201; a repeat returns 200 with the same id and current state, without another charge. This is a test purchase example.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"1–64 letters, digits or . _ : -. Reuse the same key when retrying; a recorded key returns the same number with HTTP 200.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Compra"},"example":{"servico":"wa","pais":73,"opcao":"op_000000000001","preco_maximo_centavos":83,"cliente_ref":"cliente_abc123"}}}},"responses":{"200":{"description":"Repeated Idempotency-Key: same number, current state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"wa","servico_nome":"WhatsApp","pais":73,"telefone":"+12025550123","status":"aguardando_sms","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":null,"substitui_id":null,"cliente_ref":"cliente_abc123","sms":[]}}}},"201":{"description":"New purchase","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"wa","servico_nome":"WhatsApp","pais":73,"telefone":"+12025550123","status":"aguardando_sms","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":null,"substitui_id":null,"cliente_ref":"cliente_abc123","sms":[]}}}},"400":{"description":"parametro_invalido, servico_bloqueado or idempotencia_obrigatoria","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"402":{"description":"saldo_insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"403":{"description":"cliente_bloqueado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"409":{"description":"sem_numeros, opcao_indisponivel, preco_acima_do_maximo or preco_subiu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"502":{"description":"erro_fornecedor or sem_confirmacao","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}},"get":{"operationId":"listarNumeros","summary":"List numbers bought through the API","description":"Optional query parameters: status (a documented number state), cliente_ref (same format as on purchase), pagina (1–1000, default 1). Returns up to 50 API purchases per page for this account and mode, newest first. tem_mais indicates another page. Listing live numbers does not force a refresh; query an individual number to refresh it.","parameters":[{"name":"status","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Status"}},{"name":"cliente_ref","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"}},{"name":"pagina","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListaNumeros"},"example":{"numeros":[{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"wa","servico_nome":"WhatsApp","pais":73,"telefone":"+12025550123","status":"aguardando_sms","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":null,"substitui_id":null,"cliente_ref":"cliente_abc123","sms":[]}],"pagina":1,"tem_mais":false}}}},"400":{"description":"parametro_invalido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/numeros/{id}":{"get":{"operationId":"consultarNumero","summary":"Number state and SMS","description":"Path: /numeros/{id}, where id is the number's UUID. Only API purchases belonging to this account and mode are visible; another owner's number, a website purchase or an invalid UUID returns nao_encontrado. Open numbers are refreshed before responding, up to 60 refreshes/min per live key; further requests return the latest available state (200, without an additional synchronization 429). This example shows a received test code.","parameters":[{"name":"id","in":"path","required":true,"description":"Number UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"wa","servico_nome":"WhatsApp","pais":73,"telefone":"+12025550123","status":"recebido","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":null,"substitui_id":null,"cliente_ref":"cliente_abc123","sms":[{"codigo":"123456","texto":"Seu código de teste: 123456","recebido_em":"2026-10-08T12:00:20.000Z"}]}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"404":{"description":"nao_encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/numeros/{id}/cancelar":{"post":{"operationId":"cancelarNumero","summary":"Cancel a number without a code (refund)","description":"Path: /numeros/{id}/cancelar. Optional body field: motivo (desistiu, banido, ja_tem_dono, pede_outra_coisa or outro; default outro). With no code and after cancelavel_em, closes the number and refunds the balance. Before that time: 409 cedo with segundos. An already received number returns nao_cancelavel; codigo_recebido can occur if a code arrives during cancellation. Returns 200 with the closed number. This example uses teste_falha after two minutes.","parameters":[{"name":"id","in":"path","required":true,"description":"Number UUID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"motivo":{"$ref":"#/components/schemas/Motivo"}}},"example":{"motivo":"desistiu"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"teste_falha","servico_nome":"Teste sem código","pais":73,"telefone":"+12025550123","status":"cancelado","motivo":"desistiu","preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":"2026-10-08T12:02:01.000Z","substitui_id":null,"cliente_ref":"cliente_abc123","sms":[]}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"404":{"description":"nao_encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"409":{"description":"cedo (with segundos), nao_cancelavel or codigo_recebido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/numeros/{id}/trocar":{"post":{"operationId":"trocarNumero","summary":"Replace a number without a code","description":"Path: /numeros/{id}/trocar. Required body field: preco_maximo_centavos (positive integer); opcao and motivo are optional, using the formats above. Service, country and cliente_ref are inherited from the original number. Requires Idempotency-Key and an aguardando_sms number with a phone, no code and an elapsed cancellation wait. The price is checked before closing the old number. The old number becomes trocado and is refunded; a new purchase returns 201 (a repeat returns 200). If the new purchase fails after the refund, the old number remains trocado: query it and handle the error. This example replaces a teste_falha number after two minutes.","parameters":[{"name":"id","in":"path","required":true,"description":"Number UUID.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"1–64 letters, digits or . _ : -. Reuse the same key when retrying; a recorded key returns the same number with HTTP 200.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Troca"},"example":{"preco_maximo_centavos":83,"motivo":"banido"}}}},"responses":{"200":{"description":"Repeated Idempotency-Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000002","servico":"teste_falha","servico_nome":"Teste sem código","pais":73,"telefone":"+12025550124","status":"aguardando_sms","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:02:01.000Z","cancelavel_em":"2026-10-08T12:04:01.000Z","expira_em":"2026-10-08T12:22:01.000Z","encerrado_em":null,"substitui_id":"5f0c0000-0000-4000-8000-000000000001","cliente_ref":"cliente_abc123","sms":[]}}}},"201":{"description":"New number","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000002","servico":"teste_falha","servico_nome":"Teste sem código","pais":73,"telefone":"+12025550124","status":"aguardando_sms","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:02:01.000Z","cancelavel_em":"2026-10-08T12:04:01.000Z","expira_em":"2026-10-08T12:22:01.000Z","encerrado_em":null,"substitui_id":"5f0c0000-0000-4000-8000-000000000001","cliente_ref":"cliente_abc123","sms":[]}}}},"400":{"description":"parametro_invalido or idempotencia_obrigatoria","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"402":{"description":"saldo_insuficiente","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"404":{"description":"nao_encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"409":{"description":"cedo, codigo_recebido, nao_trocavel, sem_numeros, opcao_indisponivel, preco_acima_do_maximo or preco_subiu","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"502":{"description":"erro_fornecedor or sem_confirmacao","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/numeros/{id}/concluir":{"post":{"operationId":"concluirNumero","summary":"Mark a received code as used","description":"Path: /numeros/{id}/concluir. No body. Confirms the code has been used and closes a recebido number without a refund. Returns 200 with the concluido number; repeating completion or completing without a code returns 409 nao_concluivel.","parameters":[{"name":"id","in":"path","required":true,"description":"Number UUID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Numero"},"example":{"id":"5f0c0000-0000-4000-8000-000000000001","servico":"wa","servico_nome":"WhatsApp","pais":73,"telefone":"+12025550123","status":"concluido","motivo":null,"preco_centavos":83,"preco_site_centavos":120,"moeda":"BRL","criado_em":"2026-10-08T12:00:00.000Z","cancelavel_em":"2026-10-08T12:02:00.000Z","expira_em":"2026-10-08T12:20:00.000Z","encerrado_em":"2026-10-08T12:01:00.000Z","substitui_id":null,"cliente_ref":"cliente_abc123","sms":[{"codigo":"123456","texto":"Seu código de teste: 123456","recebido_em":"2026-10-08T12:00:20.000Z"}]}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"404":{"description":"nao_encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"409":{"description":"nao_concluivel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}},"/extrato":{"get":{"operationId":"extrato","summary":"Account statement","description":"Optional query parameter: pagina (1–1000, default 1). Returns up to 50 account transactions, newest first (purchase, refund, top-up, adjustment), including website transactions in live mode. valor_centavos is signed: negative for debits, positive for credits; saldo_apos_centavos is the balance afterward. numero_id is null when the transaction is unrelated to a number; descricao may be null. The statement does not include moeda: use the currency from GET /saldo. Test statements are separate and always use BRL.","parameters":[{"name":"pagina","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extrato"},"example":{"movimentacoes":[{"id":42,"tipo":"compra","valor_centavos":-83,"saldo_apos_centavos":9917,"descricao":"Número WhatsApp","numero_id":"5f0c0000-0000-4000-8000-000000000001","criado_em":"2026-10-08T12:00:00.000Z"}],"pagina":1,"tem_mais":false}}}},"401":{"description":"nao_autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"429":{"description":"muitas_requisicoes (with Retry-After), or another usage limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}},"500":{"description":"erro_interno","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Erro"}}}}}}}},"webhooks":{"numero.codigo_recebido":{"post":{"operationId":"avisoCodigoRecebido","summary":"A new SMS arrived","description":"Headers X-Ativa-Evento, X-Ativa-Timestamp (Unix seconds) and X-Ativa-Assinatura: lowercase hex HMAC-SHA256 of `timestamp + \".\" + raw body`, keyed with the webhook secret as text. Reject timestamps more than 5 min away; deduplicate by envelope id; reply 2xx within 5 s. Up to 8 attempts.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Aviso"},"example":{"id":"a7100000-0000-4000-8000-000000000001","evento":"numero.codigo_recebido","criado_em":"2026-10-08T12:00:20.000Z","modo":"test","dados":{"id":"5f0c0000-0000-4000-8000-000000000001","cliente_ref":"cliente_abc123","servico":"wa","pais":73,"telefone":"+12025550123","status":"recebido","moeda":"BRL","sms":{"codigo":"123456","texto":"Seu código de teste: 123456","recebido_em":"2026-10-08T12:00:20.000Z"}}}}}},"responses":{"200":{"description":"Received"}}}},"numero.encerrado":{"post":{"operationId":"avisoEncerrado","summary":"A number was closed (concluido, cancelado, trocado, expirado or falhou)","description":"Same headers and signature as numero.codigo_recebido. dados includes motivo, encerrado_em and estornado_centavos.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Aviso"},"example":{"id":"a7100000-0000-4000-8000-000000000002","evento":"numero.encerrado","criado_em":"2026-10-08T12:20:00.000Z","modo":"test","dados":{"id":"5f0c0000-0000-4000-8000-000000000001","cliente_ref":"cliente_abc123","servico":"teste_falha","pais":73,"telefone":"+12025550123","status":"expirado","moeda":"BRL","motivo":"prazo","encerrado_em":"2026-10-08T12:20:00.000Z","estornado_centavos":83}}}}},"responses":{"200":{"description":"Received"}}}}},"components":{"securitySchemes":{"chave":{"type":"http","scheme":"bearer","description":"API key: ativa_live_… (production) or ativa_test_… (test mode). Keep it on your server."}},"schemas":{"Moeda":{"type":"string","enum":["BRL","USD"]},"Status":{"type":"string","enum":["aguardando_sms","recebido","concluido","cancelado","trocado","expirado","falhou"]},"Motivo":{"type":"string","enum":["desistiu","banido","ja_tem_dono","pede_outra_coisa","outro"],"default":"outro"},"Erro":{"type":"object","required":["erro","mensagem"],"properties":{"erro":{"type":"string","enum":["nao_autorizado","parametro_invalido","servico_bloqueado","idempotencia_obrigatoria","saldo_insuficiente","cliente_bloqueado","nao_encontrado","sem_numeros","opcao_indisponivel","preco_acima_do_maximo","preco_subiu","cedo","codigo_recebido","nao_cancelavel","nao_trocavel","nao_concluivel","muitas_requisicoes","limite_abertas","limite_tentativas","limite_tentativas_cliente","erro_fornecedor","sem_confirmacao","erro_interno"]},"mensagem":{"type":"string","description":"Portuguese text; handle erro, not this message."},"campos":{"type":"array","items":{"type":"string"}},"segundos":{"type":"integer"},"preco_centavos":{"type":"integer"},"opcoes":{"type":"array","items":{"$ref":"#/components/schemas/Opcao"}}}},"Saldo":{"type":"object","required":["saldo_centavos","moeda"],"properties":{"saldo_centavos":{"type":"integer"},"moeda":{"$ref":"#/components/schemas/Moeda"}}},"Servico":{"type":"object","required":["codigo","nome"],"properties":{"codigo":{"type":"string"},"nome":{"type":"string"}}},"Pais":{"type":"object","required":["codigo","iso","nome"],"properties":{"codigo":{"type":"integer"},"iso":{"type":"string"},"nome":{"type":"string"},"ddi":{"type":"string"}}},"Opcao":{"type":"object","required":["opcao","preco_centavos","moeda","prazo_min"],"properties":{"opcao":{"type":"string","pattern":"^op_[0-9a-f]{12}$","description":"Opaque; pass it back unchanged."},"preco_centavos":{"type":"integer","description":"Charged to the reseller."},"preco_site_centavos":{"type":["integer","null"],"description":"Website reference price."},"moeda":{"$ref":"#/components/schemas/Moeda"},"prazo_min":{"type":"integer"},"taxa_sucesso":{"type":["number","null"]},"estoque":{"type":["integer","null"]},"recomendada":{"type":"boolean"}}},"Compra":{"type":"object","required":["servico","pais","preco_maximo_centavos","cliente_ref"],"properties":{"servico":{"type":"string","pattern":"^[a-z0-9_]{1,20}$"},"pais":{"type":"integer"},"opcao":{"type":["string","null"],"description":"Optional; the cheapest option is used when omitted."},"preco_maximo_centavos":{"type":"integer","minimum":1,"maximum":2147483647},"cliente_ref":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,64}$","description":"Anonymous end-customer reference. Never an email address or personal identifier."}}},"Troca":{"type":"object","required":["preco_maximo_centavos"],"properties":{"preco_maximo_centavos":{"type":"integer","minimum":1,"maximum":2147483647},"opcao":{"type":["string","null"]},"motivo":{"$ref":"#/components/schemas/Motivo"}}},"Sms":{"type":"object","required":["recebido_em"],"properties":{"codigo":{"type":["string","null"]},"texto":{"type":["string","null"]},"recebido_em":{"type":"string","format":"date-time"}}},"Numero":{"type":"object","required":["id","servico","pais","status","preco_centavos","moeda","cliente_ref","sms"],"properties":{"id":{"type":"string","format":"uuid"},"servico":{"type":"string"},"servico_nome":{"type":"string"},"pais":{"type":"integer"},"telefone":{"type":["string","null"],"description":"International format with +; null while the reservation is in progress."},"status":{"$ref":"#/components/schemas/Status"},"motivo":{"type":["string","null"]},"preco_centavos":{"type":"integer"},"preco_site_centavos":{"type":["integer","null"]},"moeda":{"$ref":"#/components/schemas/Moeda"},"criado_em":{"type":"string","format":"date-time"},"cancelavel_em":{"type":["string","null"],"format":"date-time"},"expira_em":{"type":["string","null"],"format":"date-time"},"encerrado_em":{"type":["string","null"],"format":"date-time"},"substitui_id":{"type":["string","null"],"format":"uuid"},"cliente_ref":{"type":"string"},"sms":{"type":"array","items":{"$ref":"#/components/schemas/Sms"}}}},"ListaNumeros":{"type":"object","required":["numeros","pagina","tem_mais"],"properties":{"numeros":{"type":"array","items":{"$ref":"#/components/schemas/Numero"}},"pagina":{"type":"integer"},"tem_mais":{"type":"boolean"}}},"Movimentacao":{"type":"object","required":["id","tipo","valor_centavos","saldo_apos_centavos","criado_em"],"properties":{"id":{"type":"integer"},"tipo":{"type":"string","description":"compra, estorno, recarga or ajuste"},"valor_centavos":{"type":"integer","description":"Negative for debits."},"saldo_apos_centavos":{"type":"integer"},"descricao":{"type":["string","null"]},"numero_id":{"type":["string","null"],"format":"uuid"},"criado_em":{"type":"string","format":"date-time"}}},"Extrato":{"type":"object","required":["movimentacoes","pagina","tem_mais"],"properties":{"movimentacoes":{"type":"array","items":{"$ref":"#/components/schemas/Movimentacao"}},"pagina":{"type":"integer"},"tem_mais":{"type":"boolean"}}},"Aviso":{"type":"object","required":["id","evento","criado_em","dados"],"properties":{"id":{"type":"string","format":"uuid","description":"Notification id (deduplicate by it)."},"evento":{"type":"string"},"criado_em":{"type":"string","format":"date-time"},"modo":{"type":"string","enum":["test"],"description":"Present only for test-mode numbers."},"dados":{"type":"object"}}}}}}