Endpoints
Billing Checkout
Create a checkout session for plan upgrades and subscription management
POST
Create a secure checkout session for upgrading to Pro or Scale plans. This endpoint generates a Stripe-hosted checkout URL for seamless subscription management.
This endpoint is free to use and doesn’t affect your credit balance.
Solution: Use “pro” or “scale” as the plan value
Solution: Ensure URLs are valid HTTPS URLs
Solution: Check the promo code or proceed without it
Solution: User can manage their subscription in the dashboard instead
Authentication
Request Body
string
required
Target subscription plan: “pro” or “scale”
string
Billing frequency: “monthly” or “annual” (default: “monthly”)
string
required
URL to redirect users after successful payment
string
required
URL to redirect users if they cancel checkout
string
Promotional code for discounts (optional)
object
Additional metadata to attach to the subscription (optional)
Response
string
Status of the request (“success” or “error”)
object
Credit Cost
Credit Cost: FREE - Creating checkout sessions doesn’t consume credits
Available Plans
Pro Plan
- 1,000 credits/month
- 60 requests/minute
- 490/year
- Priority email support
Scale Plan
- 5,000 credits/month
- 120 requests/minute
- 1,990/year
- Priority support + phone support
Billing Cycles
Monthly Billing
Monthly Billing
- Charged every month on the same date you subscribed
- More flexibility to upgrade/downgrade
- No long-term commitment
- Standard pricing as listed
Annual Billing
Annual Billing
- Charged once per year
- 2 months free compared to monthly billing
- Better value for consistent usage
- Requires annual commitment
Checkout Flow
1
Create Session
Call this endpoint to generate a secure checkout URL
2
Redirect User
Send users to the returned
checkout_url3
User Completes Payment
User enters payment details on Stripe’s secure checkout page
4
Success/Cancel Handling
User is redirected to your
success_url or cancel_url5
Webhook Processing
AgenticPencil processes the payment and upgrades the account automatically
Success and Cancel URLs
Your redirect URLs should handle the checkout outcome appropriately:Promotional Codes
Percentage Discounts
Apply percentage-based discounts (e.g., “LAUNCH50” for 50% off)
Fixed Amount Discounts
Apply fixed dollar amount discounts (e.g., “SAVE10” for $10 off)
First Month Free
Some codes provide the first billing period at no charge
Extended Trials
Special codes may extend free trial periods
Common Errors
INVALID_PLAN - Unsupported plan type
INVALID_PLAN - Unsupported plan type
INVALID_URL - Malformed redirect URLs
INVALID_URL - Malformed redirect URLs
PROMO_CODE_INVALID - Invalid promotional code
PROMO_CODE_INVALID - Invalid promotional code
ALREADY_SUBSCRIBED - User already has active subscription
ALREADY_SUBSCRIBED - User already has active subscription