Create Custom Envelope
print_mail.custom_envelopes.create(CustomEnvelopeCreateParams**kwargs) -> CustomEnvelope
POST/print-mail/v1/custom_envelopes
Creates a new custom envelope. The artwork is reviewed after it is
uploaded: the custom envelope is returned with a status of pending
and moves to approved or rejected once the review finishes. Create a custom envelope via a multipart/form-data request. Accepts the
same fields as the JSON create body; use this content type to upload the
PDF file directly.
Create Custom Envelope
import os
from postgrid import PostGrid
client = PostGrid(
print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"), # This is the default and can be omitted
)
custom_envelope = client.print_mail.custom_envelopes.create(
envelope_type="standard_single_window",
pdf="https://postgrid-public.s3.amazonaws.com/custom-envelope-artwork.pdf",
description="Spring campaign envelope",
)
print(custom_envelope.id){
"id": "custom_envelope_sqF12lZ1VlBb",
"available": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "custom_envelope",
"status": "pending",
"updatedAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"envelopeType": "standard_double_window",
"lowInventoryThreshold": {
"type": "fixed",
"value": 1
},
"metadata": {
"foo": "bar"
},
"rejectionReason": "content_overlapping_restricted_region",
"url": "https://example.com"
}Returns Examples
{
"id": "custom_envelope_sqF12lZ1VlBb",
"available": 0,
"createdAt": "2019-12-27T18:11:19.117Z",
"live": true,
"object": "custom_envelope",
"status": "pending",
"updatedAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"envelopeType": "standard_double_window",
"lowInventoryThreshold": {
"type": "fixed",
"value": 1
},
"metadata": {
"foo": "bar"
},
"rejectionReason": "content_overlapping_restricted_region",
"url": "https://example.com"
}