# Retrieve a Specific Order

This API retrieves the detail of a specific order using its order ID.

#### Endpoint Information

* **Request Header**: `X-BH-TOKEN: ******`
* **Request Method**: `GET`
* **Request Path**: `/v2/order/detail`
* **Authorization**: Required

**Query Parameters**

* **orderId:** (int)  The id of the order
* **orderType**: (string) The type of the order, `fiat_to_crypto crypto_to_fiat fiat_to_fiat`

<pre class="language-url"><code class="lang-url"><strong>/v2/order/detail?orderId=493829236956962816&#x26;orderType=fiat_to_crypto
</strong></code></pre>

#### Response Structure

When the order type is `fiat_to_crypto` and `crypto_to_fiat`, the response will include the following fields:

* cod&#x65;**:** (number)  response code
* msg: (string) message
* data: (object) order info
* **orderId**: (int) id of the order
* **clientId**: (string) a id defined by client
* **merchantId**: (int)  id of the merchant settings
* **paymentId**: (int)  id of paymenyId (`fiat_to_crypto`)
* **userPaymentId**: (int)  id of user paymenyId (`crypto_to_fiat`)
* **country**: (string) name of the country
* **crypto**: (string) name of the crypto currency&#x20;
* **fiat**: (string) name of the fiat currency&#x20;
* **orderType**: (string) type of the order
* **orderPrice**: (string) exchange rate when create orden
* **cryptoAmount**: (string) amount of crypto currency
* **fiatAmount**: (string) amount of fiat currency
* **fiatFee**: (string) fee of the order
* **orderStatus**: (int) status of the order
  * **10: reviewing** — The order has entered the review stage. If approved, the status will be updated to 11, 31, or 40 depending on the outcome.
  * **11: request for information** — An RFI was triggered and supporting documents must be submitted. Once documents are submitted, the status changes to 12.
  * **12: uploaded RFI Information** — RFI documents have been uploaded and are awaiting compliance review. After approval, the status will change to 31 or 40 depending on the result.
  * **30: approved** — This order was created by our system and is waiting for the user to accept. After acceptance, the status will transition to 31 or 40 as applicable.
  * **31: support documents pending** — This status indicates required supporting documents must be provided. Once submitted and accepted, the status becomes 40.
  * **40: pending payment** — The order is awaiting payment. After successful payment, the status will change to 50.
  * **50: paid** — Payment has been completed. For on-ramp orders, the status typically advances to 60 immediately; for off-ramp orders it will normally change to 60 after about 30 minutes, or can be moved to 60 sooner by calling the /v2/order/confirm endpoint.
  * **60: released** — The order is complete.
  * **70: canceled** — The order has been canceled (e.g., due to review rejection or timeout).
  * **72: refunded**— The order has been refunded. It is derived from the state changes of 60 or 73.
  * **73: refunding** — The order has been refunding. It is derived from the state changes of 60.
* **traceNumber**: (string) id of the national central bank order
* **paymentInfo**: (object) info of the payment
* **failCode**: (string) order failed code
* **failReason**: (string) order failure description
* **createTime**: (string) create time of the order
* **completedTime**: (string) completed time of the order

<pre class="language-json"><code class="lang-json">{
<strong>    "code": 200,
</strong>    "msg": "SUCCESS",
    "data": {
        "orderId": "493829236956962816",
        "clientId": "f_c_0250222004",
        "merchantId": 3,
        "paymentId": 0,
        "userPaymentId": 0,
        "country": "Mexico",
        "crypto": "USDT",
        "fiat": "MXN",
        "orderType": "fiat_to_crypto",
        "orderPrice": "21.4104",
        "cryptoAmount": "5.1376",
        "fiatAmount": "110",
        "fiatFee": "0",
        "orderStatus": 60,
        "hasRefund": 0,
        "failCode": 0, 
        "failReason": "",
        "traceNumber": "20241223907069062e51744c4f0e57",
        "paymentInfo": {
            "Cuenta CLABE": "706180304649761358"
        },
        "createTime": "1740214865000",
        "completedTime": "1740214866000"
    }
}
</code></pre>

When the order type is `fiat_to_fiat`, the response will include the following fields:

* cod&#x65;**:** (number)  response code
* msg: (string) message
* data: (object) order info
* **orderId**: (int) id of the order
* **clientId**: (string) a id defined by client
* **onRampMerchantId**: (int)  id of the merchant
* **onRampPaymentId**: (int)  id of user paymenyId
* **onRampCountry**: (string) name of the country
* **onRampFiat**: (string) name of the fiat currency
* **onRampFiatAmount**: (string) amount of fiat currency
* **onRampFiatFee**: (string) fee of the order
* **offRampMerchantId**: (int)  id of the merchant
* **offRampPaymentId**: (int)  id of user paymenyId
* **offRampCountry**: (string) name of the country
* **offRampFiat**: (string) name of the fiat currency
* **offRampFiatAmount**: (string) amount of fiat currency
* **offArriveRampFiatAmount**: (string) arrive amount of fiat currency
* **offRampFiatFee**: (string) fee of the order
* **orderPrice**: (string) exchange rate when create order
* **orderStatus**: (int) status of the order(10: pending, 11: request for information, 12: uploaded RFI Information, 30: approved, 31: support documents pending, 41: payin pending, 51: payout pending, 60: released, 71: payin canceled, 72: payout canceled)
* **onRampPaymentInfo**: (object) info of the payment
* **offRampPaymentInfo**: (object) info of the payment
* **createTime**: (string) create time of the order
* **completedTime**: (string) completed time of the order

```json
{
    "code": 200,
    "msg": "SUCCESS",
    "data": {
        "orderId": "494541042692263936",
        "clientId": "c_f_0250224003",
        "onRampMerchantId": 3,
        "onRampPaymentId": 17,
        "onRampCountry": "Mexico",
        "onRampFiat": "MXN",
        "onRampFiatAmount": "110",
        "onRampFiatFee": "1",
        "offRampCountry": "Argentina",
        "offRampMerchantId": 4,
        "offRampPaymentId": 134,
        "offRampFiat": "ARS",
        "offRampFiatAmount": "6156.3",
        "offArriveRampFiatAmount": "6155.3",
        "offRampFiatFee": "1",
        "orderPrice": "55.9664",
        "orderStatus": 31,
        "onRampPaymentInfo": {
            "Cuenta CLABE": "706180304649761358"
        },
        "offRampPaymentInfo": {
            "Cuenta CLABE": "706180304649761358"
        }
        "createTime": "1740384573000",
        "completedTime": "1740384573000"
    }
}
```

#### Notes

* Ensure that valid authorization tokens are included in the request headers for successful execution.
* The `paymentInfo` object will vary based on the country and payment method used.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.velafi.com/api-reference/order/retrieve-a-specific-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
