Capturar uma transação
curl --request POST \
--url https://sandbox.api.veepag.com/v1/transaction/capture \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "<string>",
"tid": "<string>",
"transactionId": "<string>",
"amount": 123
}
'import requests
url = "https://sandbox.api.veepag.com/v1/transaction/capture"
payload = {
"companyId": "<string>",
"tid": "<string>",
"transactionId": "<string>",
"amount": 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: '<string>', tid: '<string>', transactionId: '<string>', amount: 123})
};
fetch('https://sandbox.api.veepag.com/v1/transaction/capture', 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/transaction/capture",
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' => '<string>',
'tid' => '<string>',
'transactionId' => '<string>',
'amount' => 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/transaction/capture"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\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/transaction/capture")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v1/transaction/capture")
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\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"data": {}
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v1/transaction/capture",
"metadata": {}
}Transaction
Capturar uma transação
Captura uma transacao previamente autorizada usando transactionId ou tid. O fluxo atual captura o valor salvo na transacao (transaction.amount.value); o campo amount do request nao e usado.
POST
/
v1
/
transaction
/
capture
Capturar uma transação
curl --request POST \
--url https://sandbox.api.veepag.com/v1/transaction/capture \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--data '
{
"companyId": "<string>",
"tid": "<string>",
"transactionId": "<string>",
"amount": 123
}
'import requests
url = "https://sandbox.api.veepag.com/v1/transaction/capture"
payload = {
"companyId": "<string>",
"tid": "<string>",
"transactionId": "<string>",
"amount": 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: '<string>', tid: '<string>', transactionId: '<string>', amount: 123})
};
fetch('https://sandbox.api.veepag.com/v1/transaction/capture', 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/transaction/capture",
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' => '<string>',
'tid' => '<string>',
'transactionId' => '<string>',
'amount' => 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/transaction/capture"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\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/transaction/capture")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.veepag.com/v1/transaction/capture")
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\": \"<string>\",\n \"tid\": \"<string>\",\n \"transactionId\": \"<string>\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"data": {}
}{
"error_messages": [
{
"msg": "Payload invalido.",
"type": "field",
"path": "companyId",
"location": "body"
}
],
"code": "ZodValidationException",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unauthorized."
}
],
"code": "unauthorized",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Forbidden."
}
],
"code": "forbidden",
"path": "/v1/transaction/capture",
"metadata": {}
}{
"error_messages": [
{
"msg": "Unknown server error."
}
],
"code": "unknown_server_error",
"path": "/v1/transaction/capture",
"metadata": {}
}Authorizations
api_keytoken
API key no formato keyId.secret.
Body
application/json
Response
Resposta do acquirer. O status HTTP pode variar conforme o provider.
The response is of type object.
Was this page helpful?
⌘I
