Logging and Tracing
How to trace a payment from the request through PG communication, state transitions, merchant callbacks, and settlement using requestId, plus the log types StagePay keeps and its masking rules.
requestId
Every request carries a correlation ID, requestId.
- If the request has an
X-Request-Idheader, that value is used; otherwise the server generates one. - It is returned in the
X-Request-Idresponse header and in therequestIdfield of REST error bodies. - The
requestIdof a payment request is stored on the transaction and propagated to PG calls and merchant callbacks (theX-Request-Idheader).
Including both the requestId and the tid when you contact us is the fastest way for us to investigate.
Log types
| Category | Contents |
|---|---|
http_access | All HTTP requests and responses (method, path, masked query, status, duration, IP, UA) |
request_rejected | Reasons checkout requests were rejected (4xx) |
pg_io | Raw requests sent to and responses from PGs |
webhook_in | Raw webhooks received from PGs (body + headers) |
payment_state | Transaction state transitions (previous → new, reason) |
callback | Merchant callback attempt results. Per-attempt details are in webhook_deliveries (request headers and body, first 4 KB of the response, duration) |
chain_scan / chain_match | USDT chain queries and deposit matching |
settlement | Settlement batch creation, verification, approval, payout, and cancellation (before and after values in audit_logs) |
Logs are retained for 400 days by default.
Masking
Values for the following key names are stored in logs as ***.
password, secret, token, apiKey, api_key, key, authorization, integration_key,
signature, card, cvc, cvv, account_number, privateCard number patterns (13–19 digits) are masked in the middle. The originalPayload in callback bodies is not the original PG result but sanitized payment method details with secrets excluded.
Recommended merchant-side logging
If you record the following when receiving callbacks, you can cross-check them against StagePay logs.
X-StagePay-Delivery,X-StagePay-Event,X-Request-Id,X-StagePay-Timestamp- Signature verification result, the status code you responded with, processing time
- Raw body (excluding secrets)
Admin Console
Operating procedures in the admin console for StagePay operators — managing merchants, apps, and PGs, resending callbacks, USDT review, and running settlement policies and batches.
Security Guide
Security rules for merchant integrations — managing secrets, verifying callbacks, verifying amounts, least privilege for API keys, and the WebView and client trust boundary.