PaymentRetryAlert.com
Sign up Request beta access

API reference

The PaymentRetryAlert REST API manages enrolments, alerts, events, and webhook endpoints for the organisation associated with your API key. Webhooks send signed event snapshots to your HTTPS receiver.

Updated 26 min read
On this page

The REST base URL is https://api.paymentretryalert.com/v1. Append the operation paths below to this base URL. Use the paths as written, without a trailing slash. Interactive documentation is available at /v1/docs, and the OpenAPI schema is available at /v1/openapi.json. Both show the newest supported version.

See how the product works for the payment flow and the API integration guide for a complete integration.

Authentication and versions

Send these headers on every authenticated request:

HeaderValue
AuthorizationBearer YOUR_API_KEY
PaymentRetryAlert-Version2026-10-05, the currently supported version. Required; there is no implicit default.
Content-Typeapplication/json when sending a JSON body.
Idempotency-KeyRequired on webhook endpoint creation and both simulation operations; optional on other POST operations. See idempotency.

API keys beginning with pra_test_ belong to test organisations; pra_live_ keys belong to live organisations. The key selects the organisation, so resource paths do not contain an organisation ID. Keep keys in server-side secret storage and send them only in the authorization header. Keys in query parameters are rejected. A dashboard session does not authenticate REST requests.

A resource outside your key’s organisation returns the same 404 NOT_FOUND response as an unknown ID. Treat all IDs as opaque strings. Timestamps use ISO 8601 with a time zone; newly returned timestamps use UTC with milliseconds, such as 2026-10-20T10:00:00.000Z. Unknown request body fields and query parameters produce validation errors. Accept additional fields in responses so additive changes do not break your client.

The response echoes an accepted version in PaymentRetryAlert-Version. An event’s own api_version describes its snapshot format, including when the event predates the REST request’s version. See payload versions for webhook delivery versions.

Scopes

ScopeAccess
enrolments:readList and retrieve enrolments.
enrolments:writeCreate enrolments and request unenrolment; includes enrolment read access.
alerts:readList and retrieve alerts.
alerts:writeReport retry outcomes; includes alert read access.
events:readList and retrieve every event type for the organisation.
webhook_endpoints:readRead endpoints, deliveries, and delivery attempts.
webhook_endpoints:writeCreate, update, and delete endpoints, and retry deliveries; includes webhook read access.
simulations:writeSimulate enrolment status changes and alerts in test organisations.

GET /me accepts any valid API key, including a key without scopes. Simulation access does not grant enrolment or alert read/write scopes.

Pagination and filters

List responses have the form:

{
  "items": [],
  "count": 0
}

count appears only when include_count=true; it is the number of matching objects before limit and offset are applied. An empty items array is a valid response.

Query parameterTypeDefault and behavior
limitinteger100; allowed range 1 through 100.
offsetinteger0; must be at least 0.
sortstring-created_at for newest first; use created_at for oldest first. Alerts also support transaction_time and -transaction_time.
include_countbooleanfalse; use true to include count.

Sorting uses creation time and ID to resolve ties consistently. Increase offset by the number of returned items to read the next page. New objects can move offset pages; use the event polling cursor below when continuously consuming events.

Filters on different fields are combined with AND. Repeat a multi-value parameter to match any of its values, for example status=PENDING&status=ENABLED. Timestamp filters require a full date and time with a time zone, such as 2026-10-20T10:00:00Z. Both _gte and _lte bounds are inclusive at the timestamp precision shown in responses.

Key context

GET /me

Returns 200 with your key’s organisation and permissions. No scope is required. The secret is never returned.

{
  "object": "api_key_context",
  "organisation": {
    "id": "org_example",
    "name": "Example merchant",
    "mode": "TEST"
  },
  "api_key": {
    "id": "key_example",
    "name": "Payments integration",
    "scopes": ["alerts:write", "events:read"],
    "source": "DASHBOARD",
    "expires_at": null
  }
}

organisation.mode is TEST or LIVE. api_key.source is DASHBOARD or CLI. expires_at is an ISO 8601 timestamp for CLI keys and null for dashboard keys. CLI keys expire after 90 days without use.

Enrolments

All successful operations return the enrolment object, except listing, which returns a page of those objects.

OperationRequired scopeSuccess
GET /enrolmentsenrolments:read200 list.
POST /enrolmentsenrolments:write201 newly created enrolment.
GET /enrolments/{id}enrolments:read200 enrolment.
DELETE /enrolments/{id}enrolments:write200 updated enrolment.

