Direct Payment
curl --request POST \
--url https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-date: <api-key>' \
--header 'x-login: <api-key>' \
--header 'x-trans-key: <api-key>' \
--data '
{
"method_id": "10",
"payment_data": {
"card_type": "tdc",
"card_number": "4111111111111111",
"cvc": "123",
"exp_month": "12",
"exp_year": "25",
"card_holder": "JUAN PEREZ",
"installments": "1",
"email": "juan.perez@example.com"
}
}
'import requests
url = "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment"
payload = {
"method_id": "10",
"payment_data": {
"card_type": "tdc",
"card_number": "4111111111111111",
"cvc": "123",
"exp_month": "12",
"exp_year": "25",
"card_holder": "JUAN PEREZ",
"installments": "1",
"email": "juan.perez@example.com"
}
}
headers = {
"x-login": "<api-key>",
"x-trans-key": "<api-key>",
"x-date": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-login': '<api-key>',
'x-trans-key': '<api-key>',
'x-date': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method_id: '10',
payment_data: {
card_type: 'tdc',
card_number: '4111111111111111',
cvc: '123',
exp_month: '12',
exp_year: '25',
card_holder: 'JUAN PEREZ',
installments: '1',
email: 'juan.perez@example.com'
}
})
};
fetch('https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment', 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.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment",
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([
'method_id' => '10',
'payment_data' => [
'card_type' => 'tdc',
'card_number' => '4111111111111111',
'cvc' => '123',
'exp_month' => '12',
'exp_year' => '25',
'card_holder' => 'JUAN PEREZ',
'installments' => '1',
'email' => 'juan.perez@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-date: <api-key>",
"x-login: <api-key>",
"x-trans-key: <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://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment"
payload := strings.NewReader("{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-login", "<api-key>")
req.Header.Add("x-trans-key", "<api-key>")
req.Header.Add("x-date", "<api-key>")
req.Header.Add("Authorization", "<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://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment")
.header("x-login", "<api-key>")
.header("x-trans-key", "<api-key>")
.header("x-date", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-login"] = '<api-key>'
request["x-trans-key"] = '<api-key>'
request["x-date"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 106,
"type": "payment_order",
"attributes": {
"payment_order_attempt_id": "869a6c-6bd4-49f4-a4dc-a292fa7f2ab5",
"public_code": "fac7e1b1-37d4-45eb-a4d3-90b7c1fe1b",
"status": "pending",
"amount": 100000,
"currency": "COP",
"payment_method": {
"id": 5,
"name": "PSE"
},
"payment_info": {
"provider_url": "https://api-sandbox/v1/pse/redirect?ticket_id=139980177704970476794",
"provider_payment_id": "pse_co"
},
"payer": {
"name": "Juan Perez",
"document": 1020304050,
"email": "juan.perez@example.com"
},
"costs": {
"spread": 2,
"spread_type": "percentage",
"fixed_cost": 1,
"sell_price": 0.0002352
}
}
}
}Direct Payment
Direct Payment
Process a direct payment without redirection. This endpoint allows processing payments directly with customer data.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Payment order ID |
payment_data | object | Payment data according to method |
payment_order_attempt_id | string | Payment order attempt ID |
Payment Order Attempt ID
You can now obtain the payment order attempt ID to see the status of each payment attempt.
/api/businesses/payment_orders//attempts/
Required fields by method
Click a country to see the payment_data payload expected by each method.
Argentina
CVU
{"payment_data":{}}
QR
{"payment_data":{}}
Chile
Webpay
{"payment_data":{"first_name":"Pedro","last_name":"Martínez","email":"pedro.martinez@example.com"}}
Fintoc
{"payment_data":{}}
Colombia
BreB
{"payment_data":{}}
PSE
{
"payment_data": {
"bank_id": "1007",
"document_number": "12345678",
"document_type": "CC",
"first_name": "María",
"last_name": "García",
"phone": "+573001234567"
}
}
Nequi
{"payment_data":{"phone":"+573001234567","email":"usuario@example.com"}}
Daviplata
{"payment_data":{"document_type":"CC","document_number":"12345678","email":"ana.garcia@example.com"}}
Bancolombia
{"payment_data":{"email":"carlos.rodriguez@example.com"}}
TDC (Credit/Debit Cards)
{
"payment_data": {
"card_type": "tdc",
"card_number": "4111111111111111",
"cvc": "123",
"exp_month": "12",
"exp_year": "25",
"card_holder": "JUAN PEREZ",
"installments": "1",
"email": "juan.perez@example.com"
}
}
Bancolombia BNPL (Buy Now Pay Later)
{
"payment_data": {
"first_name": "María",
"last_name": "López",
"document_number": "11223344",
"document_type": "CC",
"phone": "+573001234567"
}
}
México
CLABE Transfer
{"payment_data":{"first_name":"Miguel","last_name":"Hernández"}}
Brasil
PIX QR
{"payment_data":{"document_number":"12345678901","email":"usuario@example.com","first_name":"João","last_name":"Silva"}}
Error Responses
-
400: Missing required fields or invalid format
-
401: Invalid authentication credentials
-
404: Payment order not found
-
422: Validation error
-
500: Internal server error
POST
/
api
/
businesses
/
payment_orders
/
{payment_order_id}
/
direct_payment
Direct Payment
curl --request POST \
--url https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-date: <api-key>' \
--header 'x-login: <api-key>' \
--header 'x-trans-key: <api-key>' \
--data '
{
"method_id": "10",
"payment_data": {
"card_type": "tdc",
"card_number": "4111111111111111",
"cvc": "123",
"exp_month": "12",
"exp_year": "25",
"card_holder": "JUAN PEREZ",
"installments": "1",
"email": "juan.perez@example.com"
}
}
'import requests
url = "https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment"
payload = {
"method_id": "10",
"payment_data": {
"card_type": "tdc",
"card_number": "4111111111111111",
"cvc": "123",
"exp_month": "12",
"exp_year": "25",
"card_holder": "JUAN PEREZ",
"installments": "1",
"email": "juan.perez@example.com"
}
}
headers = {
"x-login": "<api-key>",
"x-trans-key": "<api-key>",
"x-date": "<api-key>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-login': '<api-key>',
'x-trans-key': '<api-key>',
'x-date': '<api-key>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
method_id: '10',
payment_data: {
card_type: 'tdc',
card_number: '4111111111111111',
cvc: '123',
exp_month: '12',
exp_year: '25',
card_holder: 'JUAN PEREZ',
installments: '1',
email: 'juan.perez@example.com'
}
})
};
fetch('https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment', 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.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment",
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([
'method_id' => '10',
'payment_data' => [
'card_type' => 'tdc',
'card_number' => '4111111111111111',
'cvc' => '123',
'exp_month' => '12',
'exp_year' => '25',
'card_holder' => 'JUAN PEREZ',
'installments' => '1',
'email' => 'juan.perez@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"x-date: <api-key>",
"x-login: <api-key>",
"x-trans-key: <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://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment"
payload := strings.NewReader("{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-login", "<api-key>")
req.Header.Add("x-trans-key", "<api-key>")
req.Header.Add("x-date", "<api-key>")
req.Header.Add("Authorization", "<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://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment")
.header("x-login", "<api-key>")
.header("x-trans-key", "<api-key>")
.header("x-date", "<api-key>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vitawallet.io/api/businesses/payment_orders/{payment_order_id}/direct_payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-login"] = '<api-key>'
request["x-trans-key"] = '<api-key>'
request["x-date"] = '<api-key>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method_id\": \"10\",\n \"payment_data\": {\n \"card_type\": \"tdc\",\n \"card_number\": \"4111111111111111\",\n \"cvc\": \"123\",\n \"exp_month\": \"12\",\n \"exp_year\": \"25\",\n \"card_holder\": \"JUAN PEREZ\",\n \"installments\": \"1\",\n \"email\": \"juan.perez@example.com\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 106,
"type": "payment_order",
"attributes": {
"payment_order_attempt_id": "869a6c-6bd4-49f4-a4dc-a292fa7f2ab5",
"public_code": "fac7e1b1-37d4-45eb-a4d3-90b7c1fe1b",
"status": "pending",
"amount": 100000,
"currency": "COP",
"payment_method": {
"id": 5,
"name": "PSE"
},
"payment_info": {
"provider_url": "https://api-sandbox/v1/pse/redirect?ticket_id=139980177704970476794",
"provider_payment_id": "pse_co"
},
"payer": {
"name": "Juan Perez",
"document": 1020304050,
"email": "juan.perez@example.com"
},
"costs": {
"spread": 2,
"spread_type": "percentage",
"fixed_cost": 1,
"sell_price": 0.0002352
}
}
}
}Authorizations
Body
application/json
The body is of type object.
Response
200 - application/json
Successful response.