curl
curl -X POST 'https://api.velan.app/v1/developer/subscriptions/c2890e30-073a-41eb-855d-3895cc18e30d/charges' \
-H 'Authorization: Bearer $VELAN_KEY' \
-H 'Idempotency-Key: cobranca-2026-12-0042' \
-H 'Content-Type: application/json' \
-d '{"description": "Cobrança combinada com o cliente", "due_date": "2026-11-25"}'import requests
url = "https://api.velan.app/v1/developer/subscriptions/{code}/charges"
payload = {
"description": "Cobrança combinada com o cliente",
"due_date": "2026-11-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Cobrança combinada com o cliente', due_date: '2026-11-25'})
};
fetch('https://api.velan.app/v1/developer/subscriptions/{code}/charges', 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://api.velan.app/v1/developer/subscriptions/{code}/charges",
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([
'description' => 'Cobrança combinada com o cliente',
'due_date' => '2026-11-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.velan.app/v1/developer/subscriptions/{code}/charges"
payload := strings.NewReader("{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.velan.app/v1/developer/subscriptions/{code}/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velan.app/v1/developer/subscriptions/{code}/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"charge": {
"amount": "49.90",
"created_at": "2026-11-22T03:14:41.914087+00:00",
"expires_at": "2026-11-25T03:14:41.914802+00:00",
"order_code": "2325a169-d810-4d72-b8c9-e7e560c2f9ce",
"order_human_id": "VL000003",
"payment_method": "pix",
"short_url": "https://pay.velan.app/r/x4fy8k2y",
"state": "payable",
"url": "https://pay.velan.app/s/pagar/pyt1tqaz/2325a169-d810-4d72-b8c9-e7e560c2f9ce"
},
"due_date": "2026-11-25",
"issued": true,
"link": "https://pay.velan.app/r/x4fy8k2y",
"message": null,
"subscription": {
"amount": "49.90",
"billing_cycle": "monthly",
"cancelled_at": null,
"charges_count": 1,
"code": "c2890e30-073a-41eb-855d-3895cc18e30d",
"current_period_end": "2026-12-02T03:14:41.515551+00:00",
"customer": {
"email": "joao@exemplo.com",
"name": "João Silva",
"phone": "5511900000001"
},
"gateway": "mercadopago",
"next_charge_amount": null,
"next_charge_at": "2026-11-26T02:59:00+00:00",
"payment_method": "pix",
"plan": {
"code": "pyt1tqaz",
"name": "Mensal"
},
"status": "active"
},
"whatsapp_text": "Olá, João! Segue o link para pagar a renovação da sua assinatura Mensal (R$ 49,90), válido até 25/11 00:14: https://pay.velan.app/r/x4fy8k2y",
"whatsapp_url": "https://wa.me/5511900000001?text=Ol%C3%A1%2C%20Jo%C3%A3o%21%20Segue%20o%20link%20para%20pagar%20a%20renova%C3%A7%C3%A3o%20da%20sua%20assinatura%20Mensal%20%28R%24%2049%2C90%29%2C%20v%C3%A1lido%20at%C3%A9%2025/11%2000%3A14%3A%20https%3A//pay.velan.app/r/x4fy8k2y"
}
}{
"error": {
"type": "validation_error",
"message": "Campos não aceitos nesta rota.",
"fields": {
"confirmm": "Campo desconhecido."
}
}
}{
"error": {
"type": "authentication_error",
"message": "Envie Authorization: Bearer <chave de API>."
}
}{
"error": {
"type": "permission_error",
"message": "Esta chave não tem permissão de escrita em 'webhooks'. Crie uma chave com essa permissão."
}
}{
"error": {
"type": "not_found",
"message": "Assinatura não encontrada."
}
}{
"error": {
"type": "conflict",
"message": "Idempotency-Key já usada com outra requisição. Gere uma chave nova para uma operação nova."
}
}{
"error": {
"type": "unprocessable",
"message": "Descreva o motivo com pelo menos 5 caracteres."
}
}{
"error": {
"type": "rate_limited",
"message": "Limite de 30 alterações por minuto atingido."
}
}Assinaturas
Gerar cobrança PIX/boleto do ciclo
Emite agora a cobrança PIX ou boleto do ciclo de uma assinatura PIX/boleto (active ou past_due), com vencimento em due_date. O valor é o da próxima cobrança. O PIX também vai por e-mail ao assinante, e a régua automática só volta a cobrar depois do vencimento. A resposta traz link, whatsapp_text e whatsapp_url. Assinatura no cartão é recusada (422): use POST /subscriptions/{code}/payment-link. Se já existe cobrança pagável, prefira a rota de link. Quando o assinante paga, os webhooks recebem order.paid.
Permissão: write:billing ou write. Idempotency-Key: obrigatório. Prévia: não tem; a chamada executa.
POST
/
subscriptions
/
{code}
/
charges
curl
curl -X POST 'https://api.velan.app/v1/developer/subscriptions/c2890e30-073a-41eb-855d-3895cc18e30d/charges' \
-H 'Authorization: Bearer $VELAN_KEY' \
-H 'Idempotency-Key: cobranca-2026-12-0042' \
-H 'Content-Type: application/json' \
-d '{"description": "Cobrança combinada com o cliente", "due_date": "2026-11-25"}'import requests
url = "https://api.velan.app/v1/developer/subscriptions/{code}/charges"
payload = {
"description": "Cobrança combinada com o cliente",
"due_date": "2026-11-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Cobrança combinada com o cliente', due_date: '2026-11-25'})
};
fetch('https://api.velan.app/v1/developer/subscriptions/{code}/charges', 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://api.velan.app/v1/developer/subscriptions/{code}/charges",
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([
'description' => 'Cobrança combinada com o cliente',
'due_date' => '2026-11-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.velan.app/v1/developer/subscriptions/{code}/charges"
payload := strings.NewReader("{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.velan.app/v1/developer/subscriptions/{code}/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velan.app/v1/developer/subscriptions/{code}/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Cobrança combinada com o cliente\",\n \"due_date\": \"2026-11-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"charge": {
"amount": "49.90",
"created_at": "2026-11-22T03:14:41.914087+00:00",
"expires_at": "2026-11-25T03:14:41.914802+00:00",
"order_code": "2325a169-d810-4d72-b8c9-e7e560c2f9ce",
"order_human_id": "VL000003",
"payment_method": "pix",
"short_url": "https://pay.velan.app/r/x4fy8k2y",
"state": "payable",
"url": "https://pay.velan.app/s/pagar/pyt1tqaz/2325a169-d810-4d72-b8c9-e7e560c2f9ce"
},
"due_date": "2026-11-25",
"issued": true,
"link": "https://pay.velan.app/r/x4fy8k2y",
"message": null,
"subscription": {
"amount": "49.90",
"billing_cycle": "monthly",
"cancelled_at": null,
"charges_count": 1,
"code": "c2890e30-073a-41eb-855d-3895cc18e30d",
"current_period_end": "2026-12-02T03:14:41.515551+00:00",
"customer": {
"email": "joao@exemplo.com",
"name": "João Silva",
"phone": "5511900000001"
},
"gateway": "mercadopago",
"next_charge_amount": null,
"next_charge_at": "2026-11-26T02:59:00+00:00",
"payment_method": "pix",
"plan": {
"code": "pyt1tqaz",
"name": "Mensal"
},
"status": "active"
},
"whatsapp_text": "Olá, João! Segue o link para pagar a renovação da sua assinatura Mensal (R$ 49,90), válido até 25/11 00:14: https://pay.velan.app/r/x4fy8k2y",
"whatsapp_url": "https://wa.me/5511900000001?text=Ol%C3%A1%2C%20Jo%C3%A3o%21%20Segue%20o%20link%20para%20pagar%20a%20renova%C3%A7%C3%A3o%20da%20sua%20assinatura%20Mensal%20%28R%24%2049%2C90%29%2C%20v%C3%A1lido%20at%C3%A9%2025/11%2000%3A14%3A%20https%3A//pay.velan.app/r/x4fy8k2y"
}
}{
"error": {
"type": "validation_error",
"message": "Campos não aceitos nesta rota.",
"fields": {
"confirmm": "Campo desconhecido."
}
}
}{
"error": {
"type": "authentication_error",
"message": "Envie Authorization: Bearer <chave de API>."
}
}{
"error": {
"type": "permission_error",
"message": "Esta chave não tem permissão de escrita em 'webhooks'. Crie uma chave com essa permissão."
}
}{
"error": {
"type": "not_found",
"message": "Assinatura não encontrada."
}
}{
"error": {
"type": "conflict",
"message": "Idempotency-Key já usada com outra requisição. Gere uma chave nova para uma operação nova."
}
}{
"error": {
"type": "unprocessable",
"message": "Descreva o motivo com pelo menos 5 caracteres."
}
}{
"error": {
"type": "rate_limited",
"message": "Limite de 30 alterações por minuto atingido."
}
}Authorizations
Headers
Path Parameters
Body
application/json
