> 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/restore-parcel.md).

# Restore Parcel

```php
POST /parcels/restore-parcel
```

This API is used to restore a parcel from 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><tr><td>Content-Type</td><td>application/json</td></tr></tbody></table>

#### Request body

{% code lineNumbers="true" %}

```json
{
    "parcel_id": "asnf-000-9870", 
    "Shiply_API_KEY": "your_api_key"
}
```

{% endcode %}

{% hint style="info" %}
**Note:** Should replace <mark style="color:blue;">{parcel\_id}</mark> with the <mark style="color:blue;">parcel\_code</mark> of the parcel you wish to restore.
{% endhint %}

#### Response body

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

```json
{
    "success": true,
    "parcel": {
        "parcel_code": "asnf-000-3485421",
        "description": "test upload parcel images",
        "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": 1471932,
        "recipient_id": 1464875,
        "qr_code": null,
        "qr_hash": "",
        "region_cost_map_id": 2197,
        "total_price": 150,
        "actual_price": 149,
        "parcel_delivery_cost": 1,
        "price_extra_fee": 0,
        "planned_date": null,
        "note": null,
        "weight": null,
        "length": 50,
        "width": 50,
        "height": 50,
        "size_fee": 0,
        "created_at": "2025-05-31 11:19:59",
        "updated_at": "2025-06-04 11:57:18",
        "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": 1,
        "is_fragile": 0,
        "deleted_at": null,
        "discount_value": 0,
        "size": 125000,
        "total_size": 125000,
        "companion_parcels": [],
        "contents": [
            ..............
        ],
        "recipient": {
            ..............
        },
        "customer": {
            ..............
        }, 
        "promotion_usages": []
    }
}
```

The response includes a <mark style="color:blue;">success</mark> field, which indicates if the parcel restored successfully or not and <mark style="color:blue;">parcel</mark> field that holds the parcel information .
{% endtab %}

{% tab title="Not found" %}
Status code: <mark style="color:red;">404 Not Found</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "message": "parcel not found",
    "errors": [
        "PARCEL_NOT_FOUND"
    ]
}
```

{% endcode %}

This response is returned when the parcel is not found.&#x20;
{% 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="Not deleted" %}
Status code: <mark style="color:red;">409 Conflict</mark>

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "message": "parcel is not deleted",
    "errors": [
        "PARCEL_IS_NOT_DELETED"
    ]
}
```

{% endcode %}

This response is returned when the parcel is not deleted.&#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 %}
