Skip to main content

Verify acceptance of payment terms

GET 

/truckers/payment/terms

Check if the carrier has accepted the terms and conditions to process payments with Stripe.

Typical Flow:

  1. The frontend calls this endpoint upon login or when accessing the payments section.
  2. If there is no acceptance (success=false), it shows the terms modal.
  3. The user must accept the terms to continue with the payment process.

Validations performed:

  • User must be authenticated (valid JWT).
  • User must belong to a registered company.
  • Checks the payment_settings.tos_acceptance.accepted field in the company.

Possible Responses:

  • 200 OK:
    • success=true: Terms already accepted.
    • success=false: Terms not accepted.
  • 401 Unauthorized:
    • Invalid JWT token.
    • User does not belong to a registered company.

Usage Example:

// Frontend: Check terms when loading the payments section
const checkTerms = async () => {
try {
const response = await axios.get('/truckers/payment/terms', {
headers: { Authorization: `Bearer ${token}` }
});

if (!response.data.success) {
showTermsModal(); // Show terms modal
}
} catch (error) {
handleError(error);
}
};

Responses

Terms acceptance status