# Cheques

## Create Cheque

`client.printMail.cheques.create(ChequeCreateParamsparams, RequestOptionsoptions?): Cheque`

**post** `/print-mail/v1/cheques`

Create a cheque.

This endpoint allows you to create a new cheque with the specified details.

If you would like to create a digitalOnly cheque, the digitalOnly object with the watermark
will need to be passed in. Feature is available on request, e-mail support@postgrid.com for access.
Digital-only cheques are not sent out — they are created with a `cancelled` status and a
cancellation reason of `digital_only`.

Example request body:

```json
{
  "from": "contact_123",
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "digitalOnly": {
    "watermark": "VOID"
  }
}
```

### Parameters

- `params: ChequeCreateParams`

  - `amount: number`

    Body param: The amount of the cheque in cents.

  - `bankAccount: string`

    Body param: The bank account (ID) associated with the cheque.

  - `from: ContactCreateWithFirstName | ContactCreateWithCompanyName | string`

    Body param: The contact information of the sender. You can pass contact information inline here just like you can for the `to`.

    - `ContactCreateWithFirstName`

      - `addressLine1: string`

        The first line of the contact's address.

      - `countryCode: string`

        The ISO 3611-1 country code of the contact's address.

      - `firstName: string`

      - `addressLine2?: string`

        Second line of the contact's address, if applicable.

      - `city?: string`

        The city of the contact's address.

      - `companyName?: string`

        Company name of the contact.

      - `description?: string`

        An optional string describing this resource. Will be visible in the API and the dashboard.

      - `email?: string`

        Email of the contact.

      - `forceVerifiedStatus?: boolean`

        If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

      - `jobTitle?: string`

        Job title of the contact.

      - `lastName?: string`

        Last name of the contact.

      - `metadata?: Record<string, unknown>`

        See the section on Metadata.

      - `phoneNumber?: string`

        Phone number of the contact.

      - `postalOrZip?: string`

        The postal or ZIP code of the contact's address.

      - `provinceOrState?: string`

        Province or state of the contact's address.

      - `secret?: boolean`

        If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

      - `skipVerification?: boolean`

        If `true`, PostGrid will skip running this contact's address through our address verification system.

    - `ContactCreateWithCompanyName`

      - `addressLine1: string`

        The first line of the contact's address.

      - `companyName: string`

      - `countryCode: string`

        The ISO 3611-1 country code of the contact's address.

      - `addressLine2?: string`

        Second line of the contact's address, if applicable.

      - `city?: string`

        The city of the contact's address.

      - `description?: string`

        An optional string describing this resource. Will be visible in the API and the dashboard.

      - `email?: string`

        Email of the contact.

      - `firstName?: string`

        First name of the contact.

      - `forceVerifiedStatus?: boolean`

        If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

      - `jobTitle?: string`

        Job title of the contact.

      - `lastName?: string`

        Last name of the contact.

      - `metadata?: Record<string, unknown>`

        See the section on Metadata.

      - `phoneNumber?: string`

        Phone number of the contact.

      - `postalOrZip?: string`

        The postal or ZIP code of the contact's address.

      - `provinceOrState?: string`

        Province or state of the contact's address.

      - `secret?: boolean`

        If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

      - `skipVerification?: boolean`

        If `true`, PostGrid will skip running this contact's address through our address verification system.

    - `string`

  - `to: ContactCreateWithFirstName | ContactCreateWithCompanyName | string`

    Body param: The recipient of this order. You can either supply the contact information inline here or provide a contact ID. PostGrid will automatically deduplicate contacts regardless of whether you provide the information inline here or call the contact creation endpoint.

    - `ContactCreateWithFirstName`

    - `ContactCreateWithCompanyName`

    - `string`

  - `currencyCode?: "USD" | "CAD"`

    Body param: The currency code of the cheque. This will be set to the default currency of the bank account (`USD` for US bank accounts and `CAD` for Canadian bank accounts) if not provided. You can set this value to `USD` if you want to draw USD from a Canadian bank account or vice versa.

    - `"USD"`

    - `"CAD"`

  - `description?: string`

    Body param: An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    Body param: The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    Body param: The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `letterHTML?: string`

    Body param: The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterPDF?: string | Uploadable`

    Body param: A URL pointing to a PDF for the letter attached to the cheque, or the PDF file itself when uploaded via a multipart form request. You can supply _either_ this, `letterHTML`, or `letterTemplate`, but not more than one.

    - `string`

    - `Uploadable`

  - `letterSettings?: LetterSettings`

    Body param: Settings for a letter attached to a cheque.

    - `placement?: "before_cheque" | "after_cheque"`

      Enum representing where a letter attached to a cheque is placed relative to
      the cheque page.

      - `"before_cheque"`

      - `"after_cheque"`

  - `letterTemplate?: string`

    Body param: A Template ID for the letter attached to the cheque, if any.

  - `logo?: string`

    Body param: An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `mailingClass?: "first_class" | "standard_class" | "express" | 23 more`

    Body param: The mailing class of this order. If not provided, automatically set to `first_class`.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `memo?: string`

    Body param: The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    Body param: These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    Body param: The message of the cheque.

  - `metadata?: Record<string, unknown>`

    Body param: See the section on Metadata.

  - `number?: number`

    Body param: The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `redirectTo?: ContactCreateWithFirstName | ContactCreateWithCompanyName | string`

    Body param: Providing this inserts a blank page at the start of the cheque with the recipient you provide here. This leaves the cheque that follows intact, which means you can use this to intercept at cheque at the redirected address and then mail it forward to the final recipient yourself. One use case for this is signing cheques at your office before mailing them out yourself.

    - `ContactCreateWithFirstName`

    - `ContactCreateWithCompanyName`

    - `string`

  - `returnEnvelope?: string`

    Body param: The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `sendDate?: string`

    Body param: This order will transition from `ready` to `printing` on the day after this date. You can use this parameter to schedule orders for a future date.

  - `size?: ChequeSize`

    Body param: Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `idempotencyKey?: string`

    Header param

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.create({
  amount: 1000,
  bankAccount: 'bank_123',
  from: 'contact_123',
  to: 'contact_123',
  currencyCode: 'USD',
  number: 123456,
  size: 'us_letter',
});

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "ready",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class"
}
```

