The Print & Mailing API prints passport photos and mails them to your customers at US addresses. You send a photo and a mailing address. We print the photos on 4×6 inch photo paper, cut them, and mail them with USPS in a rigid mailer. You get the tracking number through the API or a webhook. Printing is enabled per account: to try it, contact support@idphoto.ai with your print sizes and expected volume. Endpoints and fields are in the Print & Mail API documentation.
What the Print & Mailing API does
- Two ways to send the photo. Use the
photoUuidfrom a photo you made with the Passport Photo API, or upload your own finished JPEG or PNG with its printed size. - All passport and ID photo sizes. Every passport, visa and ID photo spec is supported, from 2×2 inch US passport photos to 35×45 mm, 33×48 mm, 50×70 mm and more.
- 1 to 5 pairs per order. One pair is two photos, which is what most applications ask for.
- USPS shipping. First-Class, Ground Advantage or Priority Mail, to any US address including APO/FPO.
- Tracking. Ground Advantage and Priority orders return a USPS tracking number and link when they ship.
- Optional shipping email. We can email the recipient a plain, unbranded shipping notice with the tracking number.
- Prepaid balance. Orders are paid from your print balance. A canceled or failed order is refunded to it.
- Sandbox orders. Test the whole flow, webhooks included, without anything being charged, printed or mailed.
How it works
- Prepare the photo with the Passport Photo API and check it with Photo Compliance Check, or use your own finished photo.
- Create a print order with the photo, the number of pairs, the shipping method and the recipient's US mailing address. The order is paid from your print balance.
- We check the photo's format and resolution, then print and cut the photos and pack them in a rigid mailer with a packing slip.
- We mail them with USPS. You get the status and tracking number by webhook or by querying the order, and pass them on to your customer.
Create a print order
curl -sS -X POST "https://saas-api.idphotoapp.com/api/print/create-order" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_API_KEY",
"apiSecret": "YOUR_API_SECRET",
"idempotencyKey": "order-10023",
"externalOrderId": "10023",
"photoUuid": "example-photo-uuid",
"photoPairs": 1,
"shippingMethod": "USPS_GROUND_ADVANTAGE",
"recipient": {
"name": "Jane Doe",
"address1": "123 Main St",
"city": "San Jose",
"state": "CA",
"zip": "95112",
"country": "US"
}
}'
The response returns the orderId, the status PENDING, the printed size and the number of sheets. Sending the same idempotencyKey again returns the same order and never charges twice, so a retry after a timeout is safe. To print your own photo instead, send photoImage (Base64) and printSize, for example {"width": 35, "height": 45, "unit": "mm"}.
Shipping options
shippingMethod | Tracking number |
|---|---|
USPS_FIRST_CLASS | No |
USPS_GROUND_ADVANTAGE | Yes |
USPS_PRIORITY | Yes |
Print sizes
We print at 300 DPI with a white border, each photo at its exact printed size. Your photo needs at least 200 DPI at that size.
| Photo size | Photos per 4×6 inch sheet |
|---|---|
| 2×2 in (US passport and visa) | 2 |
| 35×45 mm (Schengen, UK and many others) | 6 |
| 33×48 mm (China visa) | 4 |
| 50×70 mm | 2 |
Order status and webhooks
Every order moves through PENDING → IN_PRODUCTION → SHIPPED → DELIVERED. We send a signed webhook to your HTTPS address at each step after PENDING, so you can update your customer without polling.
- Cancel before printing. A
PENDINGorder can be canceled for a full refund to your balance. Once printing starts, it can no longer be canceled. - Failed orders are refunded. If we find a photo or address problem before mailing, the order becomes
FAILEDwith a reason, and the amount goes back to your balance. - Returned mail. If USPS returns the envelope, the order becomes
RETURNEDso you can confirm the address with your customer. - Low balance alert. We email you and send a webhook when your balance falls below your threshold.
You can also look up one order by our orderId or your own externalOrderId, or list your orders by creation time or status.
Test with sandbox orders
Set "isSandbox": true on an order to test your integration. A sandbox order goes through the same checks as a real one, but it is never charged, printed or mailed. It moves to the next status about once a minute, so you receive the full set of webhooks within a few minutes. You can pick the path: delivered, failed, returned, or First-Class with no tracking number.
Who uses it
- Passport photo apps. Offer mailed prints next to the digital photo, without running a printer or a mailroom.
- Travel and visa agencies. Send the applicant printed photos for the paper application, with a tracking number in the case file.
- Online studios and photo services. Add printing and mailing to your checkout and keep your own brand: the mailer and packing slip carry no IDPhoto.ai branding, and the optional shipping email uses your brand name.
Printing is enabled per account. To try it, contact support@idphoto.ai with your print sizes and expected volume, and we will set up a trial.
Only need a file to print yourself?
If your customers print at home or in your studio, the Passport Photo API can also return a printable sheet of repeated photos: add photoSheet to POST /v2/makeIdPhoto. For a UK passport applied for online, no print is needed at all: use a UK passport photo code instead.
FAQ
Can I mail a passport photo through the API?
Yes. Create a print order with the photo and a US mailing address. We print the photos and mail them with USPS, and you track the order by status and webhook. Printing is enabled per account — to try it, contact support@idphoto.ai.
Can I send my own photo instead of a photoUuid?
Yes. Send a finished JPEG or PNG of up to 5 MB as photoImage, with its printed size in printSize. It must be at least 200 DPI at that size.
Do you check whether the photo meets passport rules?
No. We check the format, size and resolution only. Check the photo with Photo Compliance Check before you order a print.
Where can you mail to?
US addresses only, including APO/FPO.
How does my customer track the package?
With Ground Advantage or Priority Mail, the order gets a USPS tracking number and link when it ships. You receive them by webhook and can pass them on, or we can email the recipient a shipping notice. First-Class mail has no tracking number.
Can I cancel an order?
Yes, while it is still PENDING. The full amount goes back to your balance. Once printing starts, the order cannot be canceled.
How do I test without printing anything?
Create orders with "isSandbox": true. They pass the same checks and send the same webhooks, but are never charged, printed or mailed.