Skip to main content
POST
/
payin
Cria ordem de payin
curl --request POST \
  --url https://api.astronpay.co/api/v1/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",
  "quoteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "destinationWallet": "4k5dqkqCg7GXhE8...Solana",
  "externalId": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "merchantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "receiverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "type": "PAYIN",
  "status": "PENDING",
  "chain": "solana",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "externalId": "<string>",
  "receiverName": "<string>",
  "merchantName": "<string>",
  "amountBrl": 1000,
  "amountCrypto": 199.5,
  "targetToken": "USDC",
  "sourceToken": "USDC",
  "destinationWallet": "4k5dSo1EnderecoSolana...",
  "depositAddress": "7xMnSo2EnderecoDeposito...",
  "paymentReference": "<string>",
  "exchangeRate": 5.01,
  "feePercentage": 2.5,
  "netAmountBrl": 975,
  "amountUsdc": 194.61,
  "amountToken": 194.61,
  "platformFeePercentage": 1.5,
  "platformFeeAmountBrl": 15,
  "merchantFeePercentage": 1,
  "merchantFeeAmountBrl": 10,
  "pixPaymentCode": "00020126...",
  "pixKey": "<string>",
  "pixKeyType": "CPF",
  "recipientName": "<string>",
  "failureReason": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "completedAt": "2023-11-07T05:31:56Z",
  "transactions": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "<string>",
      "status": "<string>",
      "amount": 199.5,
      "currency": "USDC",
      "createdAt": "2023-11-07T05:31:56Z",
      "chain": "solana",
      "txHash": "<string>"
    }
  ]
}

Authorizations

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

Body

application/json
receiverId
string<uuid>
required
quoteId
string<uuid>
required
destinationWallet
string
required

Endereço Solana (base58) que receberá o crypto.

Example:

"4k5dqkqCg7GXhE8...Solana"

externalId
string

ID opcional do merchant para rastreamento.

Maximum string length: 255

Response

Criado

id
string<uuid>
required
merchantId
string<uuid>
required
receiverId
string<uuid>
required
type
enum<string>
required
Available options:
PAYIN,
PAYOUT
status
enum<string>
required
Available options:
PENDING,
AWAITING_PAYMENT,
PAYMENT_RECEIVED,
SWAPPING,
TRANSFERRING,
AWAITING_DEPOSIT,
DEPOSIT_RECEIVED,
PIX_SENDING,
PIX_SENT_UNCONFIRMED,
COMPLETED,
FAILED,
EXPIRED,
REFUNDING,
REFUNDED
chain
string
required
Example:

"solana"

createdAt
string<date-time>
required
updatedAt
string<date-time>
required
externalId
string | null

ID do merchant para rastreamento interno.

receiverName
string | null
merchantName
string | null
amountBrl
number | null
Example:

1000

amountCrypto
number | null
Example:

199.5

targetToken
string | null

Payin only. Token que o receiver recebe (ex: USDC).

Example:

"USDC"

sourceToken
string | null

Payout only. Token que o receiver envia (ex: USDC).

Example:

"USDC"

destinationWallet
string | null

Payin only. Endereço Solana onde o crypto é entregue.

Example:

"4k5dSo1EnderecoSolana..."

depositAddress
string | null

Payout only. Endereço Solana para onde o receiver deve enviar o crypto.

Example:

"7xMnSo2EnderecoDeposito..."

paymentReference
string | null

Payin only. Referência interna do PIX.

exchangeRate
number | null

Taxa de câmbio utilizada na ordem (BRL/token).

Example:

5.01

feePercentage
number | null

Percentual total de taxa aplicado.

Example:

2.5

netAmountBrl
number | null

Valor BRL líquido após taxas.

Example:

975

amountUsdc
number | null
Example:

194.61

amountToken
number | null

Quantidade final do token entregue.

Example:

194.61

platformFeePercentage
number | null
Example:

1.5

platformFeeAmountBrl
number | null
Example:

15

merchantFeePercentage
number | null
Example:

1

merchantFeeAmountBrl
number | null
Example:

10

pixPaymentCode
string | null

Payin only. Código EMV copia-e-cola do PIX.

Example:

"00020126..."

pixKey
string | null

Payout only. Chave PIX do destinatário.

pixKeyType
enum<string> | null

Payout only. Tipo da chave PIX.

Available options:
CPF,
CNPJ,
PHONE,
EMAIL,
RANDOM,
QRCODE
recipientName
string | null

Payout only. Nome do destinatário no PIX.

failureReason
string | null

Motivo da falha, preenchido quando status=FAILED.

expiresAt
string<date-time> | null
completedAt
string<date-time> | null
transactions
object[]

Transações associadas à ordem (on-chain e PIX).