Skip to main content
Maps a normalized provider webhook action to a status update: account events set the payout account to active, restricted, or rejected; payout events set the payout to processing, paid, failed, or canceled. Unsupported actions (or events without an ID) are ignored. Triggered by the payout-webhook subscriber after the payout provider parses the raw webhook payload.

Usage

import { processPayoutForWebhookWorkflow } from "@mercurjs/core/workflows"

await processPayoutForWebhookWorkflow(container).run({
  input: {
    action: "payout.paid",
    data: { id: "payout_123" },
  },
})

Input

action
string
required
One of account.activated, account.restricted, account.rejected, payout.processing, payout.paid, payout.failed, payout.canceled, not_supported.
data
object
Event target; nothing happens when omitted.

Result

result
void
No return value; the matching account or payout status is updated as a side effect.