Get checkout URLs for subscription plans
GET/company/payment/urls
Generate Stripe Checkout session URLs for each available subscription plan, ready to redirect the user.
Objective
Provide the frontend with direct links to Stripe Checkout so the company can select and pay for a subscription plan.
Use Cases
- Display plan cards with Subscribe buttons
- Redirect the user to Stripe Checkout to complete payment
- Present a comparison of available plans with their prices
Validation Flow
flowchart TD
A[Receive Request] --> B{User authenticated?}
B -->|No| C[404 USER_NOT_FOUND]
B -->|Yes| D{Company found?}
D -->|No| E[401 CIA_NOT_FOUND]
D -->|Yes| F[Fetch plans from DB]
F --> G[Fetch Stripe prices]
G --> H[Create Checkout sessions per plan]
H --> I[200 OK - Plans + URLs]
Notes
- Requires JWT authentication (bearerAuth)
- If the company has a
stripe_customer, associate it with the session - If it does not have a
stripe_customer, use the email frominvoice_data.email - The return URL is fixed:
${HOST_FRONT}/admin/config - Subscription mode:
subscription(not one-time payment) - Include
client_reference_idwith the company reference
Request
Responses
- 200
- 401
- 404
List of plans with Stripe checkout URLs
Response Headers
Company not found
Response Headers
User not found