GET /enrolments

Supports common pagination, plus:

FilterTypeBehavior
statusrepeated stringAny listed enrolment status. See the enrolment object.
mastercard_pop_midstringExact MID match after trimming surrounding whitespace.

POST /enrolments

The only body field is required:

{
  "mastercard_pop_mid": "123456789012345"
}

Send the MID as a string to preserve leading zeros. Surrounding whitespace is removed; the remaining value must contain 1 through 255 characters. The enrolment starts in PENDING, and an enrolment.created event is recorded. Test enrolments are not submitted to Mastercard.

409 MID_ALREADY_ENROLLED means the MID is already in your organisation’s enrolment list. If a response was lost, retry with the original idempotency key or list enrolments with mastercard_pop_mid to find the result.

GET /enrolments/{id}

Retrieve the current enrolment by ID. Returns 404 NOT_FOUND if it cannot be found for your organisation.

DELETE /enrolments/{id}

Request unenrolment without a request body. A PENDING enrolment becomes CANCELLED immediately. Other test enrolments are normally unenrolled immediately. A live enrolment records unenrolment_requested_at and keeps its current status until unenrolment completes. Monitor enrolment.updated or retrieve the enrolment to observe completion.

Repeating a request while unenrolment is pending returns the enrolment without another change. Once an enrolment is UNENROLLED, FAILED, or CANCELLED, this operation returns 409 UNENROLMENT_CLOSED. This operation retains the enrolment record.

Alerts

OperationRequired scopeSuccess
GET /alertsalerts:read200 page of alert objects.
GET /alerts/{id}alerts:read200 current alert.
PATCH /alerts/{id}alerts:write200 updated alert.

GET /alerts

Supports common pagination, including transaction-time sorting, plus:

FilterTypeBehavior
enrolment_idstringExact enrolment ID.
enrolment_midstringExact MID; includes alerts across enrolments when the MID has been enrolled again.
network_transaction_idstringExact network transaction identifier.
card_binstringExact BIN.
card_last_fourstringExact last four digits.
retry_outcomerepeated stringSUCCEEDED, FAILED, NOT_ATTEMPTED, or NONE. NONE matches a null outcome.
transaction_time_gte, transaction_time_ltetimestampInclusive original transaction-time range.
created_at_gte, created_at_ltetimestampInclusive alert creation-time range.

GET /alerts/{id}

Retrieve the alert’s current state. Returns 404 NOT_FOUND if it cannot be found for your organisation.

PATCH /alerts/{id}

Report the result of your payment retry:

{
  "retry_outcome": "SUCCEEDED"
}

retry_outcome is required and must be SUCCEEDED, FAILED, or NOT_ATTEMPTED. It cannot be cleared to null. Reporting the same value again changes nothing. A changed value records alert.updated; an outcome can be corrected later, including after the reporting timeout. This request records an outcome; your payment integration performs the payment retry separately.

Events

OperationRequired scopeSuccess
GET /eventsevents:read200 page of event envelopes.
GET /events/{id}events:read200 event envelope.

GET /events

Returns events across all four event types. The event body is the same snapshot used by webhooks. Supports common pagination, plus:

FilterTypeBehavior
typerepeated stringAny listed event type.
created_at_gte, created_at_ltetimestampInclusive event creation-time range.
starting_afterstringEvent ID for cursor-based polling; returns events after that event, oldest first.

With starting_after, only events at least 30 seconds old are returned. Do not send offset or sort, even their default values, with the cursor; doing so returns 422 PARAMETER_CONFLICT. A cursor outside the organisation or an unknown ID returns 422 STARTING_AFTER_NOT_FOUND. The cursor can identify an event outside the selected filters. With cursor pagination, count counts matching events after the cursor that are currently old enough to return.

To start polling new events, request limit=1&created_at_lte=YOUR_UTC_TIME_30_SECONDS_AGO without a cursor. Keep the newest returned event ID as your initial cursor. If the list is empty, wait and try again. Then request starting_after=LAST_EVENT_ID, process the page in order, and advance to the final returned event’s ID only after saving that page. Keep the cursor when a page is empty. Start from an event at least 30 seconds old to avoid skipping events that become visible later. For historical recovery, read older pages as well before starting ongoing polling.

GET /events/{id}

Retrieve the original event snapshot. Its data.object describes the object when the event occurred; retrieve the enrolment or alert separately for its current state. Returns 404 NOT_FOUND when the event cannot be found for your organisation.

