Skip to main content
POST
X API Subscription Checkout & Billing Portal
Free - does not consume credits
Returns a checkout URL for new subscribers or a billing portal URL for existing subscribers.

Create an X API Subscription Checkout

Call POST /subscribe after an authenticated user confirms a billing action. The request creates a hosted URL. It never completes payment automatically. Use this route for 3 account states: Always route by status. Do not infer the destination from the URL hostname. Use only the URL returned by the current response. This endpoint does not quote current Twitter API pricing or X API pricing. Review the live Xquik pricing page before checkout. The pricing page remains authoritative for tiers, credits, and current terms.

Choose a Subscription Tier

Send tier only when the user selected a specific Xquik plan. The field pre-selects a tier. It does not activate that tier by itself. Send only the documented enum values.

Complete a Safe Billing Handoff

  1. Show the current plan and credit terms before confirmation.
  2. Call this endpoint once for the confirmed action.
  3. Check the HTTP status before reading url.
  4. Send the user to the returned hosted URL.
  5. Keep the billing URL out of logs and analytics.
  6. Recheck GET /account after the user returns.
Read plan to confirm subscription state. Read creditInfo.balance before tweet search, follower exports, writes, or monitor work. Subscriptions are not the only funding path. A funded pay-as-you-go account can continue eligible work while plan is inactive.

Handle Checkout Retries

The service can reuse a matching open checkout. Treat the latest returned URL as authoritative. A different tier request can replace an older open checkout. Do not repeatedly call this endpoint from a timer or automatic retry loop. For 429, wait for Retry-After. For 401, replace the credential first.

Headers

string
required
Your API key. Session cookie authentication is also supported. Generate a key from the dashboard.

Body

string
Pre-select starter, pro, or business. Omit the body when the user should choose on the hosted checkout.

Response

200 OK

string
Checkout URL (new subscribers) or billing portal URL (existing subscribers). Redirect the user to this URL.
string
Human-readable message describing the action taken.
string
One of: already_subscribed, checkout_created, payment_issue.

401 Unauthenticated

Missing or invalid API key.

429 Rate Limited

Too many requests. Wait for the Retry-After header before retrying.
Related: Get Account to check current subscription status and usage.