trial-codes
Complete Signup With Code
Complete signup for a user who signed up with a trial code.
TECH-657: Called AFTER Clerk authentication. Handles two cases:
- User has no company yet: Creates company and subscription
- User already has company (from Clerk webhook): Updates existing subscription
The Clerk webhook typically creates the company before this endpoint is called, so case 2 is the common path. We check if the subscription is eligible for trial code application (free_trial, trialing, or incomplete status).
Transaction Flow:
- Validate code
- Get or create company and subscription
- Update subscription with target plan from code if specified
- Record redemption
- Commit only if ALL steps succeed
post/api/v1/billing/trial-codes/complete-signup-with-code
Request
- Base URL: http://localhost:8000
- URL: http://localhost:8000/api/v1/billing/trial-codes/complete-signup-with-code
- Auth: none declared
Headers
Authorizationstring
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.