Webhook endpoint management

OperationRequired scopeSuccess
GET /webhook-endpointswebhook_endpoints:read200 page of endpoint objects.
POST /webhook-endpointswebhook_endpoints:write201 endpoint with its signing secret.
GET /webhook-endpoints/{id}webhook_endpoints:read200 endpoint without its secret.
PATCH /webhook-endpoints/{id}webhook_endpoints:write200 updated endpoint without its secret.
DELETE /webhook-endpoints/{id}webhook_endpoints:write204 with no response body.

Endpoint object

FieldTypeDescription
idstringEndpoint ID, prefixed with whep_.
objectstringAlways webhook_endpoint.
urlstringRegistered receiver URL.
descriptionstringDescription; an empty string when none is provided.
event_typesarray of stringsSubscribed event types, deduplicated and sorted.
is_activebooleanWhether the endpoint can receive deliveries.
api_versionstringPayload version selected for new deliveries.
disabled_reasonstring or nullMANUAL or FAILING when disabled; otherwise null.
disabled_attimestamp or nullWhen the endpoint was disabled.
created_attimestampWhen the endpoint was created.
secretstringwhsec_ signing secret. Returned only by creation and idempotent replays of that creation.

GET /webhook-endpoints

Supports common pagination. Returns active and disabled endpoints, without signing secrets. Deleted endpoints are excluded.

POST /webhook-endpoints

Requires Idempotency-Key. Send:

{
  "url": "https://payments.example.com/webhooks/paymentretryalert",
  "description": "Payment retry notifications",
  "event_types": ["alert.created", "alert.updated"]
}
Body fieldRequiredValidation and default
urlYesAt most 2,048 characters; surrounding whitespace is trimmed. Must meet the endpoint requirements.
event_typesYesAt least one supported event type.
descriptionNoAt most 255 characters; defaults to "".

The new endpoint is active. Its payload version is the request’s PaymentRetryAlert-Version. Save the returned secret before processing deliveries. Ordinary read responses never return it. Repeating the same creation with the same idempotency key returns the same secret and creates no second endpoint.

An organisation can have 20 endpoints. Exceeding that limit returns 409 ENDPOINT_LIMIT_REACHED. A disallowed receiver URL returns 422 ENDPOINT_URL_NOT_ALLOWED with path: "url".

GET /webhook-endpoints/{id}

Retrieve a current endpoint without its signing secret. Unknown or deleted endpoints return 404 NOT_FOUND.

PATCH /webhook-endpoints/{id}

Send any fields you want to change:

Body fieldTypeBehavior
descriptionstringUp to 255 characters; send "" to clear it.
event_typesarray of stringsAt least one supported event type; replaces the subscription list.
is_activebooleanDisable or enable delivery.
api_versionstringA supported payload version, currently 2026-10-05. Affects new deliveries only.

Omitted fields and fields set to null keep their current values. The URL cannot be changed; create a replacement endpoint for a new URL. Disabling cancels planned attempts; requests already in flight can arrive. Enabling starts a new failure-monitoring grace period but does not restart cancelled retries. Update your receiver before changing api_version.

DELETE /webhook-endpoints/{id}

Delete the endpoint and cancel planned attempts. The endpoint and its delivery records subsequently return 404 NOT_FOUND through this API. An in-flight request can still arrive.

Webhook deliveries

OperationRequired scopeSuccess
GET /webhook-endpoints/{id}/deliverieswebhook_endpoints:read200 page of delivery objects without attempts.
GET /webhook-deliveries/{id}webhook_endpoints:read200 delivery with attempts.
POST /webhook-deliveries/{id}/retrywebhook_endpoints:write200 delivery with attempts.

Delivery object

FieldTypeDescription
idstringDelivery ID, prefixed with whdl_; also the webhook request’s webhook-id.
objectstringAlways webhook_delivery.
endpoint_idstringDestination endpoint ID.
event_idstringEvent ID; retrieve it with GET /events/{id}.
event_typestringThe event’s type.
statusstringPENDING, RETRYING, SUCCEEDED, FAILED, or CANCELLED.
next_attempt_attimestamp or nullNext scheduled attempt, or null when none is planned.
api_versionstringPayload version that this delivery sends.
created_attimestampWhen the delivery was created.
attemptsarray of objectsPresent on delivery retrieval and retry responses; ordered by attempt number.

Attempt object

