Process a card payment
curl --request POST \
--url http://localhost:7701/api/v1/payments/card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"payment_method": "card",
"customer": {
"token": "cus_token_abc123",
"name": "John Doe",
"email": "john.doe@example.com",
"document": "12345678909",
"phone": "11912345678"
},
"gateway_first_try": "pagarme",
"capture": false,
"card": {
"token": "card_tok_xyz",
"number": "4111111111111111",
"cvv": "123",
"expiration_month": "12",
"expiration_year": "2028",
"holder": "JOHN DOE",
"holder_document": "12345678909",
"holder_birthdate": "1990-05-20",
"holder_phone": "11912345678",
"installments": 1,
"save_card": false
},
"billing_address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"zip_code": "01310100",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
'import requests
url = "http://localhost:7701/api/v1/payments/card"
payload = {
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"payment_method": "card",
"customer": {
"token": "cus_token_abc123",
"name": "John Doe",
"email": "john.doe@example.com",
"document": "12345678909",
"phone": "11912345678"
},
"gateway_first_try": "pagarme",
"capture": False,
"card": {
"token": "card_tok_xyz",
"number": "4111111111111111",
"cvv": "123",
"expiration_month": "12",
"expiration_year": "2028",
"holder": "JOHN DOE",
"holder_document": "12345678909",
"holder_birthdate": "1990-05-20",
"holder_phone": "11912345678",
"installments": 1,
"save_card": False
},
"billing_address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"zip_code": "01310100",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
headers = {
"x-client-id": "<x-client-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_order_id: 'ORD-2026-12345',
amount: 15000,
currency: 'BRL',
payment_method: 'card',
customer: {
token: 'cus_token_abc123',
name: 'John Doe',
email: 'john.doe@example.com',
document: '12345678909',
phone: '11912345678'
},
gateway_first_try: 'pagarme',
capture: false,
card: {
token: 'card_tok_xyz',
number: '4111111111111111',
cvv: '123',
expiration_month: '12',
expiration_year: '2028',
holder: 'JOHN DOE',
holder_document: '12345678909',
holder_birthdate: '1990-05-20',
holder_phone: '11912345678',
installments: 1,
save_card: false
},
billing_address: {
street: 'Rua das Flores',
number: '123',
neighborhood: 'Centro',
zip_code: '01310100',
city: 'São Paulo',
state: 'SP',
country: 'BR'
},
splits: [{subaccount_id: 'sub_abc123', amount: 5000}]
})
};
fetch('http://localhost:7701/api/v1/payments/card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/payments/card",
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([
'merchant_order_id' => 'ORD-2026-12345',
'amount' => 15000,
'currency' => 'BRL',
'payment_method' => 'card',
'customer' => [
'token' => 'cus_token_abc123',
'name' => 'John Doe',
'email' => 'john.doe@example.com',
'document' => '12345678909',
'phone' => '11912345678'
],
'gateway_first_try' => 'pagarme',
'capture' => false,
'card' => [
'token' => 'card_tok_xyz',
'number' => '4111111111111111',
'cvv' => '123',
'expiration_month' => '12',
'expiration_year' => '2028',
'holder' => 'JOHN DOE',
'holder_document' => '12345678909',
'holder_birthdate' => '1990-05-20',
'holder_phone' => '11912345678',
'installments' => 1,
'save_card' => false
],
'billing_address' => [
'street' => 'Rua das Flores',
'number' => '123',
'neighborhood' => 'Centro',
'zip_code' => '01310100',
'city' => 'São Paulo',
'state' => 'SP',
'country' => 'BR'
],
'splits' => [
[
'subaccount_id' => 'sub_abc123',
'amount' => 5000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/payments/card"
payload := strings.NewReader("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("X-API-Key", "<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("http://localhost:7701/api/v1/payments/card")
.header("x-client-id", "<x-client-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/payments/card")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "Payment approved.",
"attempts": 1,
"payment_method": "card",
"merchant_order_id": "ORD-2026-12345",
"idempotency_key": "order-abc-123",
"plugtopay_request_time": "0.05s",
"total_request_time": "0.8s",
"gateways_request_time": "0.75s",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"transactions": [
{}
],
"customer": {},
"webhook": {},
"card": {
"response_code": "<string>",
"soft_descriptor": "<string>",
"authorization_nsu": "<string>",
"gateway_message": "<string>"
}
}{
"status": "processing",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "The payment is being processed, a webhook will be sent to you later."
}Payments
Process a card payment
Receives a payment payload and routes it through the Orchestrator Smart Routing system.
POST
/
api
/
v1
/
payments
/
card
Process a card payment
curl --request POST \
--url http://localhost:7701/api/v1/payments/card \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"payment_method": "card",
"customer": {
"token": "cus_token_abc123",
"name": "John Doe",
"email": "john.doe@example.com",
"document": "12345678909",
"phone": "11912345678"
},
"gateway_first_try": "pagarme",
"capture": false,
"card": {
"token": "card_tok_xyz",
"number": "4111111111111111",
"cvv": "123",
"expiration_month": "12",
"expiration_year": "2028",
"holder": "JOHN DOE",
"holder_document": "12345678909",
"holder_birthdate": "1990-05-20",
"holder_phone": "11912345678",
"installments": 1,
"save_card": false
},
"billing_address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"zip_code": "01310100",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
'import requests
url = "http://localhost:7701/api/v1/payments/card"
payload = {
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"payment_method": "card",
"customer": {
"token": "cus_token_abc123",
"name": "John Doe",
"email": "john.doe@example.com",
"document": "12345678909",
"phone": "11912345678"
},
"gateway_first_try": "pagarme",
"capture": False,
"card": {
"token": "card_tok_xyz",
"number": "4111111111111111",
"cvv": "123",
"expiration_month": "12",
"expiration_year": "2028",
"holder": "JOHN DOE",
"holder_document": "12345678909",
"holder_birthdate": "1990-05-20",
"holder_phone": "11912345678",
"installments": 1,
"save_card": False
},
"billing_address": {
"street": "Rua das Flores",
"number": "123",
"neighborhood": "Centro",
"zip_code": "01310100",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
headers = {
"x-client-id": "<x-client-id>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-id': '<x-client-id>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
merchant_order_id: 'ORD-2026-12345',
amount: 15000,
currency: 'BRL',
payment_method: 'card',
customer: {
token: 'cus_token_abc123',
name: 'John Doe',
email: 'john.doe@example.com',
document: '12345678909',
phone: '11912345678'
},
gateway_first_try: 'pagarme',
capture: false,
card: {
token: 'card_tok_xyz',
number: '4111111111111111',
cvv: '123',
expiration_month: '12',
expiration_year: '2028',
holder: 'JOHN DOE',
holder_document: '12345678909',
holder_birthdate: '1990-05-20',
holder_phone: '11912345678',
installments: 1,
save_card: false
},
billing_address: {
street: 'Rua das Flores',
number: '123',
neighborhood: 'Centro',
zip_code: '01310100',
city: 'São Paulo',
state: 'SP',
country: 'BR'
},
splits: [{subaccount_id: 'sub_abc123', amount: 5000}]
})
};
fetch('http://localhost:7701/api/v1/payments/card', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/payments/card",
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([
'merchant_order_id' => 'ORD-2026-12345',
'amount' => 15000,
'currency' => 'BRL',
'payment_method' => 'card',
'customer' => [
'token' => 'cus_token_abc123',
'name' => 'John Doe',
'email' => 'john.doe@example.com',
'document' => '12345678909',
'phone' => '11912345678'
],
'gateway_first_try' => 'pagarme',
'capture' => false,
'card' => [
'token' => 'card_tok_xyz',
'number' => '4111111111111111',
'cvv' => '123',
'expiration_month' => '12',
'expiration_year' => '2028',
'holder' => 'JOHN DOE',
'holder_document' => '12345678909',
'holder_birthdate' => '1990-05-20',
'holder_phone' => '11912345678',
'installments' => 1,
'save_card' => false
],
'billing_address' => [
'street' => 'Rua das Flores',
'number' => '123',
'neighborhood' => 'Centro',
'zip_code' => '01310100',
'city' => 'São Paulo',
'state' => 'SP',
'country' => 'BR'
],
'splits' => [
[
'subaccount_id' => 'sub_abc123',
'amount' => 5000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/payments/card"
payload := strings.NewReader("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
req.Header.Add("X-API-Key", "<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("http://localhost:7701/api/v1/payments/card")
.header("x-client-id", "<x-client-id>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/payments/card")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"payment_method\": \"card\",\n \"customer\": {\n \"token\": \"cus_token_abc123\",\n \"name\": \"John Doe\",\n \"email\": \"john.doe@example.com\",\n \"document\": \"12345678909\",\n \"phone\": \"11912345678\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"capture\": false,\n \"card\": {\n \"token\": \"card_tok_xyz\",\n \"number\": \"4111111111111111\",\n \"cvv\": \"123\",\n \"expiration_month\": \"12\",\n \"expiration_year\": \"2028\",\n \"holder\": \"JOHN DOE\",\n \"holder_document\": \"12345678909\",\n \"holder_birthdate\": \"1990-05-20\",\n \"holder_phone\": \"11912345678\",\n \"installments\": 1,\n \"save_card\": false\n },\n \"billing_address\": {\n \"street\": \"Rua das Flores\",\n \"number\": \"123\",\n \"neighborhood\": \"Centro\",\n \"zip_code\": \"01310100\",\n \"city\": \"São Paulo\",\n \"state\": \"SP\",\n \"country\": \"BR\"\n },\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "Payment approved.",
"attempts": 1,
"payment_method": "card",
"merchant_order_id": "ORD-2026-12345",
"idempotency_key": "order-abc-123",
"plugtopay_request_time": "0.05s",
"total_request_time": "0.8s",
"gateways_request_time": "0.75s",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"transactions": [
{}
],
"customer": {},
"webhook": {},
"card": {
"response_code": "<string>",
"soft_descriptor": "<string>",
"authorization_nsu": "<string>",
"gateway_message": "<string>"
}
}{
"status": "processing",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "The payment is being processed, a webhook will be sent to you later."
}Headers
Body
application/json
When false, performs an auth-only (pre-authorization): funds are reserved but not settled, and the transaction comes back with status "authorized". Settle it with POST /payments/{id}/capture or release it with POST /payments/{id}/cancel. Supported gateways: pagarme, pagbank, stripe, erede.
Example:
false
Response
Payment processed successfully