# Order Profiles # Cheques ## Create Cheque Profile **post** `/print-mail/v1/order_profiles/cheques` Creates a new Cheque Profile. Requires a `bankAccount` ID. Can optionally include an attached letter via `letterHTML`, `letterTemplate`, or `letterPDF`. If providing `letterPDF` or `logo` (if logo needs upload, though schema suggests URL), use `multipart/form-data`. ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `currencyCode: optional CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterPDF: optional string` PDF file for an optional attached letter. Cannot be used with `letterHTML` or `letterTemplate`. Input only. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Returns - `ChequeProfile = object { id, bankAccount, createdAt, 14 more }` - `id: string` Unique identifier for the order profile. - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `createdAt: string` Timestamp when the profile was created. - `currencyCode: CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `letterUploadedPDF: optional string` A temporary, signed URL to view the attached letter PDF, if any. Output only. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/cheques \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "bankAccount": "bankAccount", "size": "us_letter" }' ``` #### Response ```json { "id": "cheque_profile_789", "object": "cheque_profile", "live": true, "description": "Vendor Payment Profile", "size": "us_letter", "bankAccount": "bank_acct_xyz", "currencyCode": "USD", "memo": "Invoice #12345", "mailingClass": "first_class", "createdAt": "2023-03-20T12:00:00Z", "updatedAt": "2023-03-20T12:00:00Z" } ``` ## List Cheque Profiles **get** `/print-mail/v1/order_profiles/cheques` Retrieves a list of Cheque Profiles. ### Query Parameters - `limit: optional number` - `search: optional 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: optional number` ### Returns - `data: array of object { id, bankAccount, createdAt, 13 more }` - `id: string` Unique identifier for the order profile. - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `letterUploadedPDF: optional string` A temporary, signed URL to view the attached letter PDF, if any. Output only. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. - `limit: number` - `object: "list"` - `"list"` - `skip: number` - `totalCount: number` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/cheques \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "data": [ { "id": "cheque_profile_789", "object": "cheque_profile", "live": true, "description": "Vendor Payment Profile", "size": "us_letter", "bankAccount": "bank_acct_xyz", "currencyCode": "USD", "memo": "Invoice #12345", "mailingClass": "first_class", "createdAt": "2023-03-20T12:00:00Z", "updatedAt": "2023-03-20T12:00:00Z" } ], "object": "list", "totalCount": 1, "limit": 1, "skip": 0 } ``` ## Retrieve Cheque Profile **get** `/print-mail/v1/order_profiles/cheques/{id}` Retrieves the details of a specific Cheque Profile. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Returns - `ChequeProfile = object { id, bankAccount, createdAt, 14 more }` - `id: string` Unique identifier for the order profile. - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `createdAt: string` Timestamp when the profile was created. - `currencyCode: CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `letterUploadedPDF: optional string` A temporary, signed URL to view the attached letter PDF, if any. Output only. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/cheques/$ID \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "cheque_profile_789", "object": "cheque_profile", "live": true, "description": "Vendor Payment Profile", "size": "us_letter", "bankAccount": "bank_acct_xyz", "currencyCode": "USD", "memo": "Invoice #12345", "mailingClass": "first_class", "createdAt": "2023-03-20T12:00:00Z", "updatedAt": "2023-03-20T12:00:00Z" } ``` ## Update Cheque Profile **post** `/print-mail/v1/order_profiles/cheques/{id}` Updates specific fields of an existing Cheque Profile. If providing `letterPDF` or `logo`, use `multipart/form-data`. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `currencyCode: optional CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterPDF: optional string` PDF file for an optional attached letter. Cannot be used with `letterHTML` or `letterTemplate`. Input only. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Returns - `ChequeProfile = object { id, bankAccount, createdAt, 14 more }` - `id: string` Unique identifier for the order profile. - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `createdAt: string` Timestamp when the profile was created. - `currencyCode: CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `letterUploadedPDF: optional string` A temporary, signed URL to view the attached letter PDF, if any. Output only. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/cheques/$ID \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "bankAccount": "bankAccount", "size": "us_letter" }' ``` #### Response ```json { "id": "cheque_profile_789", "object": "cheque_profile", "live": true, "description": "Vendor Payment Profile", "size": "us_letter", "bankAccount": "bank_acct_xyz", "currencyCode": "USD", "memo": "Invoice #12345", "mailingClass": "first_class", "createdAt": "2023-03-20T12:00:00Z", "updatedAt": "2023-03-20T12:00:00Z" } ``` ## Delete Cheque Profile **delete** `/print-mail/v1/order_profiles/cheques/{id}` Deletes a Cheque Profile. ### Path Parameters - `id: string` ### Returns - `id: string` Unique identifier for the order profile. - `deleted: true` - `true` - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/cheques/$ID \ -X DELETE \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "cheque_profile_789", "object": "cheque_profile", "deleted": true } ``` ## Domain Types ### Cheque Profile - `ChequeProfile = object { id, bankAccount, createdAt, 14 more }` - `id: string` Unique identifier for the order profile. - `bankAccount: string` ID of the bank account to use for the cheque. Required for creation. - `createdAt: string` Timestamp when the profile was created. - `currencyCode: CurrencyCode` Enum representing the supported currency codes. - `"CAD"` - `"USD"` - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "cheque_profile"` Always `cheque_profile`. - `"cheque_profile"` - `size: ChequeSize` Enum representing the supported cheque sizes. - `"us_letter"` - `"us_legal"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `letterTemplate: optional string` ID of a template for an optional attached letter. Cannot be used with `letterHTML` or `letterPDF`. - `letterUploadedPDF: optional string` A temporary, signed URL to view the attached letter PDF, if any. Output only. - `logo: optional string` A publicly accessible URL for the logo to print on the cheque. Set to `null` to remove during update. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class. Generally must be first class (or equivalent for destination country) for cheques. - `"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: optional string` Memo line text for the cheque. Set to `null` to remove during update. - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `message: optional string` Message included on the cheque stub. Set to `null` to remove during update. - `metadata: optional map[string]` Optional key-value metadata. ### Currency Code - `CurrencyCode = "CAD" or "USD"` Enum representing the supported currency codes. - `"CAD"` - `"USD"` # Letters ## Create Letter Profile **post** `/print-mail/v1/order_profiles/letters` Creates a new Letter Profile. You must provide either a `template` ID or upload a `pdf` file for the content. If providing PDF files (`pdf` or `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`. ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `pdf: optional string` A PDF file containing the letter content. Cannot be used with `template`. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `returnEnvelope: optional string` ID of a return envelope to include. - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. ### Returns - `LetterProfile = object { id, createdAt, live, 15 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `updatedAt: string` Timestamp when the profile was last updated. - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/letters \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "size": "us_letter" }' ``` #### Response ```json { "id": "letter_profile_123", "object": "letter_profile", "live": false, "description": "Monthly Newsletter Profile", "metadata": { "campaign": "Q1 Newsletter" }, "mailingClass": "first_class", "mergeVariables": { "salutation": "Valued Customer" }, "size": "us_letter", "color": true, "doubleSided": true, "envelope": "standard", "addressPlacement": "top_first_page", "template": "template_123", "createdAt": "2023-01-10T10:00:00Z", "updatedAt": "2023-01-10T10:00:00Z" } ``` ## List Letter Profiles **get** `/print-mail/v1/order_profiles/letters` Retrieves a list of Letter Profiles. The profiles are returned sorted by creation date, with the most recent appearing first. ### Query Parameters - `limit: optional number` - `search: optional 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: optional number` ### Returns - `data: array of LetterProfile` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `updatedAt: string` Timestamp when the profile was last updated. - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. - `limit: number` - `object: "list"` - `"list"` - `skip: number` - `totalCount: number` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/letters \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "data": [ { "id": "letter_profile_123", "object": "letter_profile", "live": false, "description": "Monthly Newsletter Profile", "metadata": { "campaign": "Q1 Newsletter" }, "mailingClass": "first_class", "mergeVariables": { "salutation": "Valued Customer" }, "size": "us_letter", "color": true, "doubleSided": true, "envelope": "standard", "addressPlacement": "top_first_page", "template": "template_123", "createdAt": "2023-01-10T10:00:00Z", "updatedAt": "2023-01-10T10:00:00Z" } ], "object": "list", "totalCount": 1, "limit": 1, "skip": 0 } ``` ## Retrieve Letter Profile **get** `/print-mail/v1/order_profiles/letters/{id}` Retrieves the details of a specific Letter Profile by its ID. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Returns - `LetterProfile = object { id, createdAt, live, 15 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `updatedAt: string` Timestamp when the profile was last updated. - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/letters/$ID \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "letter_profile_123", "object": "letter_profile", "live": false, "description": "Monthly Newsletter Profile", "metadata": { "campaign": "Q1 Newsletter" }, "mailingClass": "first_class", "mergeVariables": { "salutation": "Valued Customer" }, "size": "us_letter", "color": true, "doubleSided": true, "envelope": "standard", "addressPlacement": "top_first_page", "template": "template_123", "createdAt": "2023-01-10T10:00:00Z", "updatedAt": "2023-01-10T10:00:00Z" } ``` ## Update Letter Profile **post** `/print-mail/v1/order_profiles/letters/{id}` Updates specific fields of an existing Letter Profile. Only the fields provided in the request body will be updated. If providing PDF files (`pdf` or `attachedPDFFile`), the request `Content-Type` must be `multipart/form-data`. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `pdf: optional string` A PDF file containing the letter content. Cannot be used with `template`. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `returnEnvelope: optional string` ID of a return envelope to include. - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. ### Returns - `LetterProfile = object { id, createdAt, live, 15 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `updatedAt: string` Timestamp when the profile was last updated. - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/letters/$ID \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "letter_profile_123", "object": "letter_profile", "live": false, "description": "Monthly Newsletter Profile", "metadata": { "campaign": "Q1 Newsletter" }, "mailingClass": "first_class", "mergeVariables": { "salutation": "Valued Customer" }, "size": "us_letter", "color": true, "doubleSided": true, "envelope": "standard", "addressPlacement": "top_first_page", "template": "template_123", "createdAt": "2023-01-10T10:00:00Z", "updatedAt": "2023-01-10T10:00:00Z" } ``` ## Delete Letter Profile **delete** `/print-mail/v1/order_profiles/letters/{id}` Deletes a Letter Profile. This action cannot be undone. Orders previously created using this profile are not affected. ### Path Parameters - `id: string` ### Returns - `id: string` Unique identifier for the order profile. - `deleted: true` - `true` - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/letters/$ID \ -X DELETE \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "letter_profile_123", "object": "letter_profile", "deleted": true } ``` ## Domain Types ### Letter Profile - `LetterProfile = object { id, createdAt, live, 15 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "letter_profile"` Always `letter_profile`. - `"letter_profile"` - `size: LetterSize` Enum representing the supported letter sizes. - `"us_letter"` - `"a4"` - `updatedAt: string` Timestamp when the profile was last updated. - `addressPlacement: optional AddressPlacement` Enum representing the placement of the address on the letter. - `"top_first_page"` - `"insert_blank_page"` - `attachedPDF: optional AttachedPdf` Model representing an attached PDF. - `file: string` The file (multipart form upload) or URL pointing to a PDF for the attached PDF. - `placement: "before_template" or "after_template"` Enum representing the placement of the attached PDF. - `"before_template"` - `"after_template"` - `color: optional boolean` Specifies whether to print in color (true) or black and white (false). - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `doubleSided: optional boolean` Specifies whether to print on both sides of the paper. - `envelope: optional string` ID of a custom envelope to use. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing 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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `perforatedPage: optional 1` Specifies which page number should be perforated (if any). - `1` - `template: optional string` ID of a template to use for the letter content. Cannot be used with `pdf`. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. # Postcards ## Create Postcard Profile **post** `/print-mail/v1/order_profiles/postcards` Creates a new Postcard Profile. Provide either `frontTemplate` and `backTemplate` IDs, or upload a 2-page `pdf`. If providing a `pdf`, the request `Content-Type` must be `multipart/form-data`. ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `pdf: optional string` A 2-page PDF file containing the postcard content (front and back). Cannot be used with `frontTemplate`/`backTemplate`. ### Returns - `PostcardProfile = object { id, createdAt, live, 10 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `updatedAt: string` Timestamp when the profile was last updated. - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF content, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/postcards \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "size": "6x4" }' ``` #### Response ```json { "id": "postcard_profile_456", "object": "postcard_profile", "live": false, "description": "Promo Postcard", "size": "6x4", "frontTemplate": "template_abc", "backTemplate": "template_abc", "mailingClass": "standard_class", "createdAt": "2023-02-15T11:00:00Z", "updatedAt": "2023-02-15T11:00:00Z" } ``` ## List Postcard Profiles **get** `/print-mail/v1/order_profiles/postcards` Retrieves a list of Postcard Profiles. ### Query Parameters - `limit: optional number` - `search: optional 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: optional number` ### Returns - `data: array of PostcardProfile` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `updatedAt: string` Timestamp when the profile was last updated. - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF content, if any. - `limit: number` - `object: "list"` - `"list"` - `skip: number` - `totalCount: number` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/postcards \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "data": [ { "id": "postcard_profile_456", "object": "postcard_profile", "live": false, "description": "Promo Postcard", "size": "6x4", "frontTemplate": "template_abc", "backTemplate": "template_abc", "mailingClass": "standard_class", "createdAt": "2023-02-15T11:00:00Z", "updatedAt": "2023-02-15T11:00:00Z" } ], "object": "list", "totalCount": 1, "limit": 1, "skip": 0 } ``` ## Retrieve Postcard Profile **get** `/print-mail/v1/order_profiles/postcards/{id}` Retrieves the details of a specific Postcard Profile. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Returns - `PostcardProfile = object { id, createdAt, live, 10 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `updatedAt: string` Timestamp when the profile was last updated. - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF content, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/postcards/$ID \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "postcard_profile_456", "object": "postcard_profile", "live": false, "description": "Promo Postcard", "size": "6x4", "frontTemplate": "template_abc", "backTemplate": "template_abc", "mailingClass": "standard_class", "createdAt": "2023-02-15T11:00:00Z", "updatedAt": "2023-02-15T11:00:00Z" } ``` ## Update Postcard Profile **post** `/print-mail/v1/order_profiles/postcards/{id}` Updates specific fields of an existing Postcard Profile. If providing a `pdf`, the request `Content-Type` must be `multipart/form-data`. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `pdf: optional string` A 2-page PDF file containing the postcard content (front and back). Cannot be used with `frontTemplate`/`backTemplate`. ### Returns - `PostcardProfile = object { id, createdAt, live, 10 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `updatedAt: string` Timestamp when the profile was last updated. - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF content, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/postcards/$ID \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "postcard_profile_456", "object": "postcard_profile", "live": false, "description": "Promo Postcard", "size": "6x4", "frontTemplate": "template_abc", "backTemplate": "template_abc", "mailingClass": "standard_class", "createdAt": "2023-02-15T11:00:00Z", "updatedAt": "2023-02-15T11:00:00Z" } ``` ## Delete Postcard Profile **delete** `/print-mail/v1/order_profiles/postcards/{id}` Deletes a Postcard Profile. ### Path Parameters - `id: string` ### Returns - `id: string` Unique identifier for the order profile. - `deleted: true` - `true` - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/postcards/$ID \ -X DELETE \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "postcard_profile_456", "object": "postcard_profile", "deleted": true } ``` ## Domain Types ### Postcard Profile - `PostcardProfile = object { id, createdAt, live, 10 more }` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "postcard_profile"` Always `postcard_profile`. - `"postcard_profile"` - `size: PostcardSize` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` - `updatedAt: string` Timestamp when the profile was last updated. - `backTemplate: optional string` ID of the template for the back side. Required unless `pdf` is provided. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `frontTemplate: optional string` ID of the template for the front side. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services like `certified` or `registered` for postcards, though). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF content, if any. ### Postcard Size - `PostcardSize = "6x4" or "9x6" or "11x6"` Enum representing the supported postcard sizes. - `"6x4"` - `"9x6"` - `"11x6"` # Self Mailers ## Create Self-Mailer Profile **post** `/print-mail/v1/order_profiles/self_mailers` Creates a new Self-Mailer Profile. Provide either `insideTemplate` and `outsideTemplate` IDs, or upload a 2-page `pdf`. If providing a `pdf`, the request `Content-Type` must be `multipart/form-data`. ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `pdf: optional string` A 2-page PDF file containing the self-mailer content (inside and outside). Cannot be used with `insideTemplate`/`outsideTemplate`. ### Returns - `SelfMailerProfile = object { id, createdAt, live, 10 more }` Represents a Self-Mailer Profile resource. - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/self_mailers \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "size": "8.5x11_bifold" }' ``` #### Response ```json { "id": "self_mailer_profile_101", "object": "self_mailer_profile", "live": false, "description": "Marketing Self-Mailer", "size": "8.5x11_bifold", "insideTemplate": "template_123", "outsideTemplate": "template_456", "mailingClass": "standard_class", "createdAt": "2023-04-25T13:00:00Z", "updatedAt": "2023-04-25T13:00:00Z" } ``` ## List Self-Mailer Profiles **get** `/print-mail/v1/order_profiles/self_mailers` Retrieves a list of Self-Mailer Profiles. ### Query Parameters - `limit: optional number` - `search: optional 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: optional number` ### Returns - `data: array of SelfMailerProfile` - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. - `limit: number` - `object: "list"` - `"list"` - `skip: number` - `totalCount: number` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/self_mailers \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "data": [ { "id": "self_mailer_profile_101", "object": "self_mailer_profile", "live": false, "description": "Marketing Self-Mailer", "size": "8.5x11_bifold", "insideTemplate": "template_123", "outsideTemplate": "template_456", "mailingClass": "standard_class", "createdAt": "2023-04-25T13:00:00Z", "updatedAt": "2023-04-25T13:00:00Z" } ], "object": "list", "totalCount": 1, "limit": 1, "skip": 0 } ``` ## Retrieve Self-Mailer Profile **get** `/print-mail/v1/order_profiles/self_mailers/{id}` Retrieves the details of a specific Self-Mailer Profile. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Returns - `SelfMailerProfile = object { id, createdAt, live, 10 more }` Represents a Self-Mailer Profile resource. - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/self_mailers/$ID \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "self_mailer_profile_101", "object": "self_mailer_profile", "live": false, "description": "Marketing Self-Mailer", "size": "8.5x11_bifold", "insideTemplate": "template_123", "outsideTemplate": "template_456", "mailingClass": "standard_class", "createdAt": "2023-04-25T13:00:00Z", "updatedAt": "2023-04-25T13:00:00Z" } ``` ## Update Self-Mailer Profile **post** `/print-mail/v1/order_profiles/self_mailers/{id}` Updates specific fields of an existing Self-Mailer Profile. If providing a `pdf`, the request `Content-Type` must be `multipart/form-data`. ### Path Parameters - `id: string` ### Query Parameters - `expand: optional array of string` Optional list of related resources to expand in the response. ### Body Parameters - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `pdf: optional string` A 2-page PDF file containing the self-mailer content (inside and outside). Cannot be used with `insideTemplate`/`outsideTemplate`. ### Returns - `SelfMailerProfile = object { id, createdAt, live, 10 more }` Represents a Self-Mailer Profile resource. - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/self_mailers/$ID \ -H 'Content-Type: application/json' \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \ -d '{ "size": "8.5x11_bifold" }' ``` #### Response ```json { "id": "self_mailer_profile_101", "object": "self_mailer_profile", "live": false, "description": "Marketing Self-Mailer", "size": "8.5x11_bifold", "insideTemplate": "template_123", "outsideTemplate": "template_456", "mailingClass": "standard_class", "createdAt": "2023-04-25T13:00:00Z", "updatedAt": "2023-04-25T13:00:00Z" } ``` ## Delete Self-Mailer Profile **delete** `/print-mail/v1/order_profiles/self_mailers/{id}` Deletes a Self-Mailer Profile. ### Path Parameters - `id: string` ### Returns - `id: string` Unique identifier for the order profile. - `deleted: true` - `true` - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` ### Example ```http curl https://api.postgrid.com/print-mail/v1/order_profiles/self_mailers/$ID \ -X DELETE \ -H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" ``` #### Response ```json { "id": "self_mailer_profile_101", "object": "self_mailer_profile", "deleted": true } ``` ## Domain Types ### Self Mailer Profile - `SelfMailerProfile = object { id, createdAt, live, 10 more }` Represents a Self-Mailer Profile resource. - `id: string` Unique identifier for the order profile. - `createdAt: string` Timestamp when the profile was created. - `live: boolean` Indicates if the profile is associated with the live or test environment. - `object: "self_mailer_profile"` Always `self_mailer_profile`. - `"self_mailer_profile"` - `size: SelfMailerSize` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"` - `updatedAt: string` Timestamp when the profile was last updated. - `description: optional string` An optional description for the profile. Set to `null` to remove during update. - `insideTemplate: optional string` ID of the template for the inside. Required unless `pdf` is provided. - `mailingClass: optional "first_class" or "standard_class" or "express" or 23 more` Mailing class (cannot include extra services for self-mailers). - `"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"` - `mergeVariables: optional map[unknown]` Default merge variables for orders created using this profile. - `metadata: optional map[string]` Optional key-value metadata. - `outsideTemplate: optional string` ID of the template for the outside. Required unless `pdf` is provided. - `uploadedPDF: optional string` A temporary, signed URL to view the uploaded PDF, if any. ### Self Mailer Size - `SelfMailerSize = "8.5x11_bifold" or "8.5x11_trifold" or "9.5x16_trifold"` Enum representing the supported self-mailer sizes. - `"8.5x11_bifold"` - `"8.5x11_trifold"` - `"9.5x16_trifold"`