Skip to main content
PayHubDeveloper docs
简体中文

Get event

API contract v1.0.0

getEvent
GET/v1/events/{event_id}
Required scopes

The required scope depends on the event type. A request without the matching scope returns 403:

payment.*payments:read
dispute.*payments:read
refund.*refunds:read
settlement.*finance:read

Retrieves an event of the current merchant and environment, to backfill a missed webhook or to check the payload. The payload is identical to what was delivered, and the event ID doesn't change. The required scope depends on the business area the event belongs to: payment.* and dispute.* need payments:read, refund.* needs refunds:read, and settlement.* needs finance:read; a key without the matching scope gets 403. Events aren't purged automatically, so you can retrieve any past event. An event that doesn't belong to the current merchant environment returns 404, and so does a test event produced by "Send test event" in the merchant portal, because it isn't a business event.

Request headers

Request headersRequiredFormatDescription
AuthorizationYesBearer <API_KEY>

Server-side key, to be used only on the merchant's server. The merchant and environment are derived from the key. A missing, invalid, revoked or expired key returns 401.

Request example

curl
curl -X GET 'https://api.fluxan.co/v1/events/<EVENT_ID>' \
  -H 'Authorization: Bearer <TEST_SERVER_API_KEY>'

Placeholders to replace

  • <EVENT_ID>: Event ID (starts with evt_); see the X-Pay-Event-Id webhook request header
  • <TEST_SERVER_API_KEY>: Test-environment server API key, created on the "API Key" page of the merchant portal

Note

Server API keys must only be used on your own server, so the docs site doesn't offer interactive API testing. Get a test key: API Key page in the merchant portal (opens the merchant portal in a new tab) (Test environment; Requires Owner, Admin or Developer)

Responses

The event.

payment.succeeded event (same payload as when it was delivered)
{
  "id": "evt_demo_001",
  "type": "payment.succeeded",
  "api_version": "v1",
  "created_at": "2026-09-23T09:05:00Z",
  "environment": "test",
  "merchant_id": "mer_demo_001",
  "data": {
    "object": {
      "id": "pay_demo_001",
      "merchant_order_no": "ORDER-DEMO-001",
      "amount": 10000,
      "currency": "USD",
      "status": "succeeded",
      "latest_attempt_id": "pat_demo_001",
      "version": 4
    }
  },
  "request_id": "req_demo_036"
}

Response fields

Returns an object. See the object section for field descriptions.

NameTypeRequiredDescription
id
stringRequired

Event ID, used for deduplication.

Example: evt_demo_001

type
stringRequired

Event type. For the values, see EventType in webhooks.v1.yaml; clients must tolerate unknown types.

Example: payment.succeeded

api_version
stringRequired

The API version of the payload.

Example: v1

created_at
string(date-time)Required

The time the event was created. Don't use it in place of the signature time.

Example: 2026-09-23T09:05:00Z

environment
stringRequired

Environment: test is the test environment and live is the live environment. Test and live objects are isolated from each other.

  • test
  • live
  • More values may be added in the future. Don't treat a status you don't recognize as success.

Example: test

merchant_id
stringRequired

Merchant ID.

Example: mer_demo_001

data
EventDataRequired
object
objectRequired

A snapshot of the business object (Payment, Refund, Dispute or Settlement) at the time of the event. It contains only the minimum necessary data the merchant is allowed to see, including id and version.

Example: {"id":"pay_demo_001","merchant_order_no":"ORDER-DEMO-001","amount":10000,"currency":"USD","status":"succeeded","latest_attempt_id":"pat_demo_001","version":4}

request_id
stringRequired

Unique identifier of this request, used for troubleshooting and support.

Example: req_demo_001

Possible error codes

HTTPError codeWhen it occursHow to handle
404not_foundAn incorrect ID; using a test key to look up a live object; looking up a platform exception refund (not returned by the open API)Check the ID and the environment of the key you used; the platform doesn't reveal whether another merchant's object exists
403forbiddenCreating a refund with a read-only key; calling getEvent without the read scope for the event's business area; if the request's source IP isn't on the key's allowlist, the more specific ip_not_allowed is returnedUse a key that has the required scope; don't work around the restriction
401unauthenticatedCommonNo Authorization header was sent; the key was copied incompletely; the old key expired after a rotation; the key was revokedCheck your credentials: on the API Key page in the merchant portal, verify the key's status and environment
429rate_limitedCommonA rate limit per merchant and per key; switching keys doesn't get around the merchant's overall limitWait for Retry-After seconds, then retry with the original idempotency key
500internal_errorCommon—Retry with the original idempotency key, or query by merchant order ID / refund ID; never charge again with a new key
502 / 503upstream_unavailableCommonA provider or platform dependency failed, and the platform can't confirm whether this request took effectSame as above

Notes

  • The event payload is identical to what was delivered, and the event ID doesn't change. Use this endpoint to backfill missed webhooks. See Event types.
  • Events aren't purged automatically, so you can retrieve any past event.
  • The required scope depends on the business area the event belongs to (dispute.* events need payments:read). A key without the matching scope gets 403, and an event that doesn't belong to the current merchant environment returns 404.
  • The API has no dispute resource. You can see disputes through dispute.* events, this endpoint and the merchant portal.
Was this page helpful?