> 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/invoices/get-all-invoices.md).

# Get All Invoices

<pre class="language-php"><code class="lang-php"><strong>GET /customerInvoices
</strong></code></pre>

This API is used to retrieve a list of customer invoices.

#### 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

Request parameters:

<table><thead><tr><th width="136">Field Name</th><th width="108">Required</th><th width="96">Type</th><th width="311">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. The specified range should not exceed 100.
{% 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
 {
    "success": true,
    "total_count": 57,
    "invoices": [
        {
            "invoice_code": "asnf-625864",
            "invoice_type_id": 1,
            "code": 5640,
            "recipient_name": null,
            "delivered_parcels_count": 1,
            "returned_parcels_count": 0,
            "created_at": "2026-05-25T10:26:52.000000Z",
            "updated_at": "2026-05-25T10:26:52.000000Z",
            "closed_at": "2026-05-25 13:26:52",
            "invoice_amount": -111,
            "invoice_status_id": 4,
            "attachment_url": "https://stage.shiplylogistics.com/api/files/",
            "locked": false,
            "original_value": -111,
            "region_classification": {
                "القدس": {
                    "total": 1,
                    "delivered": "1",
                    "returned": "0",
                    "replaced": "0"
                }
            },
            "transaction_number": null,
            "attachments": [],
            "invoice_type": {
                "id": 1,
                "ar_name": "فاتورة نقدية",
                "en_name": "Cash invoice type",
                "key": "CASH_INVOICE_TYPE"
            },
            "invoice_status": {
                "id": 4,
                "name": "moved_to_wallet"
            },
            "promotion_usages": [],
            "wallet_transaction": null
        },
        ......
    ]
}   
```

{% endcode %}
{% endtab %}

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

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "error": "range is too big"
}
```

{% endcode %}

This response is returned when the <mark style="color:blue;">from</mark> - <mark style="color:blue;">to</mark> range exceeds 100.
{% endtab %}

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

{% code lineNumbers="true" %}

```json
{
    "success": false,
    "error": "no invoices found"
}
```

{% endcode %}

This response is returned when there are no invoices available for the logged-in customer.
{% endtab %}

{% tab title="Unauhtorized" %}
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 %}
