> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ramphub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Order intent

> Read the current active payment window for a customer, token, and network.

Use this page when you need to show a countdown for an active order window.

RampHub keeps one active order intent per customer, token, and network at a time, whether the order is a buy or a sell. The intent usually lasts 30 minutes and closes automatically when the underlying order completes, cancels, or expires.

Merchant apps can use this endpoint to check whether a customer already has an active window before they create a new order. If the order create request comes back with `PAYCHAIN_ACTIVE_INTENT_CONFLICT`, inspect the returned `conflict.activeIntent` data and decide whether to ask the customer to wait or resend the order with `overrideActiveIntent: true`.

## Get the active window

`GET /api/developer/orders/intent`

### Query parameters

* `customerId` - the customer or user identifier used when the order was created
* `token` - the token symbol, such as `USDT` or `USDC`
* `network` - the network for the order, such as `base`, `bsc`, or `solana`

### Example request

```bash theme={null}
curl -X GET "https://api.ramphub.io/api/developer/orders/intent?customerId=cust_7f3b8a2d&token=USDT&network=base" \
  -H "x-api-key: rh_live_..."
```

### Example response

```json theme={null}
{
  "success": true,
  "transactionId": "RH-TX-AB12CD34",
  "customerId": "cust_7f3b8a2d",
  "externalCustomerId": "cust_7f3b8a2d",
  "token": "USDT",
  "network": "base",
  "side": "buy",
  "transactionStatus": "order_placed",
  "intentId": "intent_123",
  "intentStatus": "active",
  "externalOrderId": "RH-TX-AB12CD34",
  "depositAddress": "0xPaychainDeposit",
  "expectedAmount": "10.75",
  "amountToleranceBps": 50,
  "depositIntentCreatedAt": "2026-06-16T08:00:00.000Z",
  "depositIntentExpiresAt": "2026-06-16T08:30:00.000Z",
  "timeRemainingSeconds": 1800
}
```

If there is no active window for that customer and rail, RampHub returns `404`.

## How API clients should use this

* Call this endpoint before order creation if you want to show the active window first.
* Handle `PAYCHAIN_ACTIVE_INTENT_CONFLICT` from `POST /api/developer/orders` as a normal product flow, not as a fatal error.
* If the customer chooses to continue and replace the active order, resend the order request with `overrideActiveIntent: true`.

### Conflict response from order creation

When an active window already exists, the order create endpoint can return a structured response like this:

```json theme={null}
{
  "success": false,
  "code": "PAYCHAIN_ACTIVE_INTENT_CONFLICT",
  "message": "There is an active order on the same chain and token. Please cancel it or continue to replace it.",
  "conflict": {
    "customerId": "cust_7f3b8a2d",
    "externalCustomerId": "cust_7f3b8a2d",
    "token": "USDT",
    "chain": "base",
    "networkId": "base",
    "activeIntentCount": 1
  }
}
```

Your app can use the `conflict` object to show the current window to the customer, then either wait or resend the order with `overrideActiveIntent: true`.
