Billing

Create Stripe checkout session

Creates a Stripe Checkout session for the authenticated user's selected paid billing plan. The created subscription is tagged with the local user id and plan so Stripe webhooks can link the customer and activate the plan after payment.

post/billing/me/checkout

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/billing/me/checkout
  • Auth: API key in header x-api-key

Request body

cancel_urlstring
planstring
success_urlstring

Example request

{
  "cancel_url": "https://fe.tonywang.io/app/billing?checkout=cancel",
  "plan": "Growth",
  "success_url": "https://fe.tonywang.io/app/billing?checkout=success"
}

Response

Stripe checkout session

codeinteger
msgstring

Example response

{
  "code": 200,
  "data": {
    "id": "cs_test_123",
    "url": "https://checkout.stripe.com/c/pay/cs_test_123"
  },
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.