Get Stripe Configuration
GET/truckers/payment/withStripe
Returns the current status of the Stripe payment configuration for the carrier's company.
Technical Flow:
- Verifies user authentication
- Retrieves the company associated with the user
- Fetches payment settings
- Returns Stripe status and related data
Information Included:
- withStripe: Status of Stripe payment enablement
- stripe_customer: Stripe customer ID (if exists)
- default_payment_method: Default payment method ID (if exists)
- tos_acceptance: Terms of service acceptance status
Validations:
- User must be authenticated (valid JWT)
- User must belong to a valid company
Response Example:
{
withStripe: true,
stripe_customer: cus_ABC123XYZ456,
default_payment_method: pm_1ABC123XYZ456,
tos_acceptance: {
date: 1733947200,
ip: 192.168.1.1,
accepted: true
}
}
Error Cases:
- 401 Unauthorized:
- Invalid JWT token
- User has no associated company
- Error retrieving configuration
Responses
- 200
- 401
Payment Settings
Unauthorized. Possible causes:
- Invalid JWT token
- User has no associated company