{
  "info": {
    "_postman_id": "bef09cdb-99a6-407b-8715-ea36f4c98a79",
    "name": "Pulse Billing API",
    "description": "OpenAPI contract for Apex Pulse billing endpoints under app.parkerapex.com.\nThis spec covers subscription lifecycle (create, status, change, cancel),\nStripe Customer Portal sessions, tier listing, and webhook processing\nfor Free ($0), Pro ($9.99/mo), and Premium ($19.99/mo) tiers.\n",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{access_token}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://prod.parkerapex.com/api/pulse/billing",
      "type": "string"
    },
    {
      "key": "access_token",
      "value": "REPLACE_WITH_TOKEN",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Tiers",
      "item": [
        {
          "name": "List available Pulse tiers with pricing",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/tiers",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "tiers"
              ]
            },
            "description": "Return all available Pulse subscription tiers with pricing and feature lists. This endpoint is public and requires no authentication."
          }
        }
      ]
    },
    {
      "name": "Subscriptions",
      "item": [
        {
          "name": "Create a new Pulse subscription",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/subscribe",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "subscribe"
              ]
            },
            "description": "Create a Stripe subscription for the authenticated user at the specified tier.\nFor the free tier, no Stripe subscription is created \u2014 the user is simply\nmarked as subscribed at the free level.\n",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          }
        },
        {
          "name": "Get current subscription status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/status",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "status"
              ]
            },
            "description": "Return the authenticated user's current Pulse subscription tier, status, features, and billing details."
          }
        },
        {
          "name": "Upgrade or downgrade subscription tier",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/change-tier",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "change-tier"
              ]
            },
            "description": "Change the authenticated user's Pulse subscription to a different tier.\nStripe handles proration automatically.\n",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          }
        },
        {
          "name": "Cancel Pulse subscription",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/cancel",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "cancel"
              ]
            },
            "description": "Cancel the authenticated user's Pulse subscription. By default cancels\nat the end of the current billing period. Set `immediate: true` to\ncancel immediately.\n",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          }
        }
      ]
    },
    {
      "name": "Portal",
      "item": [
        {
          "name": "Create a Stripe Customer Portal session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/portal-session",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "portal-session"
              ]
            },
            "description": "Create a Stripe Customer Portal session so the user can manage payment\nmethods, view invoices, and change or cancel subscriptions via Stripe's\nhosted portal UI.\n",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "Handle Stripe webhook events",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/pulse/billing/webhook",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "pulse",
                "billing",
                "webhook"
              ]
            },
            "description": "Receives and processes Stripe webhook events for Pulse subscriptions.\nThis endpoint is CSRF-exempt and validates events using the Stripe\nwebhook signature. No session authentication is required.\n\nHandled event types:\n- `invoice.paid` \u2014 payment succeeded\n- `invoice.payment_failed` \u2014 payment failed\n- `customer.subscription.deleted` \u2014 subscription canceled\n- `customer.subscription.updated` \u2014 subscription modified (logged)\n- `customer.subscription.created` \u2014 new subscription (logged)\n",
            "body": {
              "mode": "raw",
              "raw": "{}"
            }
          }
        }
      ]
    }
  ]
}