# Order Event

Please note, this API allows only 1 request per second, per customer. Making more than 1 request per second, from a particular customer will throw a "429" error code. Any successful API call also contains the below rate-limit headers:\
{\
'X-RateLimit-Limit': 1,\
'X-RateLimit-Remaining': 5,\
'X-RateLimit-Reset': 1\
}

wherein; the "**X-RateLimit-Limit"** header indicates the maximum number of requests that the user can make in the specified time period, the **"X-RateLimit-Remaining"** header indicates the number of requests that the user has made so far, and, the **"X-RateLimit-Reset"** header indicates the time (in Unix timestamp format) when the rate limit will reset.

## Status of an Order

<mark style="color:blue;">`GET`</mark> `/orders/{AWB}/status`

Use this API to get the current status of the shipment by passing the **AWB number** in the request URL.&#x20;

\
The statuses of the orders can be any of the following as per the state in which it currently is:\
\
**1. Pending :** Awaiting Driver Assignment while delivering the package.\
**2. Assigned :** When delivery associate receives package for delivery from any source to destination.\
**3. In-Progress :** Delivery Associate is out for delivery.\
**4. Complete :** Shipment has been successfully delivered.\
**5. Returned :** Shipment has been attempted, but not successfully delivered and is now returned back to Blowhorn Hub (where a re-attempt may be made based on contract definition) \
**6. Attempted :** Shipment was attempted but customer could not be reached and packed was not delivered. \
**7. Out-For-Pickup :** Delivery associate is out to collect the package from the pickup address. \
**8. Picked :** Delivery associate picked the order from the given pickup location. \
**9. At-Hub :** Package is at Blowhorn hub. \
**10. At-Hub-RTO :** Rider has reached the hub location for returning the order which was rejected \
**11. Moving-To-Hub :** Returning to hub location. This can be a hub to hub movement, or returning to the hub movement of the package.\
**12. Moving-To-Origin :** Returning to hub location for handing over rejected package.\
**13. Pickup-Failed :** Delivery associate could not pick the order from the given pickup location \
**14. Returned-To-Origin :** Order has been returned to the source.\
**15. Returned-To-Origin-Failed :** Order could not be returned to the source.\ <br>

#### Path Parameters

| Name                                      | Type   | Description                                             |
| ----------------------------------------- | ------ | ------------------------------------------------------- |
| orderId<mark style="color:red;">\*</mark> | string | AWB Number / Shipment ID received when order is created |

#### Headers

| Name                                       | Type   | Description                              |
| ------------------------------------------ | ------ | ---------------------------------------- |
| API\_KEY<mark style="color:red;">\*</mark> | string | API key obtained by the Customer/Partner |

{% tabs %}
{% tab title="200 To get current status of an order" %}

```json
{
    "status": "PASS",
    "message": {
        "awb_number": "SH-22T70XX",
        "order_status": "Complete",
        "delivered_to": "John Doe",
        "is_return_order": true
    }
}
```

{% endtab %}

{% tab title="401 Unauthorized / Wrong api key" %}

```json
{
  "status": "FAIL",
  "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request/Validation Error" %}

```javascript
{
    "status": "FAIL",
    "message": "Order does not exists."
}
```

{% endtab %}
{% endtabs %}