FieldTypeDescription
idstringAttempt ID, prefixed with what_.
objectstringAlways webhook_delivery_attempt.
numberintegerAttempt number within the delivery.
triggerstringAUTOMATIC or MANUAL.
statusstringPENDING, SENDING, SUCCEEDED, FAILED, or CANCELLED.
scheduled_fortimestampScheduled send time.
started_at, finished_attimestamp or nullStart and completion times, when available.
response_statusinteger or nullReceiver’s HTTP status, when a response was obtained.
response_bodystringCaptured receiver response, limited to its first 4,096 bytes and decoded as text. Can be empty.
errorstringExplanation when no response was obtained; otherwise empty.
duration_msinteger or nullRequest duration in milliseconds, when available.

A delivery remains SUCCEEDED after any successful attempt, even if a later manual resend fails. Inspect attempts when checking a resend.

GET /webhook-endpoints/{id}/deliveries

Supports common pagination, plus a repeated status parameter with any delivery status. Returns deliveries for one endpoint, without attempt details. Unknown or deleted endpoints return 404 NOT_FOUND.

GET /webhook-deliveries/{id}

Retrieve a delivery and its attempt history. Unknown deliveries and deliveries belonging to deleted endpoints return 404 NOT_FOUND.

POST /webhook-deliveries/{id}/retry

Send no body or {}. This schedules delivery as soon as possible; the response is not confirmation that the receiver accepted it. Retrieve the delivery again to observe the attempt’s result.

If an automatic attempt is planned, it moves forward and the automatic retry sequence continues if it fails. Otherwise, one manual attempt is added without starting another automatic sequence. The webhook-id and event body stay the same. Use an idempotency key when retrying this REST request after a lost response so you don’t schedule another resend.

Returns 409 DELIVERY_NOT_RETRYABLE when the endpoint is disabled or an attempt is already being sent. Enable a disabled endpoint before retrying. Deleted endpoints’ deliveries return 404 NOT_FOUND.

Test simulations

Both simulation operations require a test organisation’s API key, simulations:write, and Idempotency-Key. Live keys receive 403 TEST_MODE_ONLY. Simulations change test resources and produce the same event types and signed webhook deliveries as the corresponding activity. They do not retry payments with your payment provider.

POST /simulations/enrolments/{id}/status

Returns 200 with the updated enrolment object.

{
  "status": "ENABLED"
}
Body fieldRequiredBehavior
statusYesAny listed enrolment status.
notesFor ACTION_REQUIREDString with a nonblank explanation of the required action. Optional for other statuses; omission or null keeps the current notes. Whitespace is trimmed; "" clears notes for other statuses.

Changing the status records enrolment.updated. Repeating the same status and notes changes nothing, and changing notes alone does not emit an update event. Missing or blank notes with ACTION_REQUIRED return 422 NOTES_REQUIRED. A conflicting MID returns 409 MID_CONFLICT; invalid enrolment values return 422 VALIDATION_VALUE_ERROR.

POST /simulations/enrolments/{id}/alerts

Returns 201 with a newly created alert object and records alert.created. The enrolment must be IN_PROGRESS or ENABLED; otherwise the response is 409 ENROLMENT_NOT_SIMULATABLE.

Send {} to use defaults, or provide test transaction details:

{
  "transaction_amount_in_cents": 2150,
  "transaction_currency": "USD",
  "card_bin": "512345",
  "card_last_four": "1234",
  "network_transaction_id": "EXAMPLE123"
}
Body fieldTypeValidation and default
transaction_timetimestampTime with a time zone in the last 30 days, not in the future. Defaults to a random time 1 through 72 hours ago.
transaction_amount_in_centsintegerPositive ISO 4217 minor-unit amount, up to the equivalent of 1,000,000 major units. Defaults to a random integer from 500 through 50,000 minor units. Booleans and fractional numbers are invalid.
transaction_currencystringUSD, EUR, PLN, or JPY; defaults to USD.
card_binstring6 through 9 digits; defaults to 512345.
card_last_fourstringExactly 4 digits; defaults to a random value.
network_transaction_idstring1 through 64 printable ASCII characters without spaces; defaults to a random UUID.

All fields are optional; omission or null selects the default. Amounts follow the currency’s exponent: the maximum is 100000000 minor units for USD, EUR, and PLN, or 1000000 for JPY. Invalid values return 422 with a field path. Unknown enrolments return 404 NOT_FOUND for either simulation.

Idempotency

