Create Snap Pack Create Snap Pack
Create a snap pack. You can supply one of the following:
- HTML content for the inside and outside of the snap pack
- Template IDs for the inside and outside of the snap pack
- A URL for a two-page PDF that matches the snap pack layout Create a snap pack via a multipart/form-data request. Accepts the same
fields as the JSON create body (nested objects are bracket-encoded form
fields, e.g.
to[firstName]); use this content type to upload the PDF file directly.
Body ParametersJSONExpand Collapse
body: object { from, insideHTML, outsideHTML, 7 more } or object { from, insideTemplate, outsideTemplate, 7 more } or object { from, pdf, size, 6 more }
SnapPackCreateWithHTML object { from, insideHTML, outsideHTML, 7 more }
from: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe contact information of the sender. You can pass contact information inline here just like you can for the to contact.
The contact information of the sender. You can pass contact information inline here just like you can for the to contact.
ContactCreateWithFirstName object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
The HTML content for the inside of the snap pack. You can supply either this or insideTemplate but not both.
The HTML content for the outside of the snap pack. You can supply either this or outsideTemplate but not both.
to: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe 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.
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 object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
An optional string describing this resource. Will be visible in the API and the dashboard.
mailingClass: optional "first_class" or "standard_class" or "express" or 23 moreThe mailing class of this order. If not provided, automatically set to first_class.
The mailing class of this order. If not provided, automatically set to first_class.
SnapPackCreateWithTemplate object { from, insideTemplate, outsideTemplate, 7 more }
from: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe contact information of the sender. You can pass contact information inline here just like you can for the to contact.
The contact information of the sender. You can pass contact information inline here just like you can for the to contact.
ContactCreateWithFirstName object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
The template ID for the inside of the snap pack. You can supply either this or insideHTML but not both.
The template ID for the outside of the snap pack. You can supply either this or outsideHTML but not both.
to: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe 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.
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 object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
An optional string describing this resource. Will be visible in the API and the dashboard.
mailingClass: optional "first_class" or "standard_class" or "express" or 23 moreThe mailing class of this order. If not provided, automatically set to first_class.
The mailing class of this order. If not provided, automatically set to first_class.
SnapPackCreateWithPdf object { from, pdf, size, 6 more }
from: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe contact information of the sender. You can pass contact information inline here just like you can for the to contact.
The contact information of the sender. You can pass contact information inline here just like you can for the to contact.
ContactCreateWithFirstName object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
pdf: string or stringA URL or a multipart-uploaded two-page PDF (first page is the outside, second page is the inside) that matches the selected snap pack size.
A URL or a multipart-uploaded two-page PDF (first page is the outside, second page is the inside) that matches the selected snap pack size.
to: ContactCreateWithFirstName { addressLine1, countryCode, firstName, 14 more } or ContactCreateWithCompanyName { addressLine1, companyName, countryCode, 14 more } or stringThe 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.
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 object { addressLine1, countryCode, firstName, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
ContactCreateWithCompanyName object { addressLine1, companyName, countryCode, 14 more }
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
An optional string describing this resource. Will be visible in the API and the dashboard.
mailingClass: optional "first_class" or "standard_class" or "express" or 23 moreThe mailing class of this order. If not provided, automatically set to first_class.
The mailing class of this order. If not provided, automatically set to first_class.
ReturnsExpand Collapse
SnapPack object { id, createdAt, from, 22 more }
The contact information of the sender.
The contact information of the sender.
A series of human-readable errors/warnings that were raised when running the provided address through our address verification.
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
mailingClass: "first_class" or "standard_class" or "express" or 23 moreThe mailing class of this order. This determines the speed and cost of delivery. See OrderMailingClass for more details.
The mailing class of this order. This determines the speed and cost of delivery. See OrderMailingClass for more details.
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.
status: "ready" or "printing" or "processed_for_delivery" or 2 moreSee OrderStatus for more details on the status of this order.
See OrderStatus for more details on the status of this order.
The recipient of this order. This will be provided even if you delete the underlying contact.
The recipient of this order. This will be provided even if you delete the underlying contact.
A series of human-readable errors/warnings that were raised when running the provided address through our address verification.
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
cancellation: optional object { reason, cancelledByUser, note } The cancellation details of this order. Populated if the order has been cancelled.
The cancellation details of this order. Populated if the order has been cancelled.
An optional string describing this resource. Will be visible in the API and the dashboard.
The last date that the IMB status was updated. See imbStatus for more details.
imbStatus: optional "entered_mail_stream" or "out_for_delivery" or "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.
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.
The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an imbStatus is present.
The HTML content for the inside of the snap pack, when provided instead of a template or PDF.
The template ID for the inside of the snap pack, when provided instead of HTML or PDF.
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.
The HTML content for the outside of the snap pack, when provided instead of a template or PDF.
The template ID for the outside of the snap pack, when provided instead of HTML or PDF.
The tracking number of this order. Populated after an express/certified order has been processed for delivery.
A signed URL to the uploaded PDF provided at creation time, if a PDF was supplied.
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.
SnapPack object { id, createdAt, from, 22 more }
The contact information of the sender.
The contact information of the sender.
A series of human-readable errors/warnings that were raised when running the provided address through our address verification.
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
mailingClass: "first_class" or "standard_class" or "express" or 23 moreThe mailing class of this order. This determines the speed and cost of delivery. See OrderMailingClass for more details.
The mailing class of this order. This determines the speed and cost of delivery. See OrderMailingClass for more details.
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.
status: "ready" or "printing" or "processed_for_delivery" or 2 moreSee OrderStatus for more details on the status of this order.
See OrderStatus for more details on the status of this order.
The recipient of this order. This will be provided even if you delete the underlying contact.
The recipient of this order. This will be provided even if you delete the underlying contact.
A series of human-readable errors/warnings that were raised when running the provided address through our address verification.
An optional string describing this resource. Will be visible in the API and the dashboard.
If true, PostGrid will force this contact to have an addressStatus of verified even if our address verification system says otherwise.
cancellation: optional object { reason, cancelledByUser, note } The cancellation details of this order. Populated if the order has been cancelled.
The cancellation details of this order. Populated if the order has been cancelled.
An optional string describing this resource. Will be visible in the API and the dashboard.
The last date that the IMB status was updated. See imbStatus for more details.
imbStatus: optional "entered_mail_stream" or "out_for_delivery" or "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.
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.
The most recent ZIP code of the USPS facility that the order has been processed through. Only populated when an imbStatus is present.
The HTML content for the inside of the snap pack, when provided instead of a template or PDF.
The template ID for the inside of the snap pack, when provided instead of HTML or PDF.
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.
The HTML content for the outside of the snap pack, when provided instead of a template or PDF.
The template ID for the outside of the snap pack, when provided instead of HTML or PDF.
The tracking number of this order. Populated after an express/certified order has been processed for delivery.
A signed URL to the uploaded PDF provided at creation time, if a PDF was supplied.
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.
Create Snap Pack Create Snap Pack
curl https://api.postgrid.com/print-mail/v1/snap_packs \
-H 'Content-Type: application/json' \
-H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
-d '{
"from": {
"addressLine1": "addressLine1",
"countryCode": "countryCode",
"firstName": "firstName"
},
"insideHTML": "insideHTML",
"outsideHTML": "outsideHTML",
"size": "8.5x11_bifold_v",
"to": {
"addressLine1": "addressLine1",
"countryCode": "countryCode",
"firstName": "firstName"
}
}'{
"id": "snap_pack_sqF12lZ1VlBb",
"createdAt": "2019-12-27T18:11:19.117Z",
"from": {
"id": "contact_sqF12lZ1VlBb",
"addressLine1": "addressLine1",
"addressStatus": "verified",
"countryCode": "countryCode",
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "contact",
"updatedAt": "2019-12-27T18:11:19.117Z",
"addressErrors": "addressErrors",
"addressLine2": "addressLine2",
"city": "city",
"companyName": "companyName",
"description": "description",
"email": "email",
"firstName": "firstName",
"forceVerifiedStatus": true,
"jobTitle": "jobTitle",
"lastName": "lastName",
"metadata": {
"foo": "bar"
},
"phoneNumber": "phoneNumber",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState",
"secret": true,
"skipVerification": true
},
"live": true,
"mailingClass": "first_class",
"object": "snap_pack",
"sendDate": "2019-12-27T18:11:19.117Z",
"size": "8.5x11_bifold_v",
"status": "ready",
"to": {
"id": "contact_sqF12lZ1VlBb",
"addressLine1": "addressLine1",
"addressStatus": "verified",
"countryCode": "countryCode",
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "contact",
"updatedAt": "2019-12-27T18:11:19.117Z",
"addressErrors": "addressErrors",
"addressLine2": "addressLine2",
"city": "city",
"companyName": "companyName",
"description": "description",
"email": "email",
"firstName": "firstName",
"forceVerifiedStatus": true,
"jobTitle": "jobTitle",
"lastName": "lastName",
"metadata": {
"foo": "bar"
},
"phoneNumber": "phoneNumber",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState",
"secret": true,
"skipVerification": true
},
"updatedAt": "2019-12-27T18:11:19.117Z",
"cancellation": {
"reason": "user_initiated",
"cancelledByUser": "cancelledByUser",
"note": "note"
},
"description": "description",
"imbDate": "2019-12-27T18:11:19.117Z",
"imbStatus": "entered_mail_stream",
"imbZIPCode": "imbZIPCode",
"insideHTML": "insideHTML",
"insideTemplate": "insideTemplate",
"mergeVariables": {
"foo": "bar"
},
"metadata": {
"foo": "bar"
},
"outsideHTML": "outsideHTML",
"outsideTemplate": "outsideTemplate",
"trackingNumber": "trackingNumber",
"uploadedPDF": "https://example.com",
"url": "https://example.com"
}Returns Examples
{
"id": "snap_pack_sqF12lZ1VlBb",
"createdAt": "2019-12-27T18:11:19.117Z",
"from": {
"id": "contact_sqF12lZ1VlBb",
"addressLine1": "addressLine1",
"addressStatus": "verified",
"countryCode": "countryCode",
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "contact",
"updatedAt": "2019-12-27T18:11:19.117Z",
"addressErrors": "addressErrors",
"addressLine2": "addressLine2",
"city": "city",
"companyName": "companyName",
"description": "description",
"email": "email",
"firstName": "firstName",
"forceVerifiedStatus": true,
"jobTitle": "jobTitle",
"lastName": "lastName",
"metadata": {
"foo": "bar"
},
"phoneNumber": "phoneNumber",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState",
"secret": true,
"skipVerification": true
},
"live": true,
"mailingClass": "first_class",
"object": "snap_pack",
"sendDate": "2019-12-27T18:11:19.117Z",
"size": "8.5x11_bifold_v",
"status": "ready",
"to": {
"id": "contact_sqF12lZ1VlBb",
"addressLine1": "addressLine1",
"addressStatus": "verified",
"countryCode": "countryCode",
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "contact",
"updatedAt": "2019-12-27T18:11:19.117Z",
"addressErrors": "addressErrors",
"addressLine2": "addressLine2",
"city": "city",
"companyName": "companyName",
"description": "description",
"email": "email",
"firstName": "firstName",
"forceVerifiedStatus": true,
"jobTitle": "jobTitle",
"lastName": "lastName",
"metadata": {
"foo": "bar"
},
"phoneNumber": "phoneNumber",
"postalOrZip": "postalOrZip",
"provinceOrState": "provinceOrState",
"secret": true,
"skipVerification": true
},
"updatedAt": "2019-12-27T18:11:19.117Z",
"cancellation": {
"reason": "user_initiated",
"cancelledByUser": "cancelledByUser",
"note": "note"
},
"description": "description",
"imbDate": "2019-12-27T18:11:19.117Z",
"imbStatus": "entered_mail_stream",
"imbZIPCode": "imbZIPCode",
"insideHTML": "insideHTML",
"insideTemplate": "insideTemplate",
"mergeVariables": {
"foo": "bar"
},
"metadata": {
"foo": "bar"
},
"outsideHTML": "outsideHTML",
"outsideTemplate": "outsideTemplate",
"trackingNumber": "trackingNumber",
"uploadedPDF": "https://example.com",
"url": "https://example.com"
}