Skip to Content
StagePayDocs v2

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-Id header, that value is used; otherwise the server generates one.
  • It is returned in the X-Request-Id response header and in the requestId field of REST error bodies.
  • The requestId of a payment request is stored on the transaction and propagated to PG calls and merchant callbacks (the X-Request-Id header).

Including both the requestId and the tid when you contact us is the fastest way for us to investigate.

Log types

CategoryContents
http_accessAll HTTP requests and responses (method, path, masked query, status, duration, IP, UA)
request_rejectedReasons checkout requests were rejected (4xx)
pg_ioRaw requests sent to and responses from PGs
webhook_inRaw webhooks received from PGs (body + headers)
payment_stateTransaction state transitions (previous → new, reason)
callbackMerchant callback attempt results. Per-attempt details are in webhook_deliveries (request headers and body, first 4 KB of the response, duration)
chain_scan / chain_matchUSDT chain queries and deposit matching
settlementSettlement 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, private

Card 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.

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)

On this page