All POST operations accept Idempotency-Key. It is required for creating a webhook endpoint and for both simulations. Use a fresh value for each new operation, such as a UUID, and reuse it only to retry that same operation. Values must contain 1 through 255 printable ASCII characters.

A retry with the same API key, idempotency key, method, path, query, version, and JSON body returns the stored status and body and makes no additional change. JSON object key order and whitespace do not affect the comparison. The replay response includes Idempotent-Replayed: true. Retain the same URL, query, version, and values when retrying.

Records are retained for 24 hours and then become eligible for removal. Use unique keys indefinitely; do not rely on a key becoming reusable at an exact time. A stored business error is replayed as well as a successful result. Authentication, version, permission, rate-limit, and input-schema errors do not reserve the key; server errors can be retried. Replays still require a currently valid key with the required permission.

A missing required key returns 400 IDEMPOTENCY_KEY_MISSING; an invalid value returns 400 IDEMPOTENCY_KEY_INVALID; reusing a key for a different request returns 409 IDEMPOTENCY_KEY_REUSED. Keys are scoped to the API key, so switching API keys does not deduplicate a request. PATCH and DELETE operations do not use this header.

Rate limits

Limits are shared by all API keys of an organisation:

OperationsLimit
All requests1,000 per minute.
Enrolment creationAdditional limit of 100 per hour.
Webhook delivery retriesAdditional limit of 100 per hour.
Both simulation operations combinedAdditional shared limit of 100 per hour.

Responses include RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset when available. RateLimit-Reset is the number of seconds until that limit resets. When multiple limits apply, the headers describe the one with the fewest requests remaining. An exceeded limit returns 429 RATE_LIMITED and Retry-After in seconds. Wait at least that long before retrying. Idempotent replays do not consume rate-limit capacity.

Errors

Error responses use this shape:

{
  "errors": [
    {
      "code": "VALIDATION_MISSING",
      "message": "retry_outcome: Field required",
      "path": "retry_outcome"
    }
  ]
}

errors can contain multiple validation failures. code is machine-readable; message explains the problem. path identifies a request field, including an index for an array item, and is omitted for general errors. A validation error for the whole body has path: null. Branch on the code and status rather than exact message wording. Keep the response’s X-Request-ID when contacting support.

HTTP statusCodesMeaning
400API_KEY_IN_QUERYMove the key to the authorization header.
400VERSION_MISSING, VERSION_UNKNOWNSend a supported PaymentRetryAlert-Version.
400IDEMPOTENCY_KEY_MISSING, IDEMPOTENCY_KEY_INVALIDCorrect the idempotency header.
401API_KEY_MISSING, API_KEY_INVALID, API_KEY_REVOKED, API_KEY_EXPIREDSupply a valid key.
403INSUFFICIENT_SCOPE, TEST_MODE_ONLYUse a key with the required scope and organisation mode.
404NOT_FOUNDResource or endpoint not found for this key and version.
405METHOD_NOT_ALLOWEDUse a supported HTTP method.
409IDEMPOTENCY_KEY_REUSEDUse the original request or a fresh key for a new operation.
409MID_ALREADY_ENROLLED, UNENROLMENT_CLOSED, MID_CONFLICTEnrolment conflict; see the relevant operation.
409ENDPOINT_LIMIT_REACHED, DELIVERY_NOT_RETRYABLE, ENROLMENT_NOT_SIMULATABLEResource state prevents the requested action.
422VALIDATION_*Invalid JSON, missing or invalid fields, unknown fields or parameters, or conflicting field names. Examples include VALIDATION_UNKNOWN_FIELD, VALIDATION_UNKNOWN_PARAMETER, VALIDATION_JSON_INVALID, and VALIDATION_FIELD_COLLISION.
422ENDPOINT_URL_NOT_ALLOWED, NOTES_REQUIREDCorrect the named field.
422PARAMETER_CONFLICT, STARTING_AFTER_NOT_FOUNDCorrect the event polling parameters.
429RATE_LIMITEDWait for Retry-After.
500INTERNAL_ERRORRetry with backoff; keep the same idempotency key for a POST.

Webhook delivery protocol

Configure endpoints and subscriptions through the REST operations above or under Webhooks in the dashboard. Owners and developers can manage webhooks in the dashboard.

Delivery request

PaymentRetryAlert sends an HTTP POST to the URL you register. The path belongs to your application; /webhooks/paymentretryalert is an example.

