Start a Builder or Pro subscription

Create an authenticated Stripe Checkout session for the API key's account.

POST /billing/checkout

Choose Builder or Pro. In local mode this endpoint returns a test-session record and no payment URL. In Stripe mode, follow the returned Checkout URL. Plan changes require a verified subscription webhook.

Authentication

Send your key in the X-API-Key header. Keep the key out of URLs and shared logs.

Request body

{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CheckoutRequest"
      }
    }
  },
  "required": true
}

Example request

curl --fail-with-body -X POST \
  "https://polymarket.omray.dev/billing/checkout" \
  -H "X-API-Key: $PM_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"plan":"builder"}'

Responses

StatusMeaning
200Successful Response
422Validation Error

Authenticated requests can return 401 for an invalid key or 429 when a plan limit is reached. Upstream failures may return a server error; do not treat an error as an empty dataset.

OpenAPI operation schema
{
  "tags": [
    "Billing"
  ],
  "summary": "Start a Builder or Pro subscription",
  "description": "Create a Stripe Checkout session when live billing is configured. Local mode returns a test result and charges nothing.",
  "operationId": "billing_checkout",
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CheckoutRequest"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Checkout"
          }
        }
      }
    },
    "422": {
      "description": "Validation Error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/HTTPValidationError"
          }
        }
      }
    }
  },
  "security": [
    {
      "APIKeyHeader": []
    }
  ]
}