# Check a batch before sending

`GET https://api.parasend.com/v1/batches/{id}/preflight`

Source: https://parasend.com/docs/api/batches/preflight

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

The checklist before Send out, and the most the batch can cost.

## Path parameters

- `id` (string, required): The batch's ID, starting `bat_`.

## Example: Check a batch before sending

```bash
curl "https://api.parasend.com/v1/batches/bat_01M6R27T8SXWNM911FS53W4S9F/preflight" \
  -H "Authorization: Bearer $PARASEND_KEY"
```

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

## Response 200

The checks and the estimate.

```json
{
  "object": "batch_preflight",
  "ready": true,
  "checks": [
    {
      "id": "recipients",
      "ok": true,
      "total": 2,
      "to_send": 2,
      "row_errors": 0
    },
    {
      "id": "documents",
      "ok": true,
      "without_documents": 0
    },
    {
      "id": "brand",
      "ok": true,
      "brand_profile_id": null,
      "name": null
    },
    {
      "id": "policy",
      "ok": true,
      "follow_up_policy_id": null,
      "name": null,
      "steps": [],
      "own_policy": 0
    },
    {
      "id": "expiry",
      "ok": true,
      "steps_after_expiry": 0
    },
    {
      "id": "test_send",
      "ok": null,
      "available": true,
      "last_sent_at": null
    }
  ],
  "estimate": {
    "currency": "ISK",
    "amount": 622,
    "vat": 149,
    "total_amount": 771,
    "items": [
      {
        "kind": "delivery",
        "description": {
          "is": "Sending",
          "en": "Delivery"
        },
        "country": null,
        "quantity": 2,
        "unit_amount": 311,
        "amount": 622,
        "vat": 149,
        "total_amount": 771
      }
    ],
    "maximum": true,
    "lookups": 0
  }
}
```

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