HeaderValue
content-typeapplication/json
webhook-idDelivery ID, prefixed with whdl_. Remains the same across attempts for that delivery.
webhook-timestampUnix timestamp in seconds for the signed attempt.
webhook-signatureStandard Webhooks signature, in the form v1,<base64 signature>.

Header names are case-insensitive. Verify the signature using the exact request body bytes before parsing or processing the event.

Endpoint requirements

  • Use a public HTTPS URL with a hostname and a valid TLS certificate. IP address URLs, local or private addresses, and URLs containing a username or password are not accepted.
  • Accept POST requests directly. Redirects are not followed.
  • Return any 2xx status once you have received the event. Any other status counts as a failure, and we retry.
  • Respond within 15 seconds. A slower response counts as a failed attempt.

You can have up to 20 webhook endpoints per organisation. Choose at least one event type for each endpoint. You can edit the description and subscriptions or enable and disable the endpoint. To change its URL, create a replacement endpoint.

Event types

TypeWhen it is sentdata.object
enrolment.createdAn enrolment is created.Enrolment
enrolment.updatedAn enrolment’s status changes or its unenrolment request is recorded or cleared.Enrolment
alert.createdA retry alert is created.Alert
alert.updatedAn alert’s retry outcome changes.Alert

An update event is specific to the change described above. For example, an edit to enrolment notes alone does not emit enrolment.updated.

Event envelope

Each request contains one event. The following example is illustrative:

{
  "id": "evt_example_alert_created",
  "object": "event",
  "type": "alert.created",
  "api_version": "2026-10-05",
  "organisation_mode": "TEST",
  "created_at": "2026-10-20T10:00:00.000Z",
  "data": {
    "object": {
      "id": "alrt_example",
      "object": "alert",
      "organisation_id": "org_example",
      "enrolment_id": "enrl_example",
      "enrolment_mid": "123456789012345",
      "card_scheme": "MASTERCARD",
      "notification_type": "RETRY_NOW",
      "transaction_time": "2026-10-19T08:30:00.000Z",
      "transaction_amount_in_cents": 2150,
      "transaction_currency": "USD",
      "network_transaction_id": "EXAMPLE123",
      "card_bin": "512345",
      "card_last_four": "1234",
      "retry_outcome": null,
      "created_at": "2026-10-20T10:00:00.000Z"
    }
  }
}

Example IDs are placeholders. Treat actual IDs as opaque strings, including their prefixes.

FieldTypeDescription
idstringEvent ID, prefixed with evt_. Use it to deduplicate an event across deliveries and endpoints.
objectstringAlways event.
typestringOne of the event types above.
api_versionstringVersion of the event’s payload format. The current format is 2026-10-05.
organisation_modestringTEST or LIVE.
created_atstringISO 8601 timestamp for when the event was created.
data.objectobjectSnapshot of the alert or enrolment when this event occurred.
data.previous_attributesobjectPrevious values of changed fields. Present on update events; omitted on creation events.

Snapshots describe the object at the time of the event, even when an event is delivered later. Parse timestamps with their time zone. Allow unknown fields so additions do not break your receiver.

Update events

For enrolment.updated, data.previous_attributes contains the previous values of the changed status and/or unenrolment_requested_at fields. For alert.updated, it contains the previous retry_outcome, which can be null. The new values are in data.object.

For example, an alert changing from no reported outcome to a successful retry includes:

{
  "previous_attributes": {
    "retry_outcome": null
  }
}

This is an excerpt of data. The event also includes the full alert snapshot with retry_outcome set to SUCCEEDED.

Alert object

FieldTypeDescription
idstringAlert ID, prefixed with alrt_.
objectstringAlways alert.
organisation_idstringOrganisation that owns the alert.
enrolment_idstringEnrolment associated with the alert.
enrolment_midstringMerchant ID associated with that enrolment.
card_schemestringMASTERCARD for current Mastercard POP alerts.
notification_typestringRETRY_NOW for retry alerts.
transaction_timestringISO 8601 timestamp of the original transaction.
transaction_amount_in_centsinteger or nullAmount in the currency’s ISO 4217 minor units. See below.
transaction_currencystringISO 4217 currency code, or an empty string if unavailable.
network_transaction_idstringNetwork transaction identifier, or an empty string if unavailable. Use it with other transaction details to match a payment.
card_binstringCard bank identification number (BIN), or an empty string if unavailable.
card_last_fourstringLast four digits of the card, or an empty string if unavailable.
retry_outcomestring or nullSUCCEEDED, FAILED, or NOT_ATTEMPTED; null until reported or assigned after the reporting timeout.
created_atstringISO 8601 timestamp of when the alert was created.

