executionActionUpdated notification when an action on an execution changes after you received its first result. The default payment-acceptance workflow sends it for four actions: authorize, capture, cancel, and refund.
Typical causes:
- The PSP sends a late result. For example, the PSP approves a payment that timed out synchronously.
- The PSP sends more notifications or data for an action Payrails already reported.
- Someone captures or refunds the payment outside Payrails, for example in the PSP dashboard.
executionActionUpdated, and details.action names the action the step runs in, for example authorize.
Payrails delivers
executionActionUpdated only when it’s enabled for your notification endpoint. Make sure your endpoint accepts the new event value, then contact your Payrails representative to enable it.How it works
Payrails sendsexecutionActionCompleted once, for the first result of an action. Every later notification on the same execution is executionActionUpdated. Payrails doesn’t send executionActionCompleted again.
Notification envelope
Every Payrails notification uses the same envelope. Thedetails object has the same shape for executionActionCompleted and executionActionUpdated, so the parser you already use for completed actions also reads updates.
Example
string
required
The event type.
executionActionCompleted for the first result of an action, executionActionUpdated for every notification after it.string
required
When Payrails produced the event, in RFC 3339 format (UTC). Use it to order events: notifications can arrive out of order, and more than once.
object
required
The action payload. On an update, it carries the payment that changed.
string
required
The workspace the execution belongs to.
string
required
What started the event:
api: requested through the Payrails APIaction: started by a workflow step, such as a delayed captureexternal: performed outside Payrails and reported by the PSP
Tell notifications apart
Readevent, eventTrigger, and actionId together.
Handle the notification
1
Accept the new event value
Route
executionActionUpdated to the same handler you use for executionActionCompleted. Keep verifying the signature and processing notifications idempotently.2
Match on details.actionId
If you already have the
actionId, update the state of that action. If the actionId is new and eventTrigger is external, record it as a new action that wasn’t requested through Payrails.3
Order by time, not arrival
Apply the most recent state using
time, and ignore duplicates.4
Read the result again
Check
details.success and paymentComposition[].operationResult. An update can turn a failed authorization into an approved one. When success becomes true, fulfill the order, or refund it if your customer already saw the payment fail.Examples
Each example shows the execution events and a snippet of the fields to capture from each notification. Snippets show only those fields. The fulldetails object follows the standard execution action notification structure.
- Cancel
- Capture and refund