# Payment Gateway Integration {#payment-gateway-integration}


Connect payment processors for online invoice payments.


## Overview {#overview}


Gauzy supports integrating payment gateways for:

- Online invoice payments
- Subscription billing
- Payment link generation


## Supported Gateways {#supported-gateways}


| Gateway  | Status    | Features                |
| -------- | --------- | ----------------------- |
| Stripe   | Available | Cards, ACH, invoices    |
| PayPal   | Available | PayPal balance, cards   |
| RazorPay | Available | UPI, cards, net banking |


## Stripe Setup {#stripe-setup}



### 1. Create Stripe Account {#1-create-stripe-account}


1. Go to [stripe.com](https://stripe.com)
2. Get your API keys from Dashboard → Developers


### 2. Configure {#2-configure}


```
STRIPE_API_KEY=sk_live_...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
```


### 3. Webhook Events {#3-webhook-events}


Configure Stripe webhooks to receive payment notifications:

```
https://api.example.com/api/payment/webhook/stripe
```

Events to subscribe:

- `payment_intent.succeeded`
- `payment_intent.payment_failed`
- `invoice.paid`


## PayPal Setup {#paypal-setup}


```
PAYPAL_CLIENT_ID=your-client-id
PAYPAL_CLIENT_SECRET=your-secret
PAYPAL_MODE=sandbox  # or 'live'
```


## Payment Flow {#payment-flow}






```mermaid
sequenceDiagram
    Client->>Gauzy API: Request payment link
    Gauzy API->>Stripe: Create PaymentIntent
    Stripe-->>Gauzy API: Client secret
    Gauzy API-->>Client: Payment page URL
    Client->>Stripe: Enter card details
    Stripe->>Gauzy API: Webhook: payment_succeeded
    Gauzy API->>Database: Update invoice status
```






## Related Pages {#related-pages}


- [Invoice Endpoints](https://sourcey-gauzy.pages.dev/api/invoice-endpoints/index.md) — invoice API
- [Payment Endpoints](https://sourcey-gauzy.pages.dev/api/payment-endpoints/index.md) — payment API
- [Invoicing Feature](https://sourcey-gauzy.pages.dev/features/invoicing/index.md) — invoicing
