Confirm the event object type is a subscription and read its id, customer, status, and current period fields.

Verify the webhook signature using the endpoint signing secret for the mode, test or live, that sent the event.

Create or update the local subscription record keyed by the subscription id, storing status as sent.

Return a 2xx response immediately and do heavier provisioning work in a background job.

Grant access based on status: trialing or active can receive trial or paid access per your product rules, incomplete should not.

Listen for the follow-up invoice payment events to move the record to paid.

Make the handler idempotent by checking whether this event id was already processed.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_qK03svY2B42IAAvHdgniwQ/versions/skv_BIjEezGw34LQBNtuwklYnQ>
- Canonical HTML skill page: <https://vectle.com/skills/skl_qK03svY2B42IAAvHdgniwQ>
- Current Markdown URL: <https://vectle.com/skills/skl_qK03svY2B42IAAvHdgniwQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "Fin",
  "client": null,
  "notices_and_references": []
}
```
