Consultar destino Pix
curl --request POST \
--url https://api.upag.io/v1/transfers/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>'})
};
fetch('https://api.upag.io/v1/transfers/lookup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/transfers/lookup';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Transferências Pix
Consultar destino Pix
Resolve chave, copia-e-cola ou beneficiário antes de transferir
POST
https://api.upag.io
/
v1
/
transfers
/
lookup
Consultar destino Pix
curl --request POST \
--url https://api.upag.io/v1/transfers/lookup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>'})
};
fetch('https://api.upag.io/v1/transfers/lookup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/transfers/lookup';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Valida e devolve os dados do destino (titular, banco, e, para copia-e-cola, o valor) antes de um Pix de saída.
Permissão:
Chave (
Ambos devolvem
Copia-e-cola (
transfer.read. Apenas chave secreta (sk_…).
Os exemplos usam o sandbox (
https://api.upag.dev/v1). Em produção use https://api.upag.io/v1 com sk_live_….Endpoint
curl -X POST https://api.upag.dev/v1/transfers/lookup \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "key",
"value": "55ce1aae-0d2b-4d76-bc77-294d6407349e"
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const destination = await upag.transfers.lookup({
type: 'key',
value: '55ce1aae-0d2b-4d76-bc77-294d6407349e',
});
Parâmetros
O corpo depende detype.
string
required
key, hash ou beneficiary.string
Obrigatório em
key (chave Pix) e hash (BR Code copia-e-cola).string (uuid)
Obrigatório em
beneficiary: UUID do beneficiário salvo na conta.string (uuid)
Obrigatório em
beneficiary: UUID da conta do beneficiário.Resposta
200 OK. O formato depende do type.
Chave (key) e beneficiário (beneficiary)
Ambos devolvem type: "key":
Response
{
"type": "key",
"isBeneficiary": false,
"pixKey": "55ce1aae-0d2b-4d76-bc77-294d6407349e",
"pixKeyType": "random",
"name": "Maria Receiver",
"tradingName": null,
"taxNumber": "11144477735",
"ispb": "00000000",
"bank": "450",
"bankName": "FitBank",
"branch": null,
"account": null,
"accountDigit": null,
"accountType": null
}
isBeneficiary indica se o titular já é um beneficiário salvo na conta. Em consulta por chave, branch, account, accountDigit, accountType e tradingName vêm null: o diretório de chaves Pix não os informa.
Copia-e-cola (hash)
Response
{
"type": "hash",
"isBeneficiary": false,
"hash": "00020126580014br.gov.bcb.pix...",
"pixKey": "55ce1aae-0d2b-4d76-bc77-294d6407349e",
"name": "Maria Receiver",
"tradingName": null,
"taxNumber": "11144477735",
"ispb": "00000000",
"bank": "450",
"bankName": "FitBank",
"branch": "0001",
"account": "99999",
"accountType": "payment",
"originalValue": "100.00",
"finalValue": "100.00",
"dueDate": null,
"description": null
}
originalValue e finalValue são strings decimais em reais, direto do QR code, não centavos. É a única exceção à regra de valores em centavos.Erros
| Status | Mensagem | Causa |
|---|---|---|
400 | Os dados da conta de origem e destino são iguais | hash aponta para a própria conta |
404 | Account not found | A conta da chave não foi encontrada |
422 | VALIDATION_FAILED | Corpo inválido (type desconhecido, campo ausente) |