> For the complete documentation index, see [llms.txt](https://shiply-integration-apis.gitbook.io/shiply-integration-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shiply-integration-apis.gitbook.io/shiply-integration-documentation/integration-apis/parcels/get-deleted-parcels.md).

# Get Deleted Parcels

```php
GET /deleted-parcels
```

This API is used to retrieve the deleted parcels that are currently stored in the recycle bin.

#### Headers

<table><thead><tr><th width="374">Key</th><th>Value</th></tr></thead><tbody><tr><td>Accept</td><td>application/json</td></tr></tbody></table>

#### Request body

<table><thead><tr><th width="120.60003662109375">Field name</th><th width="107.4000244140625">Required</th><th width="94.20001220703125">Type</th><th>Notes</th></tr></thead><tbody><tr><td>from</td><td>no</td><td>integer</td><td><strong>Used for pagination:</strong> Specifies the starting number.<br>Default value = 0</td></tr><tr><td>to</td><td>no</td><td>integer</td><td><strong>Used for pagination:</strong> Specifies the ending number.<br>Default value = 20</td></tr></tbody></table>

{% hint style="info" %} <mark style="color:blue;">from</mark> and <mark style="color:blue;">to</mark> in the request body are optional parameters used for partial data retrieval, which is useful for pagination.
{% endhint %}

Request body example:

{% code lineNumbers="true" %}

```json
{
    "from": 0,
    "to": 20,
    "Shiply_API_KEY": "your_api_key"
}
```

{% endcode %}

#### Response body

{% tabs %}
{% tab title="Success" %}
Status code: <mark style="color:green;">200 OK</mark>

{% code lineNumbers="true" %}

```json
{
    "total_count": 177,
    "deleted_parcels": [
        {
            "parcel_code": "asnf-000-9431751",
            "description": "DANTELLE 1 /",
            "customer_user_id": 4,
            "driver_user_id": null,
            "paid_driver_id": null,
            "in_account": 0,
            "parcel_status_id": 1,
            "is_locked": 0,
            "parcel_position_id": 1,
            "parcel_type_id": null,
            "reference_parcel_code": null,
            "returned_reason_id": null,
            "address_id": 1470812,
            "recipient_id": 1463764,
            "qr_code": null,
            "qr_hash": "",
            "region_cost_map_id": null,
            "total_price": 240,
            "actual_price": 165,
            "parcel_delivery_cost": 70,
            "price_extra_fee": 0,
            "planned_date": null,
            "note": null,
            "weight": null,
            "length": 40,
            "width": 40,
            "height": 40,
            "size_fee": 0,
            "created_at": "2025-03-03 17:10:45",
            "updated_at": "2025-06-02 14:16:25",
            "customer_invoice_id": null,
            "final_parcel_status_id": null,
            "extra_delivery_cost": 0,
            "is_replacement": 0,
            "commission": 0,
            "customer_private_note": null,
            "cell": null,
            "reference_number": null,
            "is_completely_received": null,
            "is_fragile": 0,
            "deleted_at": "2025-06-02 14:16:25",
            "discount_value": 0,
            "size": 64000,
            "total_size": 64000,
            "companion_parcels": [],
            "contents": [],
            "customer": {
                .............
            },
            "parcel_status": {
                "id": 1,
                "name": "Draft",
                "ar_aliase": "قيد الإنشاء",
                "en_aliase": "Draft",
                "description": ""
            },
            "parcel_position": {
                "id": 1,
                "name": "Customer",
                "ar_aliase": "مع المرسل",
                "en_aliase": "Customer",
                "office_id": null,
                "description": ""
            },
            "address": {
                "id": 1470812,
                "city_id": 30,
                "village_id": 559,
                "street_name": "كفر مندا",
                "location_updated_at": null,
                "additional_information": null,
                "order": 0,
                "created_at": "2025-03-03 17:10:45",
                "updated_at": "2025-03-03 17:10:45",
                "location_updated_by_user_id": null,
                "hasLocation": false,
                "city": {
                    "id": 30,
                    "name": "شمال ٤٨"
                },
                "village": {
                    "id": 559,
                    "name": "كفر مندا"
                },
                "location_updated_by_user": null
            },
            "recipient": {
                "id": 1463764,
                "first_name": "חטיב",
                "phone": "509542958",
                "phone2": null
            },
            "final_parcel_status": null,
            "parcel_type": null,
            "returned_reason": null,
            "driver_note": null,
            "customer_note": null,
            "promotion_usages": []
        },
        .............
    ]
}
```

{% endcode %}

The response includes a <mark style="color:blue;">total\_count</mark> field, which contains the number deleted parcels and a <mark style="color:blue;">deleted\_parcels</mark> field which holds the detailed parcels information.
{% endtab %}

{% tab title="No permission" %}
Status code: <mark style="color:red;">403 Forbidden</mark>&#x20;

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "message": "unauthorized",
    "errors": [
        "NO_PERMISSION"
    ]
}
```

{% endcode %}

This response is returned when the authenticated user is premium customer employee and has not the permission <mark style="color:blue;">DELETE\_PARCELS</mark>.&#x20;
{% endtab %}

{% tab title="Unauthorized" %}
Status code: <mark style="color:green;">200 OK</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "errors": [
        "unauthorized"
    ]
}
```

{% endcode %}

This response is returned when the <mark style="color:blue;">Shiply\_API\_KEY</mark> is not included in the request body.
{% endtab %}
{% endtabs %}
