Skip to main content
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}`)
}

Which Statuses Can Be Cancelled?

StatusDescriptionCan be cancelled?
draftThe print job has not been confirmed yet.Yes ✅
waiting_to_printThe mail item is waiting to be printed.Yes ✅
printingThe mail item is being printed.No
enclosingThe mail item is being enclosed.No
shippingThe mail item is waiting to be picked up by the postage service.No
sentThe mail item has been sent.No
returnedThe mail item has been returned back to Intelliprint. A return reason and date is attached in the returned field of the mail item.No
cancelledThe mail item has been cancelled by the user.No
invalid_addressThe 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