{
    "info": {
        "name": "PostPal API",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://app.getpostpal.com"
        },
        {
            "key": "apiToken",
            "value": "replace-with-your-api-token"
        }
    ],
    "item": [
        {
            "name": "Submit postcard recipient",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "X-Request-Id",
                        "value": "order-12345-attempt-1",
                        "type": "text"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json",
                        "type": "text"
                    }
                ],
                "auth": {
                    "type": "bearer",
                    "bearer": [
                        {
                            "key": "token",
                            "value": "{{apiToken}}",
                            "type": "string"
                        }
                    ]
                },
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"flow_id\": \"flow-uuid\",\n    \"from\": {\n        \"company\": \"Muster GmbH\",\n        \"first_name\": \"Markus\",\n        \"last_name\": \"M\\u00fcller\",\n        \"address_line1\": \"Unter den Linden 1\",\n        \"zip\": \"10117\",\n        \"city\": \"Berlin\",\n        \"country\": \"DE\"\n    },\n    \"to\": {\n        \"company\": \"Beispiel AG\",\n        \"first_name\": \"Max\",\n        \"last_name\": \"Mustermann\",\n        \"address_line1\": \"Musterstra\\u00dfe 42\",\n        \"address_line2\": \"c/o Familie Sommer\",\n        \"zip\": \"10115\",\n        \"city\": \"Berlin\",\n        \"country\": \"DE\"\n    },\n    \"content\": {\n        \"personal_message\": \"Hallo **Max**,\\n\\nvielen Dank f\\u00fcr deinen Einkauf.\\n\\n- Pers\\u00f6nlicher Vorteil\\n- N\\u00e4chster Schritt\",\n        \"next_steps\": \"1. Paket pr\\u00fcfen\\n2. QR-Code scannen\\n3. Vorteil sichern\"\n    },\n    \"qr_codes\": {\n        \"voucher_url_1\": \"https://example.com/voucher/1\",\n        \"voucher_url_2\": \"https://example.com/voucher/2\"\n    }\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/api/v1/postcards",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "postcards"
                    ]
                },
                "description": "Submit a recipient address to an existing API Flow for batch direct-mail delivery.\n\nUse a test token (`pp_test_\u2026`) to record entries without triggering real mailings. Use a live token (`pp_live_\u2026`) for production.\n\nSign in to PostPal and create a token if your account grants API-token access."
            }
        },
        {
            "name": "Create campaign",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Idempotency-Key",
                        "value": "campaign-create-001",
                        "type": "text"
                    },
                    {
                        "key": "Content-Type",
                        "value": "application/json",
                        "type": "text"
                    }
                ],
                "auth": {
                    "type": "bearer",
                    "bearer": [
                        {
                            "key": "token",
                            "value": "{{apiToken}}",
                            "type": "string"
                        }
                    ]
                },
                "body": {
                    "mode": "raw",
                    "raw": "{\n    \"name\": \"Spring Reactivation Campaign\",\n    \"description\": \"Direct-mail campaign created via API\",\n    \"metadata\": {\n        \"externalId\": \"erp-123\"\n    },\n    \"processingType\": \"one_off\",\n    \"segment\": {\n        \"source\": \"klaviyo\",\n        \"id\": \"segment-uuid\"\n    },\n    \"design\": {\n        \"postcardDesignId\": \"design-uuid\",\n        \"material\": \"bilderdruck\",\n        \"refinement\": \"folienkaschierung\"\n    },\n    \"delivery\": {\n        \"deliveryPeriodEndAt\": \"2026-05-01\"\n    },\n    \"addressVerification\": true,\n    \"billing\": {\n        \"paymentMethod\": \"rechnung\",\n        \"invoiceEmail\": \"billing@example.com\",\n        \"invoiceCompanyName\": \"Example GmbH\",\n        \"invoiceStreet\": \"Main Street\",\n        \"invoiceStreetNumber\": \"1\",\n        \"invoiceCity\": \"Berlin\",\n        \"invoiceZipCode\": \"10115\",\n        \"invoiceVatNumber\": \"DE123456789\"\n    },\n    \"vouchers\": []\n}",
                    "options": {
                        "raw": {
                            "language": "json"
                        }
                    }
                },
                "url": {
                    "raw": "{{baseUrl}}/api/v1/campaigns",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "api",
                        "v1",
                        "campaigns"
                    ]
                },
                "description": "Create a direct-mail campaign in PostPal.\n\nCampaigns are real objects and require a live token (`pp_live_\u2026`). Test tokens are rejected for this endpoint.\n\nSign in to PostPal and create a token if your account grants API-token access."
            }
        }
    ]
}