Despite its name, transaction_amount_in_cents uses the currency’s minor units, not always hundredths. 2150 means USD 21.50, while 2150 in JPY means JPY 2,150. Use the ISO 4217 exponent for the currency. The amount is null when it cannot be represented exactly in those units or is unavailable. Never interpret null as zero.

The outcome describes your payment retry. PaymentRetryAlert assigns NOT_ATTEMPTED if no outcome is reported within 5 days of receiving the alert; a later API or dashboard report can change it.

Enrolment object

{
  "id": "enrl_example",
  "object": "enrolment",
  "organisation_id": "org_example",
  "type": "MASTERCARD_POP",
  "status": "ENABLED",
  "mastercard_pop_mid": "123456789012345",
  "notes": "",
  "status_changed_at": "2026-10-20T09:00:00.000Z",
  "enabled_at": "2026-10-20T09:00:00.000Z",
  "unenrolment_requested_at": null,
  "created_at": "2026-10-19T08:00:00.000Z"
}
FieldTypeDescription
idstringEnrolment ID, prefixed with enrl_.
objectstringAlways enrolment.
organisation_idstringOrganisation that owns the enrolment.
typestringMASTERCARD_POP.
statusstringPENDING, IN_PROGRESS, ACTION_REQUIRED, ENABLED, PAUSED, UNENROLLED, FAILED, or CANCELLED. See status meanings.
mastercard_pop_midstringMerchant ID. Keep it as a string to preserve leading zeros.
notesstringMessage about the enrolment, including any required action. Empty when no message is provided.
status_changed_atstringISO 8601 timestamp of the most recent status change.
enabled_atstring or nullFirst time the enrolment became enabled. Remains set if it is later paused.
unenrolment_requested_atstring or nullTime an unenrolment request was made. Null when no request is pending, including after unenrolment completes.
created_atstringISO 8601 timestamp of when the enrolment was created.

Payload versions

Each endpoint has a payload version. Each delivery keeps the version selected when that delivery was created, so later endpoint version changes do not change the format of its retries. Events retain their original snapshots; an event created in an older format is not converted forward to a newer format.

Signature verification

Signatures follow Standard Webhooks. Each endpoint has its own signing secret, starting with whsec_. You can reveal the secret on its dashboard page. Keep it in server-side secret storage.

To verify a request:

  1. Read webhook-id, webhook-timestamp, and webhook-signature and retain the raw body bytes.
  2. Check timestamp freshness. A recommended receiver tolerance is 5 minutes in either direction; keep your server clock accurate.
  3. Remove whsec_ from the secret and base64-decode the remainder to obtain the signing key.
  4. Build the signed bytes as the UTF-8 encoding of <webhook-id>.<webhook-timestamp>. followed by the raw body bytes.
  5. Compute HMAC-SHA256 with the decoded key and base64-encode the digest.
  6. Compare it with the signature value after v1,, using a constant-time comparison. If the header contains multiple space-separated signatures, accept any matching v1 signature.
import { createHmac, timingSafeEqual } from 'node:crypto';

// secret: the endpoint's whsec_ signing secret. headers: lower-case header
// names, as in Node's request.headers. body: the raw request body (Buffer).
export function verifyWebhook(secret, headers, body, toleranceSeconds = 300) {
  const id = headers['webhook-id'];
  const timestamp = headers['webhook-timestamp'];
  const signatures = headers['webhook-signature'];
  if (!id || !/^\d+$/.test(timestamp ?? '') || !signatures) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;

  const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
  const expected = createHmac('sha256', key).update(`${id}.${timestamp}.`).update(body).digest();

  return signatures.split(' ').some((signature) => {
    if (!signature.startsWith('v1,')) return false;
    const supplied = Buffer.from(signature.slice(3), 'base64');
    return supplied.length === expected.length && timingSafeEqual(supplied, expected);
  });
}
import base64
import hashlib
import hmac
import time


def verify_webhook(secret: str, headers, body: bytes, tolerance: int = 300) -> bool:
    """secret: the endpoint's whsec_ signing secret. headers: a case-insensitive
    mapping, such as Flask's request.headers. body: the raw request body."""
    msg_id = headers.get("webhook-id", "")
    timestamp = headers.get("webhook-timestamp", "")
    signatures = headers.get("webhook-signature", "")
    if not msg_id or not (timestamp.isascii() and timestamp.isdigit()):
        return False
    if abs(time.time() - int(timestamp)) > tolerance:
        return False

    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()

    return any(
        signature.startswith("v1,") and hmac.compare_digest(signature[3:], expected)
        for signature in signatures.split()
    )
