{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"b369381f-aec7-41e0-ab23-f575f9db8634","name":"Ship a Postcard API","description":"Print and mail physical postcards to US addresses. Postcards created through the API are verified (address, message, image), billed together every night at 23:59 UTC to the workspace owner's saved card with volume pricing, then printed and mailed. Senders can be anywhere; recipients must have a US address. Runnable examples in cURL, Node.js, PHP and Python: [https://github.com/shipapostcard/shipapostcard-api-examples](https://github.com/shipapostcard/shipapostcard-api-examples)\n\nContact Support:  \nEmail: [support@shipapostcard.com](https://mailto:support@shipapostcard.com)\n\n## Get an API key\n\nCreate a free account at https://shipapostcard.com/register, then go to **Developer Hub → API Keys** and create a key. Each key belongs to a workspace: every postcard it creates is billed to that workspace and shows up in its API logs.\n\nAdd a payment method under **Billing**. API postcards are billed together every night at 23:59 UTC, with volume pricing, to the workspace owner's saved card.\n\n```bash\nexport SHIPAPOSTCARD_API_KEY=\"your-api-key\"\n```\n\nSend it as a Bearer token: `Authorization: Bearer $SHIPAPOSTCARD_API_KEY`.\n\n## Get notified with webhooks\n\nAdd an endpoint under **Developer Hub → Webhooks** and pick the events:\n\n| Event | When | `data` |\n|---|---|---|\n| `postcard.created` | The API accepted a postcard. | `id`, `status`, `amount` |\n| `postcard.sent_to_printer` | The nightly batch was paid and sent to the printer (one event per batch). | `batch_id`, `status`, `total_cards_processed`, `total_cards_failed`, `successful_order_ids` |\n| `postcard.delivered` | USPS delivered it. | `id`, `status`, `lob_id`, `delivered_at` |\n| `postcard.failed` | It can't be printed or mailed (e.g. undeliverable address, image that can't be downloaded). | `id`, `status`, `reason` (and `batch_id` when it failed at the printer) |\n| `batch.payment_failed` | The nightly charge was declined; fulfillment is paused until the card is updated. | `batch_id`, `message`, `stripe_error`, `declined_amount`, `affected_cards`, `action_required` |\n\nEach request is a `POST` with a JSON body:\n\n```json\n{\n  \"id\": \"evt_8sKq2...\",\n  \"type\": \"postcard.delivered\",\n  \"created_at\": 1760600000,\n  \"data\": {\n    \"id\": \"sap_order_1234\",\n    \"status\": \"delivered\",\n    \"lob_id\": \"psc_5c002b86ce47537a\",\n    \"delivered_at\": \"2026-10-16T14:03:11+00:00\"\n  }\n}\n```\n\nand two headers:\n\n- `ShipAPostcard-Signature: t=1760600000,v1=5257a869e7…` is an HMAC-SHA256 of `\"{t}.{raw body}\"` with your endpoint's signing secret, in hex.\n- `ShipAPostcard-Event-Id: evt_8sKq2...` stays the same across retries, so you can ignore duplicates.\n\n**Verify the signature on the raw body before parsing it**, compare in constant time, and reject old timestamps (we use 5 minutes) to stop replays. Answer with a `2xx` within 10 seconds; otherwise the event is retried, up to 3 attempts a minute apart. Use a public HTTPS URL: URLs that point at private or internal addresses are refused.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"6050671","team":5092030,"collectionId":"b369381f-aec7-41e0-ab23-f575f9db8634","publishedId":"2sBYHSwzsR","public":true,"publicUrl":"https://documenter-api.postman.tech/view/6050671/2sBYHSwzsR","privateUrl":"https://go.postman.co/documentation/6050671-b369381f-aec7-41e0-ab23-f575f9db8634","customColor":{"top-bar":"13233D","right-sidebar":"303030","highlight":"FF6B4A"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"Integrate physical mail directly into your software. Our REST API features automated USPS address auditing, dynamic volume pricing, native DALL-E 3 AI postcard generation, and real-time webhook tracking for USPS First-Class transit. Designed for enterprise B2B workflows."},{"name":"title","value":"Ship a Postcard REST API | B2B Direct Mail Fulfillment &amp; AI Generation"}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/6a5c6819-641c-4b77-a0ed-d5f06bff9cd6/YW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmc=","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6B4A"}},{"name":"light","logo":"https://content.pstmn.io/6a5c6819-641c-4b77-a0ed-d5f06bff9cd6/YW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmc=","colors":{"top-bar":"13233D","right-sidebar":"303030","highlight":"FF6B4A"}}]}},"version":"8.12.12","publishDate":"2026-10-16T13:59:27.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Ship a Postcard REST API | B2B Direct Mail Fulfillment &amp; AI Generation","description":"Integrate physical mail directly into your software. Our REST API features automated USPS address auditing, dynamic volume pricing, native DALL-E 3 AI postcard generation, and real-time webhook tracking for USPS First-Class transit. Designed for enterprise B2B workflows."},"logos":{"logoLight":"https://content.pstmn.io/6a5c6819-641c-4b77-a0ed-d5f06bff9cd6/YW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmc=","logoDark":"https://content.pstmn.io/6a5c6819-641c-4b77-a0ed-d5f06bff9cd6/YW5kcm9pZC1jaHJvbWUtNTEyeDUxMi5wbmc="}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://postman-image-service.postman.com/api/cloudinary-proxy/postman/image/upload/t_team_logo_pubdoc/v1/team/0d41e0bab2d3a49ad5d5217c404075d0b55990f439096510af43897875265c0a","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sBYHSwzsR"}