Payment webhooks

ModelMart receives SePay webhooks for VND top-ups and Paddle webhooks for international payments. These are control-plane endpoints, separate from the model endpoint at https://api.modelmart.ai/v1.

SePay

SePay sends events to the webhook configured for the account. Your server must verify the checksum with the SePay secret before processing. Credit a transaction only when the signature is valid, the transaction ID has not been processed, and the amount matches the pending top-up.

Paddle

Paddle sends a signed webhook with a signature header. Verify it with the Paddle webhook secret against the raw request body before parsing JSON. Check the event ID so retries cannot create duplicate credit.

Safe processing

receive request
  -> read raw body and verify signature
  -> check that event ID is new
  -> match amount, currency, and top-up reference
  -> write append-only ledger credit
  -> return HTTP 2xx

Webhook handling must be idempotent. Never trust an amount or status merely because a request arrived from the internet. Do not log raw bodies, signature tokens, or sensitive payment details.

Wallet and invoice routes live under /v2/wallet and /v2/invoices, with tenant authentication. A webhook must never be used to read another tenant's data.