Skip to main content

Enable or disable Stripe payments

POST 

/company/payment/withStripe

Enable or disable Stripe payment integration for the authenticated user's company.

Objective

Give the company administrator full control over whether electronic payments are active, with automatic creation of the Stripe customer if activated for the first time.

Use Cases

  • Activate Stripe for the first time to start receiving payments
  • Temporarily disable electronic payments
  • Reactivate payments after a period of inactivity

Validation Flow

flowchart TD
A[Receive Request - enabled] --> B{User authenticated?}
B -->|No| C[404 USER_NOT_FOUND]
B -->|Yes| D{Company found?}
D -->|No| E[401 CIA_NOT_FOUND]
D -->|Yes| F[Set withStripe = enabled]
F --> G{enabled=true AND no stripe_customer?}
G -->|Yes| H[Auto-create Stripe customer]
H --> I{Created OK?}
I -->|No| J[500 Error]
I -->|Yes| K[Save company]
G -->|No| K
K --> L[200 success: true]

Notes

  • Requires JWT authentication (bearerAuth)
  • If enabled=true and no stripe_customer exists, it is automatically created using invoice_data.email
  • If enabled=false, it only disables without deleting the Stripe customer or payment methods

Request

Responses

Stripe configuration updated

Response Headers