curl --request POST \
--url https://sandbox.api.veepag.com/v1/subscription \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "company_id",
"product": {
"id": "product_id"
},
"paymentMethod": "CREDIT_CARD",
"installments": 1,
"client": {
"name": "Cliente Teste",
"doc": "12345678909",
"email": "cliente@example.com"
},
"paymentProfile": {
"holderName": "CLIENTE TESTE",
"cardNumber": "4111111111111111",
"cardExpiration": "10/2026",
"cardCvv": "123"
},
"metadata": {
"externalOrderId": "pedido_123"
}
}
'import requests
url = "https://sandbox.api.veepag.com/v1/subscription"
payload = {
"companyId": "company_id",
"product": { "id": "product_id" },
"paymentMethod": "CREDIT_CARD",
"installments": 1,
"client": {
"name": "Cliente Teste",
"doc": "12345678909",
"email": "cliente@example.com"
},
"paymentProfile": {
"holderName": "CLIENTE TESTE",
"cardNumber": "4111111111111111",
"cardExpiration": "10/2026",
"cardCvv": "123"
},
"metadata": { "externalOrderId": "pedido_123" }
}
headers = {
"apiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apiKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: 'company_id',
product: {id: 'product_id'},
paymentMethod: 'CREDIT_CARD',
installments: 1,
client: {name: 'Cliente Teste', doc: '12345678909', email: 'cliente@example.com'},
paymentProfile: {
holderName: 'CLIENTE TESTE',
cardNumber: '4111111111111111',
cardExpiration: '10/2026',
cardCvv: '123'
},
metadata: {externalOrderId: 'pedido_123'}
})
};
fetch('https://sandbox.api.veepag.com/v1/subscription', 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://sandbox.api.veepag.com/v1/subscription",
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([
'companyId' => 'company_id',
'product' => [
'id' => 'product_id'
],
'paymentMethod' => 'CREDIT_CARD',
'installments' => 1,
'client' => [
'name' => 'Cliente Teste',
'doc' => '12345678909',
'email' => 'cliente@example.com'
],
'paymentProfile' => [
'holderName' => 'CLIENTE TESTE',
'cardNumber' => '4111111111111111',
'cardExpiration' => '10/2026',
'cardCvv' => '123'
],
'metadata' => [
'externalOrderId' => 'pedido_123'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <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://sandbox.api.veepag.com/v1/subscription"
payload := strings.NewReader("{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<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://sandbox.api.veepag.com/v1/subscription")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "subscription_id",
"transactionId": [
"transaction_id"
],
"status": "ACTIVE",
"paymentMethod": "CREDIT_CARD",
"charge": {
"statusCode": 200,
"amount": {
"value": 9900,
"currency": "BRL"
},
"status": "PAID",
"message": "Pagamento aprovado",
"acquirer": {},
"qrCode": null,
"boleto": null
},
"nextCharge": "2026-07-23T12:00:00.000Z"
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v1/subscription",
"metadata": {}
}Adicionar uma nova assinatura
Cria uma assinatura, gera a cobranca e tenta o pagamento imediato. A resposta confirma a assinatura criada e traz o resultado da tentativa de pagamento dentro de charge.
curl --request POST \
--url https://sandbox.api.veepag.com/v1/subscription \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "company_id",
"product": {
"id": "product_id"
},
"paymentMethod": "CREDIT_CARD",
"installments": 1,
"client": {
"name": "Cliente Teste",
"doc": "12345678909",
"email": "cliente@example.com"
},
"paymentProfile": {
"holderName": "CLIENTE TESTE",
"cardNumber": "4111111111111111",
"cardExpiration": "10/2026",
"cardCvv": "123"
},
"metadata": {
"externalOrderId": "pedido_123"
}
}
'import requests
url = "https://sandbox.api.veepag.com/v1/subscription"
payload = {
"companyId": "company_id",
"product": { "id": "product_id" },
"paymentMethod": "CREDIT_CARD",
"installments": 1,
"client": {
"name": "Cliente Teste",
"doc": "12345678909",
"email": "cliente@example.com"
},
"paymentProfile": {
"holderName": "CLIENTE TESTE",
"cardNumber": "4111111111111111",
"cardExpiration": "10/2026",
"cardCvv": "123"
},
"metadata": { "externalOrderId": "pedido_123" }
}
headers = {
"apiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apiKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: 'company_id',
product: {id: 'product_id'},
paymentMethod: 'CREDIT_CARD',
installments: 1,
client: {name: 'Cliente Teste', doc: '12345678909', email: 'cliente@example.com'},
paymentProfile: {
holderName: 'CLIENTE TESTE',
cardNumber: '4111111111111111',
cardExpiration: '10/2026',
cardCvv: '123'
},
metadata: {externalOrderId: 'pedido_123'}
})
};
fetch('https://sandbox.api.veepag.com/v1/subscription', 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://sandbox.api.veepag.com/v1/subscription",
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([
'companyId' => 'company_id',
'product' => [
'id' => 'product_id'
],
'paymentMethod' => 'CREDIT_CARD',
'installments' => 1,
'client' => [
'name' => 'Cliente Teste',
'doc' => '12345678909',
'email' => 'cliente@example.com'
],
'paymentProfile' => [
'holderName' => 'CLIENTE TESTE',
'cardNumber' => '4111111111111111',
'cardExpiration' => '10/2026',
'cardCvv' => '123'
],
'metadata' => [
'externalOrderId' => 'pedido_123'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <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://sandbox.api.veepag.com/v1/subscription"
payload := strings.NewReader("{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiKey", "<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://sandbox.api.veepag.com/v1/subscription")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": \"company_id\",\n \"product\": {\n \"id\": \"product_id\"\n },\n \"paymentMethod\": \"CREDIT_CARD\",\n \"installments\": 1,\n \"client\": {\n \"name\": \"Cliente Teste\",\n \"doc\": \"12345678909\",\n \"email\": \"cliente@example.com\"\n },\n \"paymentProfile\": {\n \"holderName\": \"CLIENTE TESTE\",\n \"cardNumber\": \"4111111111111111\",\n \"cardExpiration\": \"10/2026\",\n \"cardCvv\": \"123\"\n },\n \"metadata\": {\n \"externalOrderId\": \"pedido_123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "subscription_id",
"transactionId": [
"transaction_id"
],
"status": "ACTIVE",
"paymentMethod": "CREDIT_CARD",
"charge": {
"statusCode": 200,
"amount": {
"value": 9900,
"currency": "BRL"
},
"status": "PAID",
"message": "Pagamento aprovado",
"acquirer": {},
"qrCode": null,
"boleto": null
},
"nextCharge": "2026-07-23T12:00:00.000Z"
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v1/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v1/subscription",
"metadata": {}
}Authorizations
API key no formato keyId.secret.
Body
ID da empresa da assinatura.
1Objeto com o ID do produto usado na assinatura v1.
Show child attributes
Show child attributes
Meio de pagamento usado na tentativa inicial.
CREDIT_CARD, DEBIT_CARD, BOLETO, PIX Quantidade de parcelas da assinatura.
Referencia externa da sua aplicacao para a assinatura.
Origem da criacao da assinatura, quando informada.
API, CHECKOUT, IMPORTED, AFFILIATE Token de captcha usado em fluxos que exigem captcha.
Metadados livres para conciliacao e suporte.
Show child attributes
Show child attributes
Dados de pagamento, obrigatorios para cartao.
Show child attributes
Show child attributes
ID de autorizacao de cartao, quando usado no fluxo.
Dados do cliente enviados inline para criar a assinatura v1.
Show child attributes
Show child attributes
ID do afiliado vinculado, quando houver.
URL relacionada ao fluxo, quando informada.
Response
Assinatura criada e pagamento tentado.
Identificador da assinatura criada.
"subscription_id"
Lista de transacoes criadas durante a tentativa de pagamento.
["transaction_id"]
Status atual da assinatura depois da tentativa de cobranca.
ACTIVE, ERROR_PAYMENT, NO_PAYMENT_ROUTE, CREATED, PENDING_PAYMENT, RECOVERED, NO_PAYMENT, CANCELED_ALERT_ETHOCA, BLOCKED, CANCELED_MANUAL, IMPORTED, STANDBY, OVERDUE Proxima data de cobranca da assinatura, quando disponivel.
Meio de pagamento usado na tentativa.
CREDIT_CARD, DEBIT_CARD, BOLETO, PIX Resultado da cobranca e da tentativa de pagamento feita pelo endpoint v1.
Show child attributes
Show child attributes
Was this page helpful?
