# Get the cost of several deliveries

`GET https://api.parasend.com/v1/deliveries/costs`

Source: https://parasend.com/docs/api/deliveries/costs

Authentication: `Authorization: Bearer <API key>` (a `ps_test_` key in test mode, `ps_live_` in live mode).

The same pricing as GET /deliveries/{id}/cost, for a group of deliveries: the items added up, the totals, and one subtotal per delivery. Give exactly one of `delivery_ids`, `batch_id` or `pin`. Needs `deliveries.read`.

Typical use, a debt collector's invoice to a debtor: list the debtor's deliveries with GET /deliveries?pin=…, pick the ones for this claim, then ask for their cost here with `delivery_ids`. Or pass `pin` to cost everything sent to that person.

Only deliveries you may see count: `pin` and `batch_id` leave the others out, and a `delivery_ids` entry you may not see is `delivery_not_found`. The totals cover the whole group; `limit` and `cursor` page the per-delivery subtotals, newest first. Query strings never reach Parasend's logs, so `pin` is safe here.

**A period.** `from` and `to` keep the items that arose in it (when the notice, reminder or eID happened, not when the delivery was created), so a monthly run counts each cost once. Both dates are inclusive, whole days in UTC; either may be left out. A bounce in the period of a delivery charged earlier is a credit line with a negative quantity, so a past period never changes and the periods add up to the whole. Only deliveries with something in the period are listed. `final` is true once nothing more can arise in the period and every item in it is invoiced. Example: `?pin=0101304339&from=2026-10-01&to=2026-10-31`.

## Query parameters

- `delivery_ids` (string, optional): Up to 100 delivery ids (dlv_…), comma-separated. A repeated id counts once.
- `batch_id` (string, optional): Every delivery in the batch (bat_…).
- `pin` (string, optional): Every delivery to the recipient with this personal code (e.g. kennitala), exact match only; spaces and hyphens are ignored — as `pin` on GET /deliveries.
- `from` (string · date, optional): The first day of the period, inclusive, in UTC (Iceland's time). Items that arose before it are left out.
- `to` (string · date, optional): The last day of the period, inclusive, in UTC (Iceland's time). Items that arose after it are left out.
- `limit` (integer, optional): Default: `25`.
- `cursor` (string, optional)

## Example: The cost of chosen deliveries

```bash
curl "https://api.parasend.com/v1/deliveries/costs?delivery_ids=dlv_01M6R27T05512SCV3852TPM2XY" \
  -H "Authorization: Bearer $PARASEND_KEY"
```

```js
const res = await fetch('https://api.parasend.com/v1/deliveries/costs?delivery_ids=dlv_01M6R27T05512SCV3852TPM2XY', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.PARASEND_KEY}`,
  },
});
const data = await res.json();
```

## Response 200

The group's cost so far.

```json
{
  "object": "delivery_cost_summary",
  "livemode": false,
  "currency": "ISK",
  "as_of": "2026-11-06T09:15:05.729Z",
  "from": null,
  "to": null,
  "final": false,
  "delivery_count": 1,
  "items": [
    {
      "kind": "delivery",
      "description": {
        "is": "Sending",
        "en": "Delivery"
      },
      "country": null,
      "quantity": 1,
      "unit_amount": 311,
      "amount": 311,
      "vat": 75,
      "total_amount": 386
    }
  ],
  "amount": 311,
  "vat": 75,
  "total_amount": 386,
  "invoices": [],
  "deliveries": [
    {
      "delivery_id": "dlv_01M6R27T05512SCV3852TPM2XY",
      "status": "notified",
      "final": false,
      "free": false,
      "amount": 311,
      "vat": 75,
      "total_amount": 386
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

Errors: one shape, `{"error": {type, code, message, param, request_id}}`; every code is listed at https://parasend.com/docs/errors.
