Criar cobrança Pix
curl --request POST \
--url https://api.nyxpag.com.br/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 5000.5,
"payer": {
"name": "<string>",
"document": "52998224725",
"email": "[email protected]"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5000.5,
payer: {name: '<string>', document: '52998224725', email: '[email protected]'}
})
};
fetch('https://api.nyxpag.com.br/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nyxpag.com.br/v1/transactions"
payload = {
"amount": 5000.5,
"payer": {
"name": "<string>",
"document": "52998224725",
"email": "[email protected]"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nyxpag.com.br/v1/transactions",
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' => 5000.5,
'payer' => [
'name' => '<string>',
'document' => '52998224725',
'email' => '[email protected]'
]
]),
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;
}{
"success": true,
"data": {
"id": "txn_mabc123_0123456789abcdef",
"externalId": "PEDIDO-1042",
"direction": "in",
"type": "payment",
"method": "pix",
"status": "pending",
"amount": 149.9,
"fee": 0.5,
"netAmount": 149.2,
"description": "<string>",
"pix": {
"copyPaste": "<string>",
"qrCodeBase64": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>"
}{
"success": false,
"code": "rate_limit_exceeded",
"error": {
"code": "rate_limit_exceeded",
"message": "Muitas solicitações. Aguarde antes de tentar novamente."
},
"retryAfter": 60,
"requestId": "req_example"
}Pagamentos
Criar cobrança Pix
Permissão necessária: payments:write. Idempotency-Key ou externalId é obrigatório; a mesma chave com payload diferente retorna conflito. A rota de processamento é definida exclusivamente pela administração da conta.
POST
/
transactions
Criar cobrança Pix
curl --request POST \
--url https://api.nyxpag.com.br/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 5000.5,
"payer": {
"name": "<string>",
"document": "52998224725",
"email": "[email protected]"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5000.5,
payer: {name: '<string>', document: '52998224725', email: '[email protected]'}
})
};
fetch('https://api.nyxpag.com.br/v1/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nyxpag.com.br/v1/transactions"
payload = {
"amount": 5000.5,
"payer": {
"name": "<string>",
"document": "52998224725",
"email": "[email protected]"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nyxpag.com.br/v1/transactions",
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' => 5000.5,
'payer' => [
'name' => '<string>',
'document' => '52998224725',
'email' => '[email protected]'
]
]),
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;
}{
"success": true,
"data": {
"id": "txn_mabc123_0123456789abcdef",
"externalId": "PEDIDO-1042",
"direction": "in",
"type": "payment",
"method": "pix",
"status": "pending",
"amount": 149.9,
"fee": 0.5,
"netAmount": 149.2,
"description": "<string>",
"pix": {
"copyPaste": "<string>",
"qrCodeBase64": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"requestId": "<string>"
}{
"success": false,
"code": "rate_limit_exceeded",
"error": {
"code": "rate_limit_exceeded",
"message": "Muitas solicitações. Aguarde antes de tentar novamente."
},
"retryAfter": 60,
"requestId": "req_example"
}Authorizations
Use Authorization: Bearer nyx_live_...
Headers
Maximum string length:
100Body
application/json
Required range:
1 <= x <= 10000Show child attributes
Show child attributes
Alternativa ao cabeçalho Idempotency-Key.
Maximum string length:
100Maximum string length:
140Recebedores da venda. A comissão é debitada do líquido desta conta, ao lado da taxa da NyxPag, e cai no saldo do recebedor quando o pagamento é aprovado. Informe amount (em reais) ou percent (sobre o valor da venda) em cada item, nunca os dois.
Maximum array length:
10Show child attributes
Show child attributes
Response
Requisição idempotente existente

