# Check Order

After creating the order you can make a "check-order" request to check if the order was paid or not. as a response, you will get the same data as in the "deposit-callback" webhook.

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request POST 'https://merchant.fcfpay.com/api/v1/check-order' \
--header 'Authorization: Bearer YOUR_LIVE_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
	"order_id": "68"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_LIVE_API_KEY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "order_id": "58"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://merchant.fcfpay.com/api/v1/check-order", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Node.js" %}

```
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://merchant.fcfpay.com/api/v1/check-order',
  'headers': {
    'Authorization': 'Bearer YOUR_LIVE_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "order_id": "68"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="PHP" %}

```
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://merchant.fcfpay.com/api/v1/check-order',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
	"order_id": "68"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_LIVE_API_KEY',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="Python" %}

```
import requests
import json

url = "https://merchant.fcfpay.com/api/v1/check-order"

payload = json.dumps({
  "order_id": "58"
})
headers = {
  'Authorization': 'Bearer YOUR_LIVE_API_KEY',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}

## Check Order

<mark style="color:green;">`POST`</mark> `https://merchant.fcfpay.com/api/v1/check-order`

#### Query Parameters

| Name                                        | Type   | Description                    |
| ------------------------------------------- | ------ | ------------------------------ |
| order\_id<mark style="color:red;">\*</mark> | string | The Order ID you want to check |

{% tabs %}
{% tab title="200: OK Call successfull, payment deposited" %}

```javascript
{
    "success": true,
    "data": {
        "deposited": true,
        "order_id": "152",
        "user_id": "",
        "txid": "0x0437fda31de9a4e998cc8a1c00e1c6c605327401ce7edeb6e86c752f0be76ac3",
        "unique_id": "0x0437fda31de9a4e998cc8a1c00e1c6c605327401ce7edeb6e86c752f0be76ac3_0",
        "confirm_blocks": 27,
        "fiat_amount": "10.00",
        "fiat_currency": "USD",
        "amount": "25580000000000000",
        "currency": "BSC",
        "fees": "210000000000000",
        "decimal": 18,
        "fee_decimal": 18
    },
    "message": "Successfully fetched."
}
```

{% endtab %}

{% tab title="200: OK Call successfull, payment not deposited" %}

```javascript
{
    "success": true,
    "data": {
        "deposited": false,
        "order_id": "68",
        "user_id": "",
        "txid": "",
        "unique_id": "",
        "confirm_blocks": "",
        "fiat_amount": "",
        "fiat_currency": "CAD",
        "amount": "",
        "currency": "",
        "fees": "",
        "decimal": "",
        "fee_decimal": ""
    },
    "message": "Successfully fetched."
}
```

{% endtab %}
{% endtabs %}


---

# 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://api-docs.fcfpay.com/reference/api-requests-v1-deprecated/check-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.
