> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intelliprint.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancelling Print Jobs

> You can cancel a print job before it is printed.

<CodeGroup>
  ```javascript Node.js SDK theme={null}
  import Intelliprint from 'intelliprint'

  const ip = new Intelliprint('your-api-key-here')

  const printJob = await ip.prints.delete('print-job-id')

  // If this print job was unconfirmed, `deleted` will be `true`.
  console.log(`Print job deleted: ${printJob.deleted}`)

  // If this print job was confirmed, as many `letters` as possible will have their status set to `cancelled`.

  // Check the status of each letter in the print job.
  for (const item of printJob?.letters ?? []) {
    console.log(`Letter ${item.id} is: ${item.status}`)
  }
  ```

  ```bash cURL theme={null}
  curl -X DELETE https://api.intelliprint.net/v1/prints/print-job-id \
    -H 'Authorization: YOUR_API_KEY'
  # Check for the deleted value or the status of each letter in the print job.
  ```
</CodeGroup>

## Which Statuses Can Be Cancelled?

| Status             | Description                                                                                                                                                                          | Can be cancelled? |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `draft`            | The print job has not been confirmed yet.                                                                                                                                            | Yes ✅             |
| `waiting_to_print` | The mail item is waiting to be printed.                                                                                                                                              | Yes ✅             |
| `printing`         | The mail item is being printed.                                                                                                                                                      | No                |
| `enclosing`        | The mail item is being enclosed.                                                                                                                                                     | No                |
| `shipping`         | The mail item is waiting to be picked up by the postage service.                                                                                                                     | No                |
| `sent`             | The mail item has been sent.                                                                                                                                                         | No                |
| `returned`         | The mail item has been returned back to Intelliprint. A return reason and date is attached in the `returned` field of the mail item.                                                 | No                |
| `cancelled`        | The mail item has been cancelled by the user.                                                                                                                                        | No                |
| `invalid_address`  | The mail item was refused to be picked up by the postage service as the address was deemed invalid by them. This status is very rare and only possible for tracked postage services. | No                |
