创建 PIX 收款
curl --request POST \
--url https://api.jetpag.com/v2/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 150.75,
"description": "Pagamento do pedido #12345",
"customer": {
"name": "João da Silva",
"document": "12345678909",
"email": "[email protected]",
"phone": "+5511999998888"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"expiresIn": 3600,
"externalReference": "pedido-12345",
"metadata": {
"orderId": "12345",
"source": "website"
},
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}
'import requests
url = "https://api.jetpag.com/v2/pix"
payload = {
"amount": 150.75,
"description": "Pagamento do pedido #12345",
"customer": {
"name": "João da Silva",
"document": "12345678909",
"email": "[email protected]",
"phone": "+5511999998888"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"expiresIn": 3600,
"externalReference": "pedido-12345",
"metadata": {
"orderId": "12345",
"source": "website"
},
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}
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({
amount: 150.75,
description: 'Pagamento do pedido #12345',
customer: {
name: 'João da Silva',
document: '12345678909',
email: '[email protected]',
phone: '+5511999998888'
},
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pspCredentialId: '6e307aa4-4772-4230-a648-d88cee308f54',
expiresIn: 3600,
externalReference: 'pedido-12345',
metadata: {orderId: '12345', source: 'website'},
split: [{subAccount: 'loja-centro', amount: 30}]
})
};
fetch('https://api.jetpag.com/v2/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_URL => "https://api.jetpag.com/v2/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([
'amount' => 150.75,
'description' => 'Pagamento do pedido #12345',
'customer' => [
'name' => 'João da Silva',
'document' => '12345678909',
'email' => '[email protected]',
'phone' => '+5511999998888'
],
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pspCredentialId' => '6e307aa4-4772-4230-a648-d88cee308f54',
'expiresIn' => 3600,
'externalReference' => 'pedido-12345',
'metadata' => [
'orderId' => '12345',
'source' => 'website'
],
'split' => [
[
'subAccount' => 'loja-centro',
'amount' => 30
]
]
]),
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://api.jetpag.com/v2/pix"
payload := strings.NewReader("{\n \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\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://api.jetpag.com/v2/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetpag.com/v2/pix")
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 \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"amount": 150.75,
"currency": "BRL",
"pixCopyPaste": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"qrCodeBase64": "<string>",
"pspPaymentId": "de3516a2-c63a-4c02-b132-a239bf42e183",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"externalReference": "pedido-12345",
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}{
"statusCode": 400,
"error": "BadRequest",
"message": "name must be longer than or equal to 2 characters",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication token is required",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 404,
"error": "NotFound",
"message": "Resource with id 550e8400-e29b-41d4-a716-446655440000 not found",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {
"resource": "Example",
"id": "550e8400-e29b-41d4-a716-446655440000"
},
"traceId": "<string>"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}PIX
创建 PIX 收款
创建一笔即时 PIX 收款。
所需权限: PIX:WRITE 或 FULL_ACCESS
POST
/
pix
创建 PIX 收款
curl --request POST \
--url https://api.jetpag.com/v2/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 150.75,
"description": "Pagamento do pedido #12345",
"customer": {
"name": "João da Silva",
"document": "12345678909",
"email": "[email protected]",
"phone": "+5511999998888"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"expiresIn": 3600,
"externalReference": "pedido-12345",
"metadata": {
"orderId": "12345",
"source": "website"
},
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}
'import requests
url = "https://api.jetpag.com/v2/pix"
payload = {
"amount": 150.75,
"description": "Pagamento do pedido #12345",
"customer": {
"name": "João da Silva",
"document": "12345678909",
"email": "[email protected]",
"phone": "+5511999998888"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"expiresIn": 3600,
"externalReference": "pedido-12345",
"metadata": {
"orderId": "12345",
"source": "website"
},
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}
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({
amount: 150.75,
description: 'Pagamento do pedido #12345',
customer: {
name: 'João da Silva',
document: '12345678909',
email: '[email protected]',
phone: '+5511999998888'
},
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pspCredentialId: '6e307aa4-4772-4230-a648-d88cee308f54',
expiresIn: 3600,
externalReference: 'pedido-12345',
metadata: {orderId: '12345', source: 'website'},
split: [{subAccount: 'loja-centro', amount: 30}]
})
};
fetch('https://api.jetpag.com/v2/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_URL => "https://api.jetpag.com/v2/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([
'amount' => 150.75,
'description' => 'Pagamento do pedido #12345',
'customer' => [
'name' => 'João da Silva',
'document' => '12345678909',
'email' => '[email protected]',
'phone' => '+5511999998888'
],
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pspCredentialId' => '6e307aa4-4772-4230-a648-d88cee308f54',
'expiresIn' => 3600,
'externalReference' => 'pedido-12345',
'metadata' => [
'orderId' => '12345',
'source' => 'website'
],
'split' => [
[
'subAccount' => 'loja-centro',
'amount' => 30
]
]
]),
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://api.jetpag.com/v2/pix"
payload := strings.NewReader("{\n \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\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://api.jetpag.com/v2/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jetpag.com/v2/pix")
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 \"amount\": 150.75,\n \"description\": \"Pagamento do pedido #12345\",\n \"customer\": {\n \"name\": \"João da Silva\",\n \"document\": \"12345678909\",\n \"email\": \"[email protected]\",\n \"phone\": \"+5511999998888\"\n },\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pspCredentialId\": \"6e307aa4-4772-4230-a648-d88cee308f54\",\n \"expiresIn\": 3600,\n \"externalReference\": \"pedido-12345\",\n \"metadata\": {\n \"orderId\": \"12345\",\n \"source\": \"website\"\n },\n \"split\": [\n {\n \"subAccount\": \"loja-centro\",\n \"amount\": 30\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"amount": 150.75,
"currency": "BRL",
"pixCopyPaste": "00020126580014br.gov.bcb.pix0136a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"qrCodeBase64": "<string>",
"pspPaymentId": "de3516a2-c63a-4c02-b132-a239bf42e183",
"pspCredentialId": "6e307aa4-4772-4230-a648-d88cee308f54",
"externalReference": "pedido-12345",
"split": [
{
"subAccount": "loja-centro",
"amount": 30
}
]
}{
"statusCode": 400,
"error": "BadRequest",
"message": "name must be longer than or equal to 2 characters",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication token is required",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 404,
"error": "NotFound",
"message": "Resource with id 550e8400-e29b-41d4-a716-446655440000 not found",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {
"resource": "Example",
"id": "550e8400-e29b-41d4-a716-446655440000"
},
"traceId": "<string>"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}子账户之间的分账。 可选字段
split 将部分金额分给您的其他钱包——子账户,或通过保留字 principal 指定的主账户。最多 10 项,金额为固定值,以雷亚尔计。创建收款的一方是发起方:收取总额、支付全部手续费,然后才进行分账,因此分账上限是净额(收款金额减去手续费),而非总额。分账在结算时执行,而不是在创建时。退款和 MED 只从发起方扣款——收到分账的一方永远不会被扣款。完整规则、示例和错误表参见支付分账。机构选择。 如果您的账户已启用此选项,可选字段
pspCredentialId 可指定签发本笔收款的机构,忽略已配置的路由。请在控制台的 设置 → 路由 中复制该 ID。指定不等于优先:如果该机构不可用或容量不足,收款将失败,而不会改由其他机构签发。响应会回显 pspCredentialId 作为回执。完整规则和错误表参见机构选择。请求头
执行操作的子账户的 reference。省略时,操作在主账户上执行;保留值 principal 同样解析为主账户,等同于省略该请求头。除 POST /auth 和 /sub-accounts 自身的端点(始终在主账户上操作)外,所有端点均接受该请求头。
可能的错误:404 SUB_ACCOUNT_NOT_FOUND、403 SUB_ACCOUNT_FORBIDDEN、403 SUB_ACCOUNT_SUSPENDED。
要求凭证已启用子账户访问(设置 → 集成 → API 凭证)。该项默认关闭,任何权限都无法替代,FULL_ACCESS 也不例外:未启用时响应为 403 SUB_ACCOUNT_FORBIDDEN。
Pattern:
^[a-z0-9][a-z0-9_-]{1,31}$示例:
"loja-centro"
请求体
application/json
响应
PIX 收款创建成功