# Fetch Order

### Fetch order

### This endpoint is used to fetch an order to verify its status

<mark style="color:blue;">`GET`</mark> `https://prod-order-exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/FetchOrder?partner_order_id=xx&partner_id=xx/`

**Order Status**&#x20;

Pending = newly created orders that has not been fulfilled in 45 mins&#x20;

Completed = Order that has been fulfilled and a callback has been returned in 45 mins&#x20;

Mismatched = this is when a user pays above or below the amount on the order.&#x20;

Expired = Order that payment was made but callback wasnt returned in 45 mins&#x20;

Abandoned = an order that a user hasnt paid into in over 45 mins&#x20;

Claimed = in cases of mismatched and expired merchants can decide to claim the money paid&#x20;

#### Query Parameters

| Name                                                 | Type   | Description                   |
| ---------------------------------------------------- | ------ | ----------------------------- |
| partner\_order\_id<mark style="color:red;">\*</mark> | String | the id of the order generated |
| partner\_id                                          | String | the Id of the partner         |

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | partners public key |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json    |

{% tabs %}
{% tab title="200: OK successful response" %}

```
{
  "status": "success",
  "id":"",
  "partner_id":"",
  "order_notify_url":"",
  "exchanger_user_id":"",
  "intrapay_merchant_id":""
  "messsage": "",
  "data": {
        "payment": {
            "status": "PENDING | PAID | REFUND"

            },
        "virtual_account": {
        "amount": "",
        "account_name": "",
        "bank_name": "",
        "account_number": ""
      },
     "order_details": {
     "status": "PENDING | COMPLETED | EXPIRED | CANCELED",
     "partner_order_id": "",
     "intrapay_order_reference": ""
     }

 }

}
```

{% endtab %}

{% tab title="400: Bad Request failed response" %}

```
{
  "status": "fail",
  "messsage": ""
}
```

{% endtab %}
{% endtabs %}

#### Example Request- Code&#x20;

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

```javascript
const fetch = require('node-fetch');

fetch("https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/FetchOrder?partner_order_id=xxxxx", {
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer pk_partner_xxxx",
    "cookie": "connect.sid=s%253AoNBPv4ez8npeuKVKlS9KwX_1Dshiamlf.n8opjPuoF3XsU%252Be0VTLMUe6xzeAXmpCfQrpW9KW1KDs"
  }
})
  .then(response => console.log(response))
  .catch(err => console.error(er
```

{% endtab %}
{% endtabs %}
