Consultar Ordem Crypto-PIX
curl --request GET \
--url https://api.example.com/api/v1/crypto-pix/order/{id} \
--header 'id: <id>'import requests
url = "https://api.example.com/api/v1/crypto-pix/order/{id}"
headers = {"id": "<id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {id: '<id>'}};
fetch('https://api.example.com/api/v1/crypto-pix/order/{id}', 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/order/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"id: <id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/crypto-pix/order/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("id", "<id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/crypto-pix/order/{id}")
.header("id", "<id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/crypto-pix/order/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["id"] = '<id>'
response = http.request(request)
puts response.read_body{
"value": 123,
"cryptoValue": 123,
"updatedAt": "<string>",
"status": "<string>",
"network": "<string>",
"address": "<string>",
"receivedValue": 123,
"originalCryptoValue": 123,
"partialUpdatedAt": "<string>",
"partialBrlValue": 123,
"isPartial": true,
"remaining": 123,
"hash": "<string>",
"btcQuote": 123,
"satoshis": "<string>"
}Crypto PIX
Consultar Ordem Crypto-PIX
Obtenha detalhes de um pagamento Crypto-PIX
GET
/
api
/
v1
/
crypto-pix
/
order
/
{id}
Consultar Ordem Crypto-PIX
curl --request GET \
--url https://api.example.com/api/v1/crypto-pix/order/{id} \
--header 'id: <id>'import requests
url = "https://api.example.com/api/v1/crypto-pix/order/{id}"
headers = {"id": "<id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {id: '<id>'}};
fetch('https://api.example.com/api/v1/crypto-pix/order/{id}', 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/order/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"id: <id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/crypto-pix/order/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("id", "<id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/crypto-pix/order/{id}")
.header("id", "<id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/crypto-pix/order/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["id"] = '<id>'
response = http.request(request)
puts response.read_body{
"value": 123,
"cryptoValue": 123,
"updatedAt": "<string>",
"status": "<string>",
"network": "<string>",
"address": "<string>",
"receivedValue": 123,
"originalCryptoValue": 123,
"partialUpdatedAt": "<string>",
"partialBrlValue": 123,
"isPartial": true,
"remaining": 123,
"hash": "<string>",
"btcQuote": 123,
"satoshis": "<string>"
}Consultar detalhes do pagamento Crypto-PIX
Este endpoint retorna informações detalhadas sobre um pagamento Crypto-PIX específico usando seu ID.Parâmetros da URL
string
required
O ID codificado em base64 da ordem de pagamento
Exemplo de requisição
curl -X GET "https://server.cryptouse.com.br/api/v1/crypto-pix/order/Y3B0cGl4XzEyMzQ1YWJjZGU=" \
-H "Authorization: Bearer seu_token_aqui"
Resposta
number
O valor em BRL do pagamento
number
O valor em criptomoeda
string
Timestamp da última atualização
string
Status atual do pagamentoValores possíveis:
PENDING, COMPLETED, REFUNDED, PARTIAL_ORDER, FAILEDstring
Rede blockchain usada para o pagamento
string
Endereço da carteira de criptomoeda
number
Valor recebido (se pagamento parcial)
number
Valor original em criptomoeda
string
Timestamp de quando o pagamento parcial foi recebido
number
Valor parcial em BRL
boolean
Indica se a ordem foi parcialmente paga
number
Valor restante a ser pago, se parcial
string
Hash da transação blockchain
number
Cotação do BTC em BRL (apenas para rede Lightning)
string
Valor em satoshis (apenas para rede Lightning)
Exemplo de resposta
{
"hash": "0x1234567890abcdef...",
"btcQuote": 0,
"value": 120.50,
"cryptoValue": 30.25,
"updatedAt": "2023-04-20T15:30:45Z",
"status": "COMPLETED",
"network": "bsc",
"address": "0x1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t",
"receivedValue": 30.25,
"originalCryptoValue": 30.25,
"partialUpdatedAt": null,
"partialBrlValue": null,
"isPartial": false,
"remaining": 0
}
{
"hash": "lnbc1234567890abcdef...",
"btcQuote": 250000.00,
"value": 120.50,
"cryptoValue": 0.000482,
"updatedAt": "2023-04-20T15:30:45Z",
"status": "COMPLETED",
"network": "lightning",
"address": "lnbc1234567890abcdef...",
"receivedValue": 0.000482,
"originalCryptoValue": 0.000482,
"partialUpdatedAt": null,
"partialBrlValue": null,
"isPartial": false,
"remaining": 0,
"satoshis": "48200"
}
{
"hash": "0x1234567890abcdef...",
"btcQuote": 0,
"value": 120.50,
"cryptoValue": 30.25,
"updatedAt": "2023-04-20T15:30:45Z",
"status": "PARTIAL_ORDER",
"network": "bsc",
"address": "0x1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t",
"receivedValue": 15.12,
"originalCryptoValue": 30.25,
"partialUpdatedAt": "2023-04-20T15:15:30Z",
"partialBrlValue": 60.25,
"isPartial": true,
"remaining": 60.25
}
{
"message": "PayCryptoPix not found"
}
Status do pagamento
Os status possíveis para um pagamento Crypto-PIX são:| Status | Descrição |
|---|---|
PENDING | A ordem foi criada mas ainda não recebeu pagamento |
COMPLETED | O pagamento foi recebido, convertido e o PIX foi enviado com sucesso |
PARTIAL_ORDER | Foi recebido um pagamento parcial em criptomoeda |
REFUNDED | O pagamento foi reembolsado (por falha na conversão ou no envio do PIX) |
FAILED | O pagamento falhou por algum motivo |
Pagamentos parciais
Quando um pagamento parcial é recebido:- O status muda para
PARTIAL_ORDER - O campo
receivedValueé atualizado com o valor recebido - O campo
partialBrlValuemostra o valor em BRL já pago - O campo
remainingindica o valor restante a ser pago - O campo
partialUpdatedAté atualizado com o timestamp da transação parcial
Processamento do PIX
Após receber o pagamento em criptomoeda:- Convertemos o valor para BRL
- Processamos o pagamento PIX para o destinatário
- Atualizamos o status da ordem para
COMPLETED
Campos específicos por rede
Lightning Network
btcQuote: Cotação atual do BTC em BRLsatoshis: Valor em satoshis (calculado automaticamente)
Outras redes
btcQuote: Sempre 0satoshis: Não incluído na resposta
