# Security and PCI scope

## Card data never reaches your servers

The hosted checkout page and the portal collect the card on Regoria's domain; the number and security code go straight to the processor's vault. Your servers receive only a **summary**: brand, last 4 digits, expiry month and year, and a `pm_` id you can charge later. That keeps your PCI DSS scope at the lowest level (SAQ A for a hosted-page integration): you never store, process or transmit card data.

Do not build your own card form against this API; there is no operation that takes a card number, on purpose.

## What you may store

- Order, payment, refund, subscription and customer ids and their JSON as returned.
- Card summaries (brand, last 4, expiry). Never a full number, never a security code.
- Buyer emails and addresses, under your own privacy obligations.

## Secrets

| Secret | Format | Where it belongs |
|---|---|---|
| API key | `mor_live_…`, `mor_test_…` | your server's secret store; sent as the bearer token |
| Webhook endpoint secret | `whsec_…` | your server's secret store; verifies `X-Webhook-Signature` |

Neither belongs in a browser, a mobile app, a repository or a log line. Log the key's `prefix` (`mor_live_1a2b`) and the delivery id, never the secret. Rotate a key by creating a new one and revoking the old ([Authentication](http://docs.staging.regoria.com/guides/authentication)); rotate a webhook secret with `POST /v1/webhook-endpoints/{endpoint}/rotate-secret`.

## If a secret leaks

1. Revoke the key (`DELETE /v1/api-keys/{key}`, or the dashboard) or rotate the webhook secret, at once.
2. Review the key's recent use in the dashboard (**Developers → API keys**, last used) and your webhook delivery log.
3. Write to [support@staging.regoria.com](mailto:support@staging.regoria.com) with the key prefix and the time window; we check for activity you did not expect.

## Transport

- TLS 1.2 or later on every call; plain HTTP is refused.
- Webhook endpoints must be `https` on a public host; redirects are not followed.
- Verify webhook signatures and reject old timestamps ([Webhooks](http://docs.staging.regoria.com/guides/webhooks)).

## Isolation

Every record belongs to one merchant account. A call with your key cannot read or change another merchant's record: it answers `404 not_found`, the same as a missing one.
