> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywit.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment webhook

> Sent to your webhook URL when a payment reaches a final state. The same envelope is used for `payment.paid`, `payment.failed` and `payment.expired`; the `type` field and the `Paywit-Event-Type` header tell them apart. Delivery is at-least-once with retries, so deduplicate on `id`. Verify the `Paywit-Signature` header before trusting the body. See the webhooks guide.



## OpenAPI

````yaml /api-reference/openapi.json webhook payment.paid
openapi: 3.1.0
info:
  title: Paywit API
  version: '1.0'
  description: >-
    Create payments, send buyers to the hosted checkout, and receive a signed
    webhook when they pay.
servers:
  - url: https://api.sandbox.paywit.xyz
    description: Sandbox (Stellar testnet, no real money)
security:
  - SecretKey: []
  - PublishableKey: []
paths: {}
components:
  securitySchemes:
    SecretKey:
      type: apiKey
      in: header
      name: X-Paywit-Secret-Key
      description: >-
        Server-to-server key, `sk_test_...` on sandbox and `sk_live_...` on
        production. Generate it in the dashboard under your app. Never ship it
        to a browser or mobile app.
    PublishableKey:
      type: apiKey
      in: header
      name: X-Paywit-Publishable-Key
      description: >-
        Client-side key, `pk_test_...` on sandbox and `pk_live_...` on
        production. Safe to embed in a web page. Can only create payments.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.