Generating Pix Links (Pay Pix --> Receive Crypto)

Overview

Pix Links allow a user to purchase crypto (USDT) using Brazilian Reais (BRL) via Pix. The API generates a payment code (Pix Link) to make the pix payment. A Pix link can be turned into a QR code, or copied and pasted on any bank app to pay PiX. USDT is sent to a destination wallet address indicated in the API payload. The completion time ranges within 20-45 seconds.

Pix Links can be static or dynamic.

  • Static: Without a declared amount, nor expiration.
  • Dynamic: With a declared amount, and expiration.

Basic Rules

  • Purchases (Pix → Crypto) require user verification, either by SmartPay or the API client (only if given permission by SmartPay). Please refer to the KYC pages.
  • Crypto addresses cannot be shared by users. Users must be assigned an address or addresses not used by other users.

Authorization

Keys will be given to you privately by our team. To run tests, you may use “default” as user and key (except for KYC by CLIENT API, which always require authorization).



Static Pix Links

Create payment codes without a declared amount or expiration.

Endpoint

POST /swapix/pixlink

Payload parameters

  • currency: cryptocurrency to purchase
    • pxusdt (USDT on Polygon)
    • solusdt (USDT on Solana)
    • txusdt (USDT on Tron)
  • chain: blockchain
    • polygon
    • solana
    • tron
  • address: destination wallet address
  • docid: tax id (cpf / cnpj) of the payer. Omit special characters.
  • callback: optional parameter, to receive status of the transaction. Call the URL with the parameter via GET and receive ?operation_id=xxxxx&status=xxxx.
    Example: "https://someurl/someendpoint"

We recommend always consulting the transactions using the STATUS API, callbacks URLs could be manipulated by a malicious third party. Instead, use the callback to get the status, but always confirm with the STATUS API.

Solana addresses always need to be "initialized" to receive funds (have small amount of sol tokens).

Example payload

Creating a pix link to receive USDT in polygon.

var postdata = {  
"chain": "polygon", 
“currency": "pxusdt", 
“address": "0xA997C4352D1318e46a11b7a41dB852a3854736d9”, 
“docid:” “80011469955”, 
"callback":" https://xxx/someendpoint" 
}

Response

  • status:
    • ok - emv (payment code) is created
    • failed
      • invalid_information: invalid parameter on the payload, check format.
      • unauthorized_user: user without kyc
      • invalid_keys: api keys are not authorized to use the endpoint.

Successful response example

Pix link is created, which can be displayed as a QR code, or copied / pasted by the user to make a payment.

