> ## Documentation Index
> Fetch the complete documentation index at: https://cryptouse-d1f5ba06.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Consultar Ordem Onchain

> Obtenha detalhes de uma ordem blockchain específica

## Consultar detalhes da ordem

Este endpoint retorna informações detalhadas sobre uma ordem blockchain específica usando seu ID de link de pagamento.

### Parâmetros de caminho

<ParamField path="paymentLinkId" type="string" required>
  ID do link de pagamento da ordem
</ParamField>

### Exemplo de requisição

```bash theme={null}
curl -X GET "https://server.cryptouse.com.br/api/v1/onchain/order/0b664ca9-40a4-4692-80e7-f94392bbb4bf" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer seu_token_aqui"
```

### Resposta

<ResponseField name="order" type="object">
  <Expandable title="Propriedades">
    <ResponseField name="network" type="string">
      Rede blockchain utilizada

      Valores possíveis: `eth`, `bsc`, `polygon`
    </ResponseField>

    <ResponseField name="value" type="number">
      O valor em BRL da ordem
    </ResponseField>

    <ResponseField name="cryptoValue" type="number">
      O valor em criptomoeda
    </ResponseField>

    <ResponseField name="address" type="string">
      Endereço da carteira de criptomoeda
    </ResponseField>

    <ResponseField name="asset" type="string">
      Tipo de criptomoeda

      Valores possíveis: `USDT`, `USDC`, `DAI`, `BUSD`
    </ResponseField>

    <ResponseField name="status" type="string">
      Status atual do pagamento

      Valores possíveis: `PENDING`, `COMPLETED`, `REFUNDED`, `PARTIAL_ORDER`, `FAILED`
    </ResponseField>

    <ResponseField name="metadata" type="object">
      <Expandable title="Propriedades">
        <ResponseField name="orderId" type="string">
          ID da ordem
        </ResponseField>

        <ResponseField name="tokenAddress" type="string">
          Endereço do contrato do token
        </ResponseField>

        <ResponseField name="network" type="string">
          Rede blockchain
        </ResponseField>

        <ResponseField name="walletIndex" type="number">
          Índice da carteira
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="paymentLinkId" type="string">
      Identificador único para o pagamento
    </ResponseField>

    <ResponseField name="createdAt" type="string" format="date-time">
      Timestamp de criação
    </ResponseField>
  </Expandable>
</ResponseField>

### Exemplo de resposta

<CodeGroup>
  ```json Sucesso (200) theme={null}
  {
    "order": {
      "network": "bsc",
      "value": 100,
      "cryptoValue": 0.179,
      "address": "0xdC1bEaD90005669BbFc310624E3B22B2CeeE3D94",
      "asset": "USDT",
      "status": "PENDING",
      "metadata": {
        "orderId": "29fdcad5-836f-463f-b770-180bcd80da40",
        "tokenAddress": "0x55d398326f99059ff775485246999027b3197955",
        "network": "bsc",
        "walletIndex": 1100429915
      },
      "paymentLinkId": "0b664ca9-40a4-4692-80e7-f94392bbb4bf",
      "createdAt": "2025-07-30T17:30:54.387Z"
    }
  }
  ```

  ```json Ordem não encontrada (400) theme={null}
  {
    "success": false,
    "error": "Order not found"
  }
  ```
</CodeGroup>

## Redes e Assets Suportados

### Redes Blockchain

| Rede      | Descrição           |
| --------- | ------------------- |
| `eth`     | Ethereum Mainnet    |
| `bsc`     | Binance Smart Chain |
| `polygon` | Polygon (Matic)     |

### Assets de Criptomoeda

| Asset  | Descrição      |
| ------ | -------------- |
| `USDT` | Tether USD     |
| `USDC` | USD Coin       |
| `DAI`  | Dai Stablecoin |
| `BUSD` | Binance USD    |

## Status da ordem

| Status          | Descrição                                          |
| --------------- | -------------------------------------------------- |
| `PENDING`       | A ordem foi criada mas ainda não recebeu pagamento |
| `COMPLETED`     | O pagamento foi recebido e confirmado              |
| `REFUNDED`      | A ordem foi reembolsada                            |
| `PARTIAL_ORDER` | Foi recebido um pagamento parcial                  |
| `FAILED`        | A ordem falhou por algum motivo                    |

## Notas

* As ordens completadas não podem ser modificadas
* Ordens com status `PENDING` expiram após 24 horas
* Para ordens com status `PARTIAL_ORDER`, verifique o campo `status` para determinar se há pagamentos parciais
