Register carrier in Stripe
POST/truckers/payment/register_stripe
Create a Stripe customer account for the carrier and save the customer ID.
Typical Flow:
- Called when the user accepts the payment terms
- Creates a Stripe account if it doesn't exist
- Associates the Stripe account with the carrier's profile
Technical Details:
- Records acceptance timestamp and IP
- Creates Stripe account with user data
- Saves stripe_customer_id in the database
Prerequisites:
- User must have accepted the payment terms
- User must have complete data (email, etc.)
Usage Example:
- User accepts terms in the frontend
- Frontend calls this endpoint
- Backend registers with Stripe and returns the customer ID
Responses
- 200
- 401
Registration in Stripe successful
Unauthorized or registration failure. Possible causes:
- Invalid JWT token
- User not found
- Error creating Stripe account
- Incomplete user data