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

# Print Parcel V2

```php
GET /parcels/parcel-as-pdf
```

This API provides a PDF file with the details of a specific parcel, so it can be printed and attached to the parcel.

It uses the print parcel page fields that were previously configured by you in the Shiply system, so the returned fields are based on your configuration.

#### Request body

{% code lineNumbers="true" %}

```json
{
    "id": "asnf-000-5389920",
    "companion_id": 333,
    "size": "10",
    "language": "arabic",
    "Shiply_API_KEY": "YOUR_API_KEY"
}
```

{% endcode %}

* `id`: Parcel code to be printed *(Provide either `id` or `companion_id`)*
* `companion_id`: Companion parcel ID to be printed *(Provide either `id` or `companion_id`)*
* `size`: Defines the printed page size (overrides the configured default if provided without changing the configured value)\
  Supported values:
  * `10` → 10 × 10 page size
  * `A4` → A4 page size
  * `QR` → 10 × 10 page including QR code only
* `language`: Defines the language of the printed page (overrides the configured default if provided without changing the configured value)\
  Supported values:
  * `arabic`
  * `english`
  * `hebrew`

{% hint style="info" %}
**Note:** <mark style="color:blue;">id</mark> in the request body corresponds to the <mark style="color:blue;">parcel\_code</mark>
{% endhint %}

#### Response body

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

* `10` size\
  ![](/files/UaIYsveqXaifdWjlTf3v)
* `A4` size\
  ![](/files/ACB6ecDh37UwLAzlmThL)
* `QR` size\
  ![](/files/RGuV0TJBmSYmEnlOnQbJ)
  {% endtab %}

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

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "error": "Parcel not found"
}
```

{% endcode %}

This response is returned when the provided <mark style="color:blue;">id</mark> in the request body does not correspond to any existing parcel.
{% endtab %}

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

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "error": "qr code error"
}
```

{% endcode %}

This response is returned when an error occurs while assigning a QR code to the specified parcel, if it hasn't been assigned one previously.&#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 %}
