Criar cobrança
curl --request POST \
--url https://api.upag.io/v1/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"amount": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', amount: 123})
};
fetch('https://api.upag.io/v1/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/charges';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', amount: 123})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cobranças
Criar cobrança
Gera uma cobrança Pix na conta da chave de API
POST
https://api.upag.io
/
v1
/
charges
Criar cobrança
curl --request POST \
--url https://api.upag.io/v1/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"amount": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', amount: 123})
};
fetch('https://api.upag.io/v1/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/charges';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', amount: 123})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Cria uma cobrança Pix. Cobrança dinâmica exige
Campos completos: Referência de cobranças.
customer (UUID existente ou objeto inline).
Endpoint
curl -X POST https://api.upag.io/v1/charges \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "pix",
"amount": 9900,
"description": "Pedido #10482",
"pix": { "method": "dynamic" },
"customer": {
"name": "Maria Pagadora",
"document": { "type": "cpf", "number": "39053344705" }
}
}'
Parâmetros
string
required
Sempre
pix.integer
required
Valor em centavos.
string
Descrição (até 140 caracteres).
object
method: dynamic (padrão, com vencimento) ou static. Para dinâmica, dueDate opcional (ISO 8601).string | object
Obrigatório para Pix dinâmico. UUID de cliente ou objeto de criação/atualização (ver Clientes).
array
Repasses para outras contas internas:
{ "accountId": "uuid", "amount": centavos }.Resposta
201 Created
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "pix",
"status": "pending",
"amount": 9900,
"description": "Pedido #10482",
"customer": "660e8400-e29b-41d4-a716-446655440001",
"pix": {
"reference": "tx-qr-1",
"qrCode": "00020126580014br.gov.bcb.pix...",
"expiresAt": "2026-03-18T12:00:00.000Z"
},
"splits": [],
"createdAt": "2026-03-18T11:50:00.000Z",
"updatedAt": "2026-03-18T11:50:00.000Z"
}