Adicionar uma nova assinatura
curl --request POST \
--url https://sandbox.api.veepag.com/v2/subscription \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "company_id",
"productId": "product_id",
"clientId": "client_id",
"dueDate": "2026-07-23",
"paymentMethod": "CREDIT_CARD"
}
'import requests
url = "https://sandbox.api.veepag.com/v2/subscription"
payload = {
"companyId": "company_id",
"productId": "product_id",
"clientId": "client_id",
"dueDate": "2026-07-23",
"paymentMethod": "CREDIT_CARD"
}
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',
productId: 'product_id',
clientId: 'client_id',
dueDate: '2026-07-23',
paymentMethod: 'CREDIT_CARD'
})
};
fetch('https://sandbox.api.veepag.com/v2/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/v2/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',
'productId' => 'product_id',
'clientId' => 'client_id',
'dueDate' => '2026-07-23',
'paymentMethod' => 'CREDIT_CARD'
]),
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/v2/subscription"
payload := strings.NewReader("{\n \"companyId\": \"company_id\",\n \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\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/v2/subscription")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"company_id\",\n \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v2/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 \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"_id": "subscription_id",
"status": "CREATED"
},
"charge": {
"_id": "charge_id",
"status": "ACTIVE"
}
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v2/subscription",
"metadata": {}
}Subscription
Adicionar uma nova assinatura
Cria uma assinatura e uma cobranca para um cliente existente, sem tentar pagamento imediato.
POST
/
v2
/
subscription
Adicionar uma nova assinatura
curl --request POST \
--url https://sandbox.api.veepag.com/v2/subscription \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "company_id",
"productId": "product_id",
"clientId": "client_id",
"dueDate": "2026-07-23",
"paymentMethod": "CREDIT_CARD"
}
'import requests
url = "https://sandbox.api.veepag.com/v2/subscription"
payload = {
"companyId": "company_id",
"productId": "product_id",
"clientId": "client_id",
"dueDate": "2026-07-23",
"paymentMethod": "CREDIT_CARD"
}
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',
productId: 'product_id',
clientId: 'client_id',
dueDate: '2026-07-23',
paymentMethod: 'CREDIT_CARD'
})
};
fetch('https://sandbox.api.veepag.com/v2/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/v2/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',
'productId' => 'product_id',
'clientId' => 'client_id',
'dueDate' => '2026-07-23',
'paymentMethod' => 'CREDIT_CARD'
]),
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/v2/subscription"
payload := strings.NewReader("{\n \"companyId\": \"company_id\",\n \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\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/v2/subscription")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"company_id\",\n \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v2/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 \"productId\": \"product_id\",\n \"clientId\": \"client_id\",\n \"dueDate\": \"2026-07-23\",\n \"paymentMethod\": \"CREDIT_CARD\"\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"_id": "subscription_id",
"status": "CREATED"
},
"charge": {
"_id": "charge_id",
"status": "ACTIVE"
}
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v2/subscription",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v2/subscription",
"metadata": {}
}Authorizations
api_keytoken
API key no formato keyId.secret.
Body
application/json
ID da empresa da assinatura.
Minimum string length:
1ID do produto usado na assinatura v2.
Minimum string length:
1ID de um cliente ja cadastrado na Veepag.
Minimum string length:
1Data de vencimento usada para criar a primeira cobranca.
Referencia externa da sua aplicacao para a assinatura.
Metadados livres para conciliacao e suporte.
Show child attributes
Show child attributes
Metodos de pagamento disponiveis para a assinatura.
Available options:
CREDIT_CARD, DEBIT_CARD, BOLETO, PIX Origem da criacao da assinatura, quando informada.
Available options:
API, CHECKOUT, IMPORTED, AFFILIATE ID do afiliado vinculado, quando houver.
Was this page helpful?
⌘I