{
status: 'ok', 
 msg: '[100] Request ok.', code: 'S_OK', 
 data: { 
  emv:‘00020101021226790014br.gov.bcb.pix2557brcode.
 starkinfra.com/v2/e7b57429b43a4249bff71db68bee
 82ac5204000053039865802BR5 925Smartpay 
 Servicos 
 Digitai6013Florianopolis62070503***630420 C5',  
}


Dynamic Pix Links

Create payment codes with a declared amount and expiration. This is the most common type of payment code used.

Endpoint

POST /swapix/pixlink

Payload parameters

  • currency: cryptocurrency to purchase
    • pxusdt (USDT on Polygon)
    • solusdt (USDT on Solana)
    • txusdt (USDT on Tron)
  • chain: blockchain
    • polygon
    • solana
    • tron
  • address: destination wallet address
  • docid: tax id (cpf / cnpj) of the payer. Omit special characters.
  • amount_direction:
    • in (to declare the crypto amount - USDT - to receive)
    • out (to declare the fiat amount - BRL - to pay)
  • amount: number, with 2 decimal points, of USDT or BRL, depending on the amount_direction.
  • expire: number, in seconds, for the code expiration. The maximum amount is 1 day = 86400 seconds.
  • callback: optional parameter, to receive status of the transaction. Call the URL with the parameter via GET and receive ?operation_id=xxxxx&status=xxxx.
    Example: "https://someurl/someendpoint"

We recommend always consulting the transactions using the status API, callbacks URLs could be manipulated by a malicious third party. Instead, use the callback to get the status, but always confirm with the STATUS API.

Solana addresses always need to be "initialized" to receive funds (have small amount of sol tokens).

Payload example

Creating a pix link to receive "in" 100 USDT in solana, with the code to expire in 15 minutes.

var postdata = {  
"chain": "solana", 
“currency": "solusdt", 
“address": "0xA997C4352D1318e46a11b7a41dB852a3854736d9”, 
“docid:” “80011469955”, 
“amount_direction”: “in”, 
“amount”: “100.00”, 
“expire”: “900”, 
"callback":" https://xxx/someendpoint" 
}

Successful response example:

Pix link is created, which can be displayed as a QR code, or copied / pasted by the user to make a payment.

Note: An operation ID is created, which is not the case with static codes.

{ 
 status: 'ok', 
 msg: '[100] Request ok.', code: 'S_OK', 
 data: { 
 emv: 
 ‘00020101021226790014br.gov.bcb.pix2557brcode.
 starkinfra.com/v2/e7b57429b43a4249bff71db68bee
 82ac5204000053039865802BR5 925Smartpay 
 Servicos 
 Digitai6013Florianopolis62070503***630420 C5',  
 operation: { 
  operation_type: 'sell', 
  curout: 'pxusdt', 
  curbase: 'brl', 
  curconv: 'pxusdt', 
  curin: 'brl', 
  nfe: 'in', 
  user: 'default', 
  txIn: [Object], 
  notify: '', operation_id: '1708531662822', 
  rate: [Object], remove: 'true', 
  profile: 'payment' }
}


KYC by SmartPay

First time purchases require KYC verification at kyc.smarpay.com.vc.

For documentation on KYC made by your business, refer to KYC by Client.

URL

https://kyc.smartpay.com.vc//?

Parameters (optional):

User information may be sent as parameters in the URL, to prefill the KYC form for the user.

  • chain: blockchain
    • polygon
    • solana
    • tron
  • address: destination wallet address.
  • cb_url: url to return to page after KYC is finished. Encoded.
    Example: https%3A%2F%2Fwww.mysite.com/callback
  • taxid: (cpf / cnpj) of the payer. Omit special characters.
  • email: valid email that the end-user can verify.
  • pixkey: must be a valid pixkey that the end-user can verify.
    • RANDOM KEY (chave aleátoria): As provided by the bank. Example: 6602ede6-b1a9-4e63-9178-c6883fd0095e
    • PHONE NUMBER: International format, with country code (+55), DDD (city code), followed by 9 digits. No spaces, no hyphens, encoded. Example: %2B5548996005588
    • CPF: 11 digits. No spaces, no special characters. Example: Example: 80042387413
    • CNPJ: 14 digits. No spaces, no special characters. Example: Example: 59456277000176
    • EMAIL: Valid email Example: john@gmail.com
  • phone: must be a valid phone number that the end-user can verify. International format, with country code (+55) encoded, DDD (city code), followed by 9 digits. No spaces, no hyphens, encoded. Example: %2B5548996005588

Example

  
https://kyc.smartpay.com.vc//?chain=polygon&address=0xA997C4352D1318e46a11b7a41dB852a3854736d9&taxid=80011469944&email=carlo@smartpay.com.vc&pixkey=6602ede6-b1a9-4e63-9178-c6883fd0094e&phone=%2B5548996005588&cb_url=https%3A%2F%2Fwww.mysite.com/callback
  

KYC Check

Use the following endpoint to check if a user is already KYCed.

https://connect.smartpay.com.vc/api/kyc/check?

KYC Check Parameters

  • chain_from: pix.
  • address_from: cpf/cnpj of the payer. Omit special characters.
  • address_to: destination wallet address registered with the payer.

Example

  
Example:
https://connect.smartpay.com.vc/api/kyc/check?chain_from=pix&chain_to=tron&address_from=04417845355&address_to=TW6UpdT215m689KN6ssaEAckriHHSJJ2JE

Response:


{ 
 "status":200, 
 "message":"request ok", 
 "data":{ 
 "has_kyc":false,"can_validate":true 
}}


KYC by Client

You might be authorized by SmartPay to run KYC yourself, under special conditions. If you were authorized to verify users yourself, use this documentation to send us the payer's info (at first time purchases).

Endpoint

POST /swapix/pixlinkverify

Payload parameters

Add the following payer information to your payload.

  • v_taxid: tax id (cpf / cnpj) of the payer. Omit special characters. (replaces docid parameter).
  • v_email: valid email.
  • v_phone: must be a valid phone number. International format, with country code (+XX), DDD (city code), followed by 9 digits. No spaces, no hyphens, no parenthesis.
  • v_country: country abbreviation of the payer's residence.
  • v_zip: postal code of the payer
  • v_num: residencial number of the payer's physical address
  • v_add: complement of the payer's physical address, such as an apartment number.

Payload example

var postdata = {  
"chain": "solana", 
“currency": "solusdt", 
“address": "0xA997C4352D1318e46a11b7a41dB852a3854736d9”, 
“amount_direction”: “in”, 
“amount”: “100.00”, 
“expire”: “900”, 
"v_taxid": "99999999999",  
"v_email": "some@client.com",  
"v_phone": "+55912341234",  
"v_country": "br",  
"v_zip" : "1234512",  
"v_num" : "12a",  
"v_add" : "left door",  
}

KYC Check

Use the following Endpoint to check if a user is already KYCed.

https://connect.smartpay.com.vc/api/smartpay/kyc/isverified?

KYC Check Parameters

  • chain_from: pix.
  • address_from: cpf/cnpj of the payer. Omit special characters.
  • address_to: destination wallet address of the payer.

Example


Example:
https://connect.smartpay.com.vc/api/smartpay/kyc/isverified?chain_from=pix&chain_to=tron&address_from=04417845355&address_to=TW6UpdT215m689KN6ssaEAckriHHSJJ2JE

Response:


{ 
 "status":200, 
 "message":"request ok", 
 "data":{ 
 "has_kyc":false,"can_validate":true 
}}


SDKs

Use these files to easily generate payment codes.

Download nodejs

Download python standard

Download python async

Download php



Paying Pix via Crypto MEMOS (Send Crypto --> Pay Pix)

Overview

It is possible for anyone to sell crypto (USDT) to pay Pix, by sending it to one of our approved wallets. Smartpay will instantly pay the pix key informed in the memo of the transaction. The completion time ranges within 20-30 seconds.

Official Wallets

These are our official receiving wallets to sell your USDT.

  • Polygon: 0xd75469e3a9f9f2ced454ac06f1880153c2158a60
  • Tron: TPiXaBPVTJ1M3d8YFrm2YFJEF4hFXpCGVw
  • Solana: AkV2neDQEKmwPAqLaoGZqncVMNsebrdDLY6rL8DJ6p79

Memo

Tron and Solana carry native memo functionality. Polygon's memo needs to be configured. Please refer to EVM Memo section.


EVM Memo (Polygon)

This section shows how to craft a transaction that includes a data payload (the “memo”). The approach works on any EVM network; we focus on Polygon.

Source repository

See examples and reference materials here: https://github.com/smartpayltda/ethereum_memo

How it works

  • Encode your memo text (UTF‑8) to hex (e.g., 0x68656c6c6f).
  • Place it into the transaction data field (for a simple transfer, this is a zero-value call to your own address with data attached, or a contract call).
  • Broadcast via a standard Ethereum RPC provider.

Quick example (pseudo)

// data (hex): 0x68656c6c6f  
// to: your EOA or a memo-aware contract  
// value: 0  
// gas: estimate via provider  
// chain: Polygon

Memos are public: do not include sensitive data. Refer to our encryption section.



Pix key format

There are four types of keys defined by BACEN (Brazilian Central Bank).

If the key is sent in the wrong format, it will be rejected by the bank, and an automatic refund will be issued to the sender address.

Important: The blockchain is public, so keys sent via the memo will be visible by everyone. We advise you to use only random keys, or encrypt the memo (not available for Solana). If you are using the memo feature in your platform, usage of keys via blockchain must be informed in your privacy policy.

1. CPF or CNPJ

CPF natural person or CNPJ legal person (business).

CPF:
Example: 462.336.580-80
11 digits. Send with no spaces, special characters.
Send as: 46233658080
CNPJ:
Example: 51.212.643/0001-30
14 digits. Send with no spaces, special characters.
Send as: 51212643000130

2. Mobile Phone Number

International format, with the country code, area code, and number.
Example: +55 (11) 9 1234-5678
Send as: +5511912345678

3. Email Address

A valid email address can be used as a PIX key.
Example: email@domain.com

4. Random Key (private)

The random key is automatically generated by the PIX system and consists of a unique and unpredictable string of letters and numbers.
Example: 123e4567-e12b-12d1-a456-426655440000

Key Check

Use this endpoint to check if the pix key has the right format before sending it

Method:GET


https://connect.smartpay.com.vc/api/smartpay/address/checkvalid?chain=pix&address= 

Reply example:

{
  "status": "ok",
  "msg": "[100] Request ok.",
  "code": "S_OK",
  "data": "Address is valid"
}


MEMO encryption

Use this encryption tool. Serves for Tron and Polygon.

Use this encryption tool for Solana.



Paying QR codes

QR Code Payments

You may also use the memo field to pay BR codes (QR Codes following BACEN standards). Insert the entire code to the memo, without using any special formatting and adding or removing spaces.

Endpoint to decode QR codes:

Use this endpoint to obtain payment information within the QR code.


https://connect.smartpay.com.vc/api/pix/qrdecode?qrcode=

Reply Example

{
  amount": 20, // if amount = 0, must be defined
  "name": "CARLO A S D CASTILLO", // name of payee
  "key": "6602ede6-b1a9-4e63-9178-c6883fd0095e", // destination key
  "timeout": 120 // payment expiration, in seconds
}

if amount=0 on the reply means it has no amount and needs to be defined by the user.



Paying Boletos

You may also use the memo field to pay Boletos. Just add the boleto code in plain text on the memo, no formatting or spaces.



Status API

Endpoint

Method:GET

https://connect.smartpay.com.vc/api/swapix/txstatus

BUY USDT (PIX -> USDT)

Parameters:

  • chain:
    • Use “smartpay”, and get status using the operation ID of the transaction.
    • Use “pix”, get status using the E2E of the pix of the transaction.
  • txid:
    • Use the operation ID, if chain is “smartpay.”
    • Use the E2E of the pix payment, if chain is “pix.”

Examples:

The user bought USDT with pix, and you use the operation ID.

https://connect.smartpay.com.vc/api/swapix/txstatus?chain=smartpay&txid=1708531662822

The user bought USDT with pix, and you use the E2E (bank receipt ID) of the pix.

https://connect.smartpay.com.vc/api/swapix/txstatus?chain=pix&txid=E2323283928392833

Response Example

Response with txid - confirmation of the blockchain.

{
  "status": "ok",
  "msg": "[100] Request ok.",
  "code": "S_OK",
  "data": {
    "status": "done",
    "txid": "0xbeacdedc870a8d83e6a6c2a643274c3111c529c4ae3bfe1825ebe99f87792099",
    "rate": {
      "amount_brl": "3000.37",
      "price_usd": "5.1046",
      "total_brl": "3162.00",
      "fee_brl": "161.63",
      "send_usd": "587.772480",
      "timeout": 611,
      "amount_usd": "587.772480",
      "price_pxusdt": 1,
      "value_pxusdt": "587.772480",
      "send_pxusdt": "587.772480"
    }
  }
}

SELL USDT (USDT -> PIX)

Parameters:

  • chain: Use blockchain.
    • tron
    • solana
    • polygon
  • txid:
    • Use transaction hash.

Examples

You sold USDT to pay pix.

https://connect.smartpay.com.vc/api/swapix/txstatus?chain=polygon&txid=0x04f12b2cbe0eb65d56bbfe3ef78612c9d86266a32d84fd919eab7b4b04e99c9d

Response Example

Response with txid - confirmation e2e of the bank.

{
  "status": "ok",
  "msg": "[100] Request ok.",
  "code": "S_OK",
  "data": {
    "status": "done",
    "txid": "E13935893202403211421iKJ1m6X9K4I",
    "rate": {
      "amount_usd": "9.4137",
      "price_usd": "0.2026",
      "total_brl": "46.46",
      "fee_brl": "0.46",
      "send_brl": "46.00",
      "timeout": 483,
      "amount_pxusdt": "9.413730",
      "price_pxusdt": 1,
      "value_usd": "9.4137",
      "send_pxusdt": "9.4137"
    }
  }
}

Other responses

  • Fail - Refunded

The transaction was refunded to the source address, due to using an incorrect or unexistent pix key.



Status — Swap Quote

Endpoint

Method:GET

https://connect.smartpay.com.vc/api/swapix/swapquote

BUY USDT (PIX -> USDT)

Parameters

  • currency: brl
  • type: sell (Smartpay sells)
  • profile: payment
  • conv:
    • pxusdt (polygon)
    • txusdt (tron)
    • sxusdt (solana)
  • target
    • amount: calculates amount to pay ("you must pay X BRL to receive Y USDT")
    • all: calculates amount to receive ("you will receive Y USDT if you pay X BRL")
  • amount: <float> - Floating point number
  • user: <string> - username (custom fees)

Example 1

How much BRL has to be paid so I receive 10 USDT in Polygon.

https://connect.smartpay.com.vc/api/swapix/swapquote?currency=brl&profile=payment&type=sell&conv=pxusdt&target=amount&amount=10&user=myuser

Response

{
 "status": "ok",
 "msg": "[100] Request ok.", "code": "S_OK",
 "data": {
  "amount_brl": "48.99",
  "price_usd": "4.8996",
  "total_brl": "53.60",
  "fee_brl": "4.61",
  "send_usd": "9.998850",
  "timeout": 474,
  "amount_usd": "9.998850",
  "price_pxusdt": 1,
  "value_pxusdt": "9.998850",
  "send_pxusdt": "10"
 }}

Example 2

How much USD₮ on Polygon you’ll receive when paid 10 BRL.

https://connect.smartpay.com.vc/api/swapix/swapquote?currency=brl&profile=payment&type=sell&conv=pxusdt&target=all&amount=10&user=myuser

Response

{
 "status": "ok",
 "msg": "[100] Request ok.", "code": "S_OK",
 "data": {
  "amount_brl": "6.70",
  "price_usd": "4.8996",
  "total_brl": "10",
  "fee_brl": "3.30",
  "send_usd": "1.367470",
  "timeout": 175,
  "amount_usd": "1.367470",
  "price_pxusdt": 1,
  "value_pxusdt": "1.367470",
  "send_pxusdt": "1.367470"
 }}

SELL USDT (USDT -> PIX)

Parameters

  • currency: brl
  • type: buy (Smartpay buys)
  • profile: transfer
  • conv:
    • pxusdt (polygon)
    • txusdt (tron)
    • sxusdt (solana)
  • target
    • amount: calculates amount to pay ("you must pay X USDT to receive Y BRL")
    • all: calculates amount to receive ("you will receive X BRL if you pay Y USDT")
  • amount: <float> - Floating point number
  • user: <string> - username (custom fees)

Example 1

How much USD₮ on Polygon should I sell to receive 10 BRL.

https://connect.smartpay.com.vc/api/swapix/swapquote?currency=brl&profile=transfer&type=buy&conv=pxusdt&target=amount&amount=10&user=myuser
Response
{
 "status": "ok",
 "msg": "[100] Request ok.", "code": "S_OK",
 "data": {
  "amount_usd": "2.0827",
  "price_brl": "0.2041",
  "total_brl": "10.20",
  "fee_brl": "0.20",
  "send_brl": "10",
  "timeout": 1518,
  "amount_pxusdt": "2.082650",
  "price_pxusdt": 1,
  "value_usd": "2.0827",
  total_pxusdt": "2.0827"
 }}

Example 2

How much BRL you’ll receive when you sell 10 USD₮ on Polygon.

https://connect.smartpay.com.vc/api/swapix/swapquote?currency=brl&profile=transfer&type=buy&conv=pxusdt&target=all&amount=10&user=myuser
Response
{
 "status": "ok",
 "msg": "[100] Request ok.", "code": "S_OK",
 "data": {
  "amount_usd": "10.0000",
  "price_brl": "0.2041",
  "total_brl": "49.00",
  "fee_brl": "0.98",
  "send_brl": "48.02",
  "timeout": 1178,
  "amount_pxusdt": "10",
  "price_pxusdt": 1,
  "value_usd": "10.0000",
  "total_pxusdt": "10.0000"
 }}