# Reschedule Delivery

## Reschedule Delivery

<mark style="color:green;">`POST`</mark> `{baseUrl}/deliveries/:id/reschedule`

Reschedule Delivery by passing deliveryId

#### Path Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String |             |

#### Headers

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| app\_id<mark style="color:red;">\*</mark>     | String |             |
| app\_secret<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                         | Type   | Description |
| -------------------------------------------- | ------ | ----------- |
| pickupDate<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 Rescheduled delivery" %}

```
{
  "status": true,
  "message": "Delivery cancelled",
  "data": {
  }
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid Delivery Id" %}

```
{
    "status": false,
    "message": "Invalid app_id or app_secret",
    "data": {
        "statusCode": 401,
        "message": "Invalid app_id or app_secret",
        "isOperational": true,
    }
}
```

{% endtab %}
{% endtabs %}

### Sample Success Data

```
// Sample Request Information
Url: https://sandbox.sendstack.africa/api/v1/deliveries/yourDeliveryId/reschedule
NB: Replace yourDeliveryId with an actual delivery Id
Method: POST
Headers: 
 - app_id: "your app_id"
 - app_secret: "your app_secret"
```

```json
// Sample Request body
{
    "pickupDate": "2024-09-22"
}
```

```json
// Sample Response Body - 200 OK
{
       "status": true,
       "message": "Rescheduled delivery",
       "data": {
       "pickup": {
          "address": "42230 Gene Unions",
          "pickupName": "Theodore Dietrich IV",
          "pickupNumber": "8032368985",
          "pickupDate": "2024-03-22T00:00:00.000Z",
          "locationCode": "01",
          "country": "NG",
          "lat": 6.602928,
          "long": 3.345006,
          "lga": "Location 1",
          "state": "Lagos",
          //..truncated for brevity
        }
    }
```

### Sample Error Data

```
// Sample Request Information
Url: https://sandbox.sendstack.africa/api/v1/deliveries/invalidDeliveryId/reschedule
Headers: 
 - app_id: "your app_id"
 - app_secret: "your app_secret"
```

```json
//Sample Response Body - 200 OK
{
    "status": false,
    "message": "Invalid deliveryId"
}
```
