Simular resultado (teste)
curl --request POST \
--url https://open.velan.app/v1/payment-links/{id}/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "paid"
}
'import requests
url = "https://open.velan.app/v1/payment-links/{id}/simulate"
payload = { "outcome": "paid" }
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({outcome: 'paid'})
};
fetch('https://open.velan.app/v1/payment-links/{id}/simulate', 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://open.velan.app/v1/payment-links/{id}/simulate",
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([
'outcome' => 'paid'
]),
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://open.velan.app/v1/payment-links/{id}/simulate"
payload := strings.NewReader("{\n \"outcome\": \"paid\"\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://open.velan.app/v1/payment-links/{id}/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"paid\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.velan.app/v1/payment-links/{id}/simulate")
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 \"outcome\": \"paid\"\n}"
response = http.request(request)
puts response.read_body{
"object": "payment_link",
"id": "<string>",
"livemode": true,
"status": "active",
"type": "offer",
"offer_code": "<string>",
"plan_code": "<string>",
"url": "<string>",
"short_url": "<string>",
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>"
},
"external_reference": "<string>",
"metadata": {},
"coupon_code": "<string>",
"single_use": true,
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"order": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"amount": "1000.00",
"payment_method": "<string>",
"paid_at": "2023-11-07T05:31:56Z"
},
"simulation": {
"event": "order.paid",
"webhooks": [
{
"integration_id": 123,
"destination": "<string>",
"success": true,
"status": 123
}
]
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}Referência da API de pagamentos
Simular resultado (teste)
Só com chave vk_test_…. Simula o resultado do link e dispara os webhooks do tipo webhook com "test": true. Não cria pedido nem cobra nada.
POST
/
v1
/
payment-links
/
{id}
/
simulate
Simular resultado (teste)
curl --request POST \
--url https://open.velan.app/v1/payment-links/{id}/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "paid"
}
'import requests
url = "https://open.velan.app/v1/payment-links/{id}/simulate"
payload = { "outcome": "paid" }
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({outcome: 'paid'})
};
fetch('https://open.velan.app/v1/payment-links/{id}/simulate', 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://open.velan.app/v1/payment-links/{id}/simulate",
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([
'outcome' => 'paid'
]),
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://open.velan.app/v1/payment-links/{id}/simulate"
payload := strings.NewReader("{\n \"outcome\": \"paid\"\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://open.velan.app/v1/payment-links/{id}/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"paid\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.velan.app/v1/payment-links/{id}/simulate")
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 \"outcome\": \"paid\"\n}"
response = http.request(request)
puts response.read_body{
"object": "payment_link",
"id": "<string>",
"livemode": true,
"status": "active",
"type": "offer",
"offer_code": "<string>",
"plan_code": "<string>",
"url": "<string>",
"short_url": "<string>",
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"document": "<string>"
},
"external_reference": "<string>",
"metadata": {},
"coupon_code": "<string>",
"single_use": true,
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"order": {
"code": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"amount": "1000.00",
"payment_method": "<string>",
"paid_at": "2023-11-07T05:31:56Z"
},
"simulation": {
"event": "order.paid",
"webhooks": [
{
"integration_id": 123,
"destination": "<string>",
"success": true,
"status": 123
}
]
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}{
"error": {
"type": "validation_error",
"message": "<string>",
"fields": {},
"retry_after_seconds": 123
}
}Authorizations
Chave criada no painel em Configurações → Chaves de API → Nova chave → API de pagamentos (dash.velan.app/dashboard/settings/api-keys).
Path Parameters
Identificador do link (id devolvido na criação).
Body
application/json
paid → order.paid; failed → order.payment_declined (link segue ativo); expired → order.expired.
Available options:
paid, failed, expired Response
Simulação aplicada.
false para links criados com chave de teste.
Available options:
active, paid, expired, canceled Available options:
offer, plan Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
