# Initial page

## Get Order Report

<mark style="color:green;">`POST`</mark> `https://{admin-domain-name}/api/order/report`

The end point allows you to get order report.

#### Headers

| Name          | Type   | Description              |
| ------------- | ------ | ------------------------ |
| Authorization | string | Bearer "auth token here" |

#### Request Body

| Name            | Type   | Description                                                                                                                                                                                                                                                            |
| --------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| affiliate\_type | string | If value is "QRCODE",result will be order report with affiliate\_type equals to "QRCODE"                                                                                                                                                                               |
| fixedRange      | string | Values should be "24h", "1w" or "today". If the value is "24h" ,result will be order report from last 24 hours.If the value is "today", result will be order report from midnight to current time. If the value is "1w", result will be order report from last 7 days. |
| from            | string | It should be date string in yyyy-mm-dd format.It indicates from which date you want order report.                                                                                                                                                                      |
| to              | string | It should be date string in yyyy-mm-dd format. It indicates from which date to , to which date you want the order report.                                                                                                                                              |

{% tabs %}
{% tab title="200 Order report retrieved successfully." %}

```
{
    "code": 200,
    "success": "true",
    "message": "SUCCESS",
    "data": [
        {
            "unique_order_id": "OD-10-08-UOAM-PGRYJQLOJ",
            "created_at": "2020-10-08T13:44:44.000000Z",
            "orderStatus": "Order Placed",
            "pincode": "560045",
            "phone": "+919148052560",
            "city": "Bengaluru",
            "userName": "amruta",
            "storeName": "Kumarvelu Brothers",
            "subTotal": 620,
            "delivery_charge": "0.00",
            "storeCharge": 0,
            "coupon_name": null,
            "coupon_value": "0.00",
            "total": 620,
            "payment_mode": [
                "RAZORPAY"
            ],
            "nonWalletAmount": 620,
            "walletAmount": 0,
            "orderItems": [
                {
                    "name": "Pedigree Adult Dry Dog Food Food, Vegetarian, 3kg Pack",
                    "price": "620.00",
                    "quantity": 1
                }
            ],
           "orderMetaData": [
                {
                    "meta_key": "affiliate_id",
                    "meta_value": "6456"
                },
                {
                    "meta_key": "source_url",
                    "meta_value": "jgkjdah"
                },
                {
                    "meta_key": "cookie_id",
                    "meta_value": "68787"
                }
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="400 If no inputs or fixedRange is not specified in input." %}

```

{
    "code": 400,
    "success": "false",
    "message": "SPECIFY_DATE_RANGE"
}
//For to date is less than from date
{
    "code": 400,
    "success": "false",
    "message": "TO_DATE_IS_LESS_THAN_FROM_DATE"
}
```

{% endtab %}

{% tab title="401 If auth token is not valid" %}

```
{
    "code": 401,
    "success": "false",
    "message": "UNAUTHORIZED"
}
```

{% endtab %}
{% endtabs %}
