Processar Pagamento PIX
curl --request POST \
--url https://api.example.com/api/v1/crypto-pix/onchain/pay \
--header 'Content-Type: application/json' \
--data '
{
"qrcode": "<string>",
"network": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/crypto-pix/onchain/pay"
payload = {
"qrcode": "<string>",
"network": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({qrcode: '<string>', network: '<string>'})
};
fetch('https://api.example.com/api/v1/crypto-pix/onchain/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/crypto-pix/onchain/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'qrcode' => '<string>',
'network' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/crypto-pix/onchain/pay"
payload := strings.NewReader("{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/crypto-pix/onchain/pay")
.header("Content-Type", "application/json")
.body("{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/crypto-pix/onchain/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pixKey": "<string>",
"payCryptoPixId": "<string>",
"value": 123
}
}Crypto PIX
Processar Pagamento PIX
Converta criptomoeda e faça um pagamento PIX
POST
/
api
/
v1
/
crypto-pix
/
onchain
/
pay
Processar Pagamento PIX
curl --request POST \
--url https://api.example.com/api/v1/crypto-pix/onchain/pay \
--header 'Content-Type: application/json' \
--data '
{
"qrcode": "<string>",
"network": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/crypto-pix/onchain/pay"
payload = {
"qrcode": "<string>",
"network": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({qrcode: '<string>', network: '<string>'})
};
fetch('https://api.example.com/api/v1/crypto-pix/onchain/pay', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/crypto-pix/onchain/pay",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'qrcode' => '<string>',
'network' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/crypto-pix/onchain/pay"
payload := strings.NewReader("{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/crypto-pix/onchain/pay")
.header("Content-Type", "application/json")
.body("{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/crypto-pix/onchain/pay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"qrcode\": \"<string>\",\n \"network\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pixKey": "<string>",
"payCryptoPixId": "<string>",
"value": 123
}
}Processar pagamento de criptomoeda para PIX
Este endpoint permite converter criptomoeda e realizar um pagamento PIX usando o QR code fornecido.Requisição
string
required
O QR code PIX a ser processado
string
required
Rede blockchain a ser utilizadaValores possíveis:
bsc, ethExemplo de requisição
curl -X POST "https://server.cryptouse.com.br/api/v1/crypto-pix/onchain/pay" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer seu_token_aqui" \
-d '{
"qrcode": "00020101021226890014br.gov.bcb.pix2557brcode.example.com/pix/v2/cobv/9d36b84f10194c88ab8b9113b94fb24825204000053039865802BR5913EMPRESA TESTE6008SAO PAULO62070503***6304E2CA",
"network": "bsc"
}'
Resposta
object
Exemplo de resposta
{
"data": {
"pixKey": "email@exemplo.com",
"payCryptoPixId": "cptpix_12345abcde",
"value": 120.50
}
}
{
"message": "QR code PIX inválido ou mal-formatado"
}
{
"message": "Ocorreu um erro ao processar sua solicitação"
}
Como funciona o Crypto-PIX
O serviço Crypto-PIX permite que você pague contas e transferências PIX usando criptomoedas. O processo funciona da seguinte forma:- Você envia o QR code PIX e a rede blockchain desejada
- Nosso sistema lê o QR code e extrai as informações do pagamento
- É criado um endereço de carteira para receber a criptomoeda
- Você transfere a criptomoeda para o endereço gerado
- Após a confirmação, realizamos o pagamento PIX para o destinatário
Taxa de conversão
A taxa de conversão entre criptomoeda e BRL é fixada no momento em que a requisição é recebida. Isto garante que o valor exato em BRL seja pago, independentemente de flutuações no preço da criptomoeda durante o processamento.Suporte a diferentes tipos de PIX
Este endpoint suporta todos os tipos de QR codes PIX:- PIX estático
- PIX dinâmico
- PIX Copia e Cola (BRCode)
- Faturas PIX (QR code com valor definido)
Tempo de processamento
O tempo de processamento depende da rede blockchain selecionada:| Rede | Tempo estimado |
|---|---|
| BSC (Binance Smart Chain) | 30 segundos a 2 minutos |
| ETH (Ethereum) | 1 a 10 minutos |