<?php

// $secret: the endpoint's whsec_ signing secret. $headers: getallheaders().
// $body: the raw request body, file_get_contents('php://input').
function verify_webhook(string $secret, array $headers, string $body, int $tolerance = 300): bool
{
    $headers = array_change_key_case($headers, CASE_LOWER);
    $id = $headers['webhook-id'] ?? '';
    $timestamp = $headers['webhook-timestamp'] ?? '';
    $signatures = $headers['webhook-signature'] ?? '';
    if ($id === '' || !ctype_digit($timestamp) || abs(time() - (int) $timestamp) > $tolerance) {
        return false;
    }

    $key = base64_decode(substr($secret, strlen('whsec_')));
    $expected = base64_encode(hash_hmac('sha256', "{$id}.{$timestamp}.{$body}", $key, true));

    foreach (explode(' ', $signatures) as $signature) {
        if (str_starts_with($signature, 'v1,') && hash_equals($expected, substr($signature, 3))) {
            return true;
        }
    }

    return false;
}
package webhooks

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/base64"
	"net/http"
	"strconv"
	"strings"
	"time"
)

// VerifyWebhook checks a PaymentRetryAlert signature. secret is the endpoint's
// whsec_ signing secret; body is the raw request body.
func VerifyWebhook(secret string, header http.Header, body []byte) bool {
	id := header.Get("webhook-id")
	timestamp := header.Get("webhook-timestamp")
	seconds, err := strconv.ParseUint(timestamp, 10, 63)
	if id == "" || err != nil {
		return false
	}
	if age := time.Since(time.Unix(int64(seconds), 0)); age > 5*time.Minute || age < -5*time.Minute {
		return false
	}

	key, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(secret, "whsec_"))
	if err != nil {
		return false
	}
	mac := hmac.New(sha256.New, key)
	mac.Write([]byte(id + "." + timestamp + "."))
	mac.Write(body)
	expected := mac.Sum(nil)

	for _, signature := range strings.Fields(header.Get("webhook-signature")) {
		value, ok := strings.CutPrefix(signature, "v1,")
		if !ok {
			continue
		}
		if supplied, err := base64.StdEncoding.DecodeString(value); err == nil && hmac.Equal(supplied, expected) {
			return true
		}
	}

	return false
}

Reject requests that fail verification. Do not reserialize JSON before checking the signature. Delivery retries have a fresh signed timestamp, so an older event can still arrive in a valid, fresh request. The integration guide shows where verification fits in a webhook endpoint.

Retries and duplicates

A 2xx response completes an attempt successfully. Other status codes, redirects, connection failures, and timeouts count as failures.

After the first failed attempt, automatic retries wait approximately 1 minute, 5 minutes, 30 minutes, 2 hours, and 12 hours, respectively, after each preceding failed attempt. Each delay can be up to 10% longer. There are at most 6 automatic attempts, including the first.

Your endpoint can receive an event more than once, and events can arrive out of order. Store id from the event body as your event deduplication key. webhook-id identifies delivery to a particular endpoint; the same event delivered to another endpoint has a different delivery ID.

In the dashboard, Retry now brings a scheduled attempt forward. Resend makes one additional attempt when no automatic attempt is pending; a failed manual resend does not start a new automatic retry sequence. A delivery that succeeded previously keeps its successful status even if a later resend fails, so inspect individual attempts when diagnosing a resend.

Disabled endpoints and recovery

Disabling or deleting an endpoint cancels its planned retries. A request already in flight can still arrive. Events occurring while an endpoint is disabled are not sent to it later, and creating an endpoint does not backfill earlier events.

Repeated failures can cause an endpoint to be disabled automatically. Owners and developers receive a warning email and, if the failure condition persists for another 24 hours, a disablement email. Fix the receiver, enable the endpoint, and review existing deliveries for manual resends. Enabling it does not restart cancelled retries automatically.

Use GET /events and GET /alerts, or Events and Alerts in the dashboard, to reconcile activity that your receiver missed. Review the integration troubleshooting steps before contacting support.

Questions or integration help: support@paymentretryalert.com. Include your organisation ID, event ID and delivery ID; never send signing secrets or full card numbers.