## List Cheques

`client.printMail.cheques.list(ChequeListParamsquery?, RequestOptionsoptions?): SkipLimit<Cheque>`

**get** `/print-mail/v1/cheques`

Get a list of cheques.

### Parameters

- `query: ChequeListParams`

  - `limit?: number`

  - `search?: string`

    You can supply any string to help narrow down the list of resources. For example, if you pass `"New York"` (quoted), it will return resources that have that string present somewhere in their response. Alternatively, you can supply a structured search query. See the documentation on `StructuredSearchQuery` for more details.

  - `skip?: number`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const cheque of client.printMail.cheques.list()) {
  console.log(cheque.id);
}
```

#### Response

```json
{
  "object": "list",
  "limit": 10,
  "skip": 0,
  "totalCount": 1,
  "data": [
    {
      "id": "cheque_123456",
      "object": "cheque",
      "status": "ready",
      "live": false,
      "to": {
        "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
        "object": "contact",
        "live": false,
        "companyName": "PostGrid",
        "addressLine1": "90 CANAL ST STE 600",
        "city": "BOSTON",
        "provinceOrState": "MA",
        "postalOrZip": "90210-1234",
        "countryCode": "US",
        "skipVerification": false,
        "forceVerifiedStatus": false,
        "addressStatus": "verified",
        "createdAt": "2022-02-16T15:08:41.052Z",
        "updatedAt": "2022-02-16T15:08:41.052Z"
      },
      "from": {
        "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
        "object": "contact",
        "live": false,
        "companyName": "PostGrid",
        "addressLine1": "90 CANAL ST STE 600",
        "city": "BOSTON",
        "provinceOrState": "MA",
        "postalOrZip": "90210-1234",
        "countryCode": "US",
        "skipVerification": false,
        "forceVerifiedStatus": false,
        "addressStatus": "verified",
        "createdAt": "2022-02-16T15:08:41.052Z",
        "updatedAt": "2022-02-16T15:08:41.052Z"
      },
      "bankAccount": "bank_123",
      "amount": 1000,
      "currencyCode": "USD",
      "number": 123456,
      "size": "us_letter",
      "sendDate": "2020-11-12T23:23:47.974Z",
      "createdAt": "2020-11-12T23:23:47.974Z",
      "updatedAt": "2020-11-12T23:23:47.974Z",
      "mailingClass": "first_class"
    }
  ]
}
```

## Get Cheque

`client.printMail.cheques.retrieve(stringid, RequestOptionsoptions?): Cheque`

**get** `/print-mail/v1/cheques/{id}`

Retrieve a cheque by ID.

### Parameters

- `id: string`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.retrieve('id');

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "ready",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class"
}
```

## Cancel Cheque

`client.printMail.cheques.delete(stringid, RequestOptionsoptions?): Cheque`

**delete** `/print-mail/v1/cheques/{id}`

Cancel a cheque by ID. Note that this operation cannot be undone.

