Set Custom Envelope Low-Inventory Threshold
print_mail.custom_envelopes.set_threshold(strid, CustomEnvelopeSetThresholdParams**kwargs) -> CustomEnvelope
POST/print-mail/v1/custom_envelopes/{id}/threshold
Sets the low-inventory threshold for the custom envelope by id,
replacing any threshold that was set before. When the available quantity
drops to or below the threshold, we send a low-inventory alert email to
the Admins of your organization.
Set Custom Envelope Low-Inventory Threshold
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.set_threshold(
id="id",
type="fixed",
value=1000,
)
print(custom_envelope.id){
"id": "custom_envelope_iPu6EaCbSUjZN7bEW8Qhee",
"object": "custom_envelope",
"live": false,
"description": "Spring campaign envelope",
"envelopeType": "standard_single_window",
"available": 5000,
"status": "approved",
"url": "https://pg-prod-bucket-1.s3.amazonaws.com/test/custom_envelope_iPu6EaCbSUjZN7bEW8Qhee.pdf?AWSAccessKeyId=AKIA&Expires=1736870000&Signature=abc",
"createdAt": "2021-12-16T03:06:17.419Z",
"updatedAt": "2021-12-16T03:06:17.419Z",
"lowInventoryThreshold": {
"type": "fixed",
"value": 1000
}
}Returns Examples
{
"id": "custom_envelope_iPu6EaCbSUjZN7bEW8Qhee",
"object": "custom_envelope",
"live": false,
"description": "Spring campaign envelope",
"envelopeType": "standard_single_window",
"available": 5000,
"status": "approved",
"url": "https://pg-prod-bucket-1.s3.amazonaws.com/test/custom_envelope_iPu6EaCbSUjZN7bEW8Qhee.pdf?AWSAccessKeyId=AKIA&Expires=1736870000&Signature=abc",
"createdAt": "2021-12-16T03:06:17.419Z",
"updatedAt": "2021-12-16T03:06:17.419Z",
"lowInventoryThreshold": {
"type": "fixed",
"value": 1000
}
}