Skip to main content

Find channels by document

Looks up channels and their bank account details using a CPF and/or CNPJ.

MethodGET
Path/api/channel/by-document
AuthenticationJWT in the Authorization header, using the Bearer scheme
BodyNone

Authentication and authorization​

Use a valid JWT obtained from the login endpoint.

This route does not require Channel-ID.

Query parameters​

ParameterTypeRequiredDescription
cpfstringConditionalCPF to look up. Required if cnpj is not supplied.
cnpjstringConditionalCNPJ to look up. Required if cpf is not supplied.

Supply at least one parameter with a non-empty value. Both can be sent in the same request.

cURL examples​

Replace CASH_IN_BASE_URL with the Cash-In host for your environment, TOKEN_JWT with your token, and the document placeholders with the values to look up. The examples use --oauth2-bearer to send the JWT in the Authorization header using the Bearer scheme.

Look up by CPF​

curl --get "${CASH_IN_BASE_URL}/api/channel/by-document" \
--oauth2-bearer "${TOKEN_JWT}" \
--header 'Accept: application/json' \
--data-urlencode 'cpf=HOLDER_CPF'

Look up by CNPJ​

curl --get "${CASH_IN_BASE_URL}/api/channel/by-document" \
--oauth2-bearer "${TOKEN_JWT}" \
--header 'Accept: application/json' \
--data-urlencode 'cnpj=COMPANY_CNPJ'

To send both, include both parameters using --data-urlencode. Do not send a JSON body.

Success response​

200 OK — list of returned channels.

[
{
"channel_id": "5b3ac5c0-0caf-4c1d-a2b9-5e2ddac1f5dc",
"name": "Example channel",
"account": {
"bank": "000",
"bank_branch": "0001",
"bank_account": "123456",
"bank_account_digit": "0"
}
}
]
FieldTypeDescription
channel_idUUIDChannel identifier.
namestring or nullChannel name.
accountobjectChannel bank account details.
account.bankstring or nullBank.
account.bank_branchstring or nullBranch.
account.bank_accountstring or nullAccount number.
account.bank_account_digitstring or nullAccount check digit.

The response is a list, not a single object. Bank details remain strings, preserving any leading zeros.

Errors​

API error messages remain in Portuguese.

400 Bad Request — neither document supplied, or both empty:

{ "message": "pelo menos um dos campos cpf ou cnpj deve ser preenchido" }

401 Unauthorized — missing or malformed token:

{ "error": "Token ausente ou inválido" }

Invalid or expired token:

{ "error": "Token inválido" }

Other query errors use the following format, with the corresponding HTTP status:

{ "message": "<error description>" }