### Parameters

- `id: string`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.delete('id');

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "cancelled",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class"
}
```

## Get Cheque Preview

`client.printMail.cheques.retrieveURL(stringid, RequestOptionsoptions?): ChequeRetrieveURLResponse`

**get** `/print-mail/v1/cheques/{id}/url`

Retrieve a cheque preview URL.

This is only available for customers with our document management addon, which offers
document generation and hosting capabilities. This endpoint has a much higher rate limit
than the regular order retrieval endpoint, so it is suitable for customer-facing use-cases.

### Parameters

- `id: string`

### Returns

- `ChequeRetrieveURLResponse`

  - `id: string`

    A unique ID prefixed with cheque_

  - `object: string`

  - `url: string`

    A signed URL linking to the order preview PDF. The link remains valid for 15 minutes from the time of the API call.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const response = await client.printMail.cheques.retrieveURL('id');

console.log(response.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque_url",
  "url": "https://pg-prod-bucket-1.s3.amazonaws.com/test/cheque_uzTtdAPiBVC25hjEYDvyLk?AWSAccessKeyId=AKIA5GFUILSULWTWCR64&Expires=1736192587&Signature=GS6kJK3fgWWy49jq1Yb%2FRn%2BQjD4%3D"
}
```

## Retrieve Cheque Deposit-Ready PDF (Digital Only)

`client.printMail.cheques.retrieveWithDepositReadyPdf(stringid, RequestOptionsoptions?): Cheque`

**get** `/print-mail/v1/cheques/{id}/with_deposit_ready_pdf`

Retrieve the deposit-ready PDF for a digital-only cheque. The endpoint can only be called by users with 'Admin' role.
In test mode, the preview PDF of the digitalOnly cheque and the deposit-ready PDF are the same.
In live mode, the deposit-ready will have the full account number.

### Parameters

- `id: string`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.retrieveWithDepositReadyPdf('id');

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "ready",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class",
  "digitalOnly": {
    "watermark": "TEST"
  },
  "depositReadyPDFURL": "https://example.s3.amazonaws.com/deposit_ready.pdf"
}
```

## Cancel Cheque With Note

`client.printMail.cheques.cancel(stringid, ChequeCancelParamsbody, RequestOptionsoptions?): Cheque`

**post** `/print-mail/v1/cheques/{id}/cancellation`

Cancel a cheque by ID with a note. Note that this operation
cannot be undone and that only cheques with a status of `ready` can be
cancelled.

### Parameters

- `id: string`

- `body: ChequeCancelParams`

  - `note: string`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.cancel('id', { note: 'Cancelling this cheque' });

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "cancelled",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class"
}
```

## Progress Status

`client.printMail.cheques.progress(stringid, RequestOptionsoptions?): Cheque`

**post** `/print-mail/v1/cheques/{id}/progressions`

Progresses a cheque's `status` to the next stage. This is only
available in test mode and can be used to simulate how a live order would
progress through the different statuses.

Note: this will fail with an `invalid_progression_error` if the status
is one of `completed` or `cancelled`.

### Parameters

- `id: string`

### Returns

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Example

```typescript
import PostGrid from 'postgrid-node';

const client = new PostGrid({
  printMailAPIKey: process.env['POSTGRID_PRINT_MAIL_API_KEY'], // This is the default and can be omitted
});

const cheque = await client.printMail.cheques.progress('id');

console.log(cheque.id);
```

#### Response

```json
{
  "id": "cheque_123456",
  "object": "cheque",
  "status": "ready",
  "live": false,
  "to": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "from": {
    "id": "contact_pxd7wnnD1xY6H6etKNvjb4",
    "object": "contact",
    "live": false,
    "companyName": "PostGrid",
    "addressLine1": "90 CANAL ST STE 600",
    "city": "BOSTON",
    "provinceOrState": "MA",
    "postalOrZip": "90210-1234",
    "countryCode": "US",
    "skipVerification": false,
    "forceVerifiedStatus": false,
    "addressStatus": "verified",
    "createdAt": "2022-02-16T15:08:41.052Z",
    "updatedAt": "2022-02-16T15:08:41.052Z"
  },
  "bankAccount": "bank_123",
  "amount": 1000,
  "currencyCode": "USD",
  "number": 123456,
  "size": "us_letter",
  "sendDate": "2020-11-12T23:23:47.974Z",
  "createdAt": "2020-11-12T23:23:47.974Z",
  "updatedAt": "2020-11-12T23:23:47.974Z",
  "mailingClass": "first_class"
}
```

## Domain Types

### Cheque

