Create Postcard Profile
print_mail.order_profiles.postcards.create(PostcardCreateParams**kwargs) -> PostcardProfile
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.
Parameters
description: Optional[str]
An optional description for the profile. Set to null to remove during update.
front_template: Optional[str]
ID of the template for the front side. Required unless pdf is provided.
Create Postcard Profile
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
)
postcard_profile = client.print_mail.order_profiles.postcards.create(
size="6x4",
)
print(postcard_profile.id){
"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"
}Returns Examples
{
"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"
}