Skip to main content
POST
/
quote
/
payin
Gera cotação de payin (BRL → crypto)
curl --request POST \
  --url https://api.astronpay.co/api/v1/quote/payin \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-api-secret: <api-key>' \
  --data '
{
  "receiverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amountBrl": 1000,
  "targetToken": "USDC"
}
'
{
  "quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "merchantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "receiverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "amountBrl": 1000,
  "commercialRate": "5.01",
  "ratePlatform": "5.11",
  "amountToken": "195.69",
  "targetToken": "USDC",
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

x-api-key
string
header
required
x-api-secret
string
header
required

Body

application/json
receiverId
string<uuid>
required
amountBrl
number
required
Required range: x >= 1
Example:

1000

targetToken
enum<string>
default:USDC

Token que o receiver receberá. Padrão: USDC.

Available options:
USDC,
SOL

Response

Cotação criada

quoteId
string<uuid>
required
merchantId
string<uuid>
required
receiverId
string<uuid>
required
amountBrl
number
required
Example:

1000

commercialRate
string
required

Taxa de câmbio comercial (BRL por 1 unidade do token), sem spread da plataforma. Valor informativo.

Example:

"5.01"

ratePlatform
string
required

Taxa all-in efetiva (BRL por 1 unidade do token), já incluindo o spread da plataforma. É o que determina amountToken.

Example:

"5.11"

amountToken
string
required

Quantidade do token que o receiver recebe ao final do payin.

Example:

"195.69"

targetToken
enum<string>
required
Available options:
USDC,
SOL
Example:

"USDC"

expiresAt
string<date-time>
required

A cotação expira ~30 segundos após a criação.