- `Cheque`

  - `id: string`

    A unique ID prefixed with cheque_

  - `amount: number`

    The amount of the cheque in cents.

  - `bankAccount: string`

    The bank account (ID) associated with the cheque.

  - `createdAt: string`

    The UTC time at which this resource was created.

  - `currencyCode: "USD" | "CAD"`

    The currency code of the cheque. This can be `USD` even if drawing from a Canadian bank account and vice versa. Defaults to the currency of the bank account country if not otherwise specified.

    - `"USD"`

    - `"CAD"`

  - `from: Contact`

    The contact information of the sender.

    - `id: string`

      A unique ID prefixed with contact_

    - `addressLine1: string`

      The first line of the contact's address.

    - `addressStatus: "verified" | "corrected" | "failed"`

      One of `verified`, `corrected`, or `failed`.

      - `"verified"`

      - `"corrected"`

      - `"failed"`

    - `countryCode: string`

      The ISO 3611-1 country code of the contact's address.

    - `createdAt: string`

      The UTC time at which this resource was created.

    - `live: boolean`

      `true` if this is a live mode resource else `false`.

    - `object: "contact"`

      Always `contact`.

      - `"contact"`

    - `updatedAt: string`

      The UTC time at which this resource was last updated.

    - `addressErrors?: string`

      A series of human-readable errors/warnings that were raised when running the provided address through our address verification.

    - `addressLine2?: string`

      Second line of the contact's address, if applicable.

    - `city?: string`

      The city of the contact's address.

    - `companyName?: string`

      Company name of the contact.

    - `description?: string`

      An optional string describing this resource. Will be visible in the API and the dashboard.

    - `email?: string`

      Email of the contact.

    - `firstName?: string`

      First name of the contact.

    - `forceVerifiedStatus?: boolean`

      If `true`, PostGrid will force this contact to have an `addressStatus` of `verified` even if our address verification system says otherwise.

    - `jobTitle?: string`

      Job title of the contact.

    - `lastName?: string`

      Last name of the contact.

    - `metadata?: Record<string, unknown>`

      See the section on Metadata.

    - `phoneNumber?: string`

      Phone number of the contact.

    - `postalOrZip?: string`

      The postal or ZIP code of the contact's address.

    - `provinceOrState?: string`

      Province or state of the contact's address.

    - `secret?: boolean`

      If `true`, the contact's details are hidden from the dashboard and API responses apart from the final print. The contact ID can then be used as a token for sending mail without giving access to the underlying data.

    - `skipVerification?: boolean`

      If `true`, PostGrid will skip running this contact's address through our address verification system.

  - `live: boolean`

    `true` if this is a live mode resource else `false`.

  - `mailingClass: "first_class" | "standard_class" | "express" | 23 more`

    The mailing class of this order. This determines the speed and cost of delivery. See `OrderMailingClass` for more details.

    - `"first_class"`

    - `"standard_class"`

    - `"express"`

    - `"certified"`

    - `"certified_return_receipt"`

    - `"registered"`

    - `"usps_first_class"`

    - `"usps_standard_class"`

    - `"usps_eddm"`

    - `"usps_express_2_day"`

    - `"usps_express_3_day"`

    - `"usps_first_class_certified"`

    - `"usps_first_class_certified_return_receipt"`

    - `"usps_first_class_registered"`

    - `"usps_express_3_day_signature_confirmation"`

    - `"usps_express_3_day_certified"`

    - `"usps_express_3_day_certified_return_receipt"`

    - `"ca_post_lettermail"`

    - `"ca_post_personalized"`

    - `"ca_post_neighbourhood_mail"`

    - `"ups_express_overnight"`

    - `"ups_express_2_day"`

    - `"ups_express_3_day"`

    - `"royal_mail_first_class"`

    - `"royal_mail_second_class"`

    - `"au_post_second_class"`

  - `object: "cheque"`

    Always `cheque`.

    - `"cheque"`

  - `sendDate: string`

    This order will transition from `ready` to `printing` on the day after this date. For example, if this is a date on Tuesday, the order will transition to `printing` on Wednesday at midnight eastern time.

  - `size: ChequeSize`

    Enum representing the supported cheque sizes.

    - `"us_letter"`

    - `"us_legal"`

  - `status: "ready" | "printing" | "processed_for_delivery" | 2 more`

    See `OrderStatus` for more details on the status of this order.

    - `"ready"`

    - `"printing"`

    - `"processed_for_delivery"`

    - `"completed"`

    - `"cancelled"`

  - `to: Contact`

    The recipient of this order. This will be provided even if you delete the underlying contact.

  - `updatedAt: string`

    The UTC time at which this resource was last updated.

  - `cancellation?: Cancellation`

    The cancellation details of this order. Populated if the order has been cancelled.

    - `reason: "user_initiated" | "invalid_content" | "invalid_order_mailing_class"`

      The reason for the cancellation.

      - `"user_initiated"`

      - `"invalid_content"`

      - `"invalid_order_mailing_class"`

    - `cancelledByUser?: string`

      The user ID who cancelled the order.

    - `note?: string`

      An optional note provided by the user who cancelled the order.

  - `depositReadyPDFURL?: string`

    A link to the deposit-ready PDF for a digital-only cheque, returned if requested and available.

  - `description?: string`

    An optional string describing this resource. Will be visible in the API and the dashboard.

  - `digitalOnly?: DigitalOnly`

    The digitalOnly object contains data for digital-only cheques. A watermark must be provided.

    - `watermark: string`

      Text to be displayed as a watermark on the digital cheque.

    - `payee?: Payee`

      The payee of the digital cheque. Supplying `payee.name` lets you create a
      digital-only cheque without a `to` contact — when it is provided, the
      top-level `to` field may be omitted.

      - `name: string`

        The name of the payee.

  - `envelope?: "standard" | (string & {})`

    The envelope of the cheque. If a custom envelope ID is not specified, defaults to `standard`.

    - `"standard"`

      - `"standard"`

    - `(string & {})`

  - `imbDate?: string`

    The last date that the IMB status was updated. See `imbStatus` for more details.

  - `imbStatus?: "entered_mail_stream" | "out_for_delivery" | "returned_to_sender"`

    The Intelligent Mail Barcode (IMB) status of this order. Only populated for US-printed and US-destined orders. This is the most detailed way to track non-express/certified orders.

    - `"entered_mail_stream"`

    - `"out_for_delivery"`

    - `"returned_to_sender"`

  - `imbZIPCode?: string`

    The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an `imbStatus` is present.

  - `letterHTML?: string`

    The raw HTML content for a letter attached to the cheque, if any. You can supply _either_ this, `letterTemplate`, or `letterPDF`, but not more than one.

  - `letterTemplate?: string`

    A Template ID for the letter attached to the cheque, if any.

  - `letterUploadedPDF?: string`

    A signed URL pointing to the original PDF of the letter attached to the cheque, if any.

  - `logo?: string`

    An optional logo URL for the cheque. This will be placed next to the recipient address at the top left corner of the cheque. This needs to be a public link to an image file (e.g. a PNG or JPEG file).

  - `memo?: string`

    The memo of the cheque.

  - `mergeVariables?: Record<string, unknown>`

    These will be merged with the variables in the template or HTML you create this order with. The keys in this object should match the variable names in the template _exactly_ as they are case-sensitive. Note that these _do not_ apply to PDFs uploaded with the order.

  - `message?: string`

    The message of the cheque.

  - `metadata?: Record<string, unknown>`

    See the section on Metadata.

  - `number?: number`

    The number of the cheque. If you don't provide this, it will automatically be set to an incrementing number starting from 1 across your entire account, ensuring that every cheque has a unique number.

  - `returnEnvelope?: string`

    The return envelope (ID) sent out with the cheque, if any. Note that you must first order return envelopes using the Return Envelopes API.

  - `trackingNumber?: string`

    The tracking number of this order. Populated after an express/certified order has been processed for delivery.

  - `url?: string`

    PostGrid renders a PDF preview for all orders. This should be inspected to ensure that the order is correct before it is sent out because it shows what will be printed and mailed to the recipient. Once the PDF preview is generated, this field will be returned by all `GET` endpoints which produce this order.

    This URL is a signed link to the PDF preview. It will expire after a short period of time. If you need to access this URL after it has expired, you can regenerate it by calling the `GET` endpoint again.

### Cheque Size

- `ChequeSize = "us_letter" | "us_legal"`

  Enum representing the supported cheque sizes.

  - `"us_letter"`

  - `"us_legal"`

### Digital Only

- `DigitalOnly`

  - `watermark: string`

    Text to be displayed as a watermark on the digital cheque.

  - `payee?: Payee`

    The payee of the digital cheque. Supplying `payee.name` lets you create a
    digital-only cheque without a `to` contact — when it is provided, the
    top-level `to` field may be omitted.

    - `name: string`

      The name of the payee.

### Cheque Retrieve URL Response

- `ChequeRetrieveURLResponse`

  - `id: string`

    A unique ID prefixed with cheque_

  - `object: string`

  - `url: string`

    A signed URL linking to the order preview PDF. The link remains valid for 15 minutes from the time of the API call.
