# Managed Payment Integration

Use webhooks to get notified automatically when a payment's status changes, instead of polling the API.

## Steps

1. Open **Managed Payment** → **Settings** → **Webhook**, enter your endpoint URL, then click **Save & Test**.
   ![The Webhook settings with the endpoint URL field](https://kencana.basic.box.cloudeka.id/bucketku-f4kxct/sumopod-doc/Guides/08-managed-payment/02-integrate-managed-payment/01-settings-webhook-url.png)
2. Your endpoint will receive an HTTP POST for events like `payment.completed`, `payment.failed`, and `payment.expired`. It must respond with a 2xx status within 10 seconds, or the webhook is marked failed (you can resend it from the **Webhooks** tab).
   ![The Webhooks tab showing webhook delivery logs](https://kencana.basic.box.cloudeka.id/bucketku-f4kxct/sumopod-doc/Guides/08-managed-payment/02-integrate-managed-payment/02-tab-webhook-logs.png)
3. Verify the request really came from Sumopod using either:
   - The `svix-id`, `svix-timestamp`, and `svix-signature` headers, checked against your **Signing Secret** (`whsec_...`), or
   - The simpler `X-Webhook-Token` header, compared directly against your **Webhook Token** (`whtok_...`) — no signature computation needed.

## Notes

- Both secrets can be viewed (Reveal) or rotated from **Settings → Webhook** if you suspect they've leaked.
- A sample `payment.completed` payload includes `payment_id`, `order_id`, `amount`, `fee`, `net_amount`, `status`, `paid_at`, and `settled_at`.
- Direct link: [Managed Payment](https://sumopod.com/dashboard/managed-payment)