Set default payment method
POST/truckers/payment/default_payment_method/:id
Set a payment method as default for future transactions.
Validations:
- The method must belong to the user's Stripe customer
- The method must be active and valid
- The user must have permissions to modify it
Effects:
- Updates the default_payment_method field in the database
- All future transactions will use this method by default
Usage example:
- User selects Use as default on a card
- Frontend calls this endpoint with the method ID
- Backend validates and updates the configuration
Request
Responses
- 200
- 401
Method set as default successfully.
Unauthorized or invalid method. Possible causes:
- Invalid JWT token
- Method does not belong to the user
- Method does not exist or is inactive
- Error updating in database