Process a PIX payment
curl --request POST \
--url http://localhost:7701/api/v1/payments/pix \
--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",
"customer": {
"name": "John Doe",
"email": "john@example.com",
"document": "12345678909"
},
"gateway_first_try": "pagarme",
"expires_in": 3600,
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
'import requests
url = "http://localhost:7701/api/v1/payments/pix"
payload = {
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"customer": {
"name": "John Doe",
"email": "john@example.com",
"document": "12345678909"
},
"gateway_first_try": "pagarme",
"expires_in": 3600,
"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',
customer: {name: 'John Doe', email: 'john@example.com', document: '12345678909'},
gateway_first_try: 'pagarme',
expires_in: 3600,
splits: [{subaccount_id: 'sub_abc123', amount: 5000}]
})
};
fetch('http://localhost:7701/api/v1/payments/pix', 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/pix",
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',
'customer' => [
'name' => 'John Doe',
'email' => 'john@example.com',
'document' => '12345678909'
],
'gateway_first_try' => 'pagarme',
'expires_in' => 3600,
'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/pix"
payload := strings.NewReader("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\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/pix")
.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 \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\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/pix")
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 \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "PIX generated successfully.",
"payment_method": "pix",
"merchant_order_id": "ORD-2026-12345",
"idempotency_key": "<string>",
"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": {},
"pix": {
"qr_code": "<string>",
"qr_code_url": "<string>",
"expiration_at": "2023-11-07T05:31:56Z"
}
}{
"status": "processing",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "The PIX payment is being processed, a webhook will be sent when ready."
}Payments
Process a PIX payment
Creates a PIX order and returns a QR code for the customer to complete payment.
POST
/
api
/
v1
/
payments
/
pix
Process a PIX payment
curl --request POST \
--url http://localhost:7701/api/v1/payments/pix \
--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",
"customer": {
"name": "John Doe",
"email": "john@example.com",
"document": "12345678909"
},
"gateway_first_try": "pagarme",
"expires_in": 3600,
"splits": [
{
"subaccount_id": "sub_abc123",
"amount": 5000
}
]
}
'import requests
url = "http://localhost:7701/api/v1/payments/pix"
payload = {
"merchant_order_id": "ORD-2026-12345",
"amount": 15000,
"currency": "BRL",
"customer": {
"name": "John Doe",
"email": "john@example.com",
"document": "12345678909"
},
"gateway_first_try": "pagarme",
"expires_in": 3600,
"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',
customer: {name: 'John Doe', email: 'john@example.com', document: '12345678909'},
gateway_first_try: 'pagarme',
expires_in: 3600,
splits: [{subaccount_id: 'sub_abc123', amount: 5000}]
})
};
fetch('http://localhost:7701/api/v1/payments/pix', 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/pix",
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',
'customer' => [
'name' => 'John Doe',
'email' => 'john@example.com',
'document' => '12345678909'
],
'gateway_first_try' => 'pagarme',
'expires_in' => 3600,
'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/pix"
payload := strings.NewReader("{\n \"merchant_order_id\": \"ORD-2026-12345\",\n \"amount\": 15000,\n \"currency\": \"BRL\",\n \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\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/pix")
.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 \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\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/pix")
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 \"customer\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"document\": \"12345678909\"\n },\n \"gateway_first_try\": \"pagarme\",\n \"expires_in\": 3600,\n \"splits\": [\n {\n \"subaccount_id\": \"sub_abc123\",\n \"amount\": 5000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "PIX generated successfully.",
"payment_method": "pix",
"merchant_order_id": "ORD-2026-12345",
"idempotency_key": "<string>",
"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": {},
"pix": {
"qr_code": "<string>",
"qr_code_url": "<string>",
"expiration_at": "2023-11-07T05:31:56Z"
}
}{
"status": "processing",
"transaction_id": "01hvxyz...",
"amount": 15000,
"message": "The PIX payment is being processed, a webhook will be sent when ready."
}Authorizations
Company API key. Send in the X-API-Key header.
Headers
Client identifier for the company in the request.
Example:
"client_abc123"
Body
application/json
Example:
"ORD-2026-12345"
Amount in cents
Example:
15000
Example:
"BRL"
Show child attributes
Show child attributes
Gateway slug to attempt first. Falls back to routing rules if not set.
Example:
"pagarme"
Seconds until PIX expires (min 60)
Example:
3600
Optional split rules. Each entry directs a portion of the amount to a sub-account.
Show child attributes
Show child attributes
Response
PIX order created
Example:
"pending"
Example:
"01hvxyz..."
Example:
15000
Example:
"PIX generated successfully."
Example:
"pix"
Example:
"ORD-2026-12345"
Example:
"0.05s"
Example:
"0.8s"
Example:
"0.75s"
Show child attributes
Show child attributes