Workflows / Stripe / payout.paid

Stripe Payout Paid Notification to Slack & Email

Use the Stripe integration by MagicBell to setup a workflow when payout.paid triggers in Stripe.

Connect Stripe to MagicBell to receive events and trigger workflows. This guide uses the MagicBell CLI.

Add the Stripe integration

Save your Stripe webhook signing secret in MagicBell. See Stripe webhooks.

magicbell integration save_stripe \
  --data '{"webhook_signing_secret":"whsec_xxx"}'

Copy the ID from the response and use it to build your webhook URL:

https://api.magicbell.com/v2/integrations/stripe/webhooks/incoming/{id}

Setup the webhook

  • Setup a webhook in Stripe with the URL from the last step.
  • Select the payout.paid event.
  • If you already have a webhook configured, make sure it includes this event.

Add a workflow

Create a workflow that triggers automatically when Stripe sends this event.

Workflow key

Use this key to trigger the workflow when Stripe sends a payout.paid:

integration.stripe.payout.paid

Example workflow

Notify the finance team when a payout has been deposited to the bank account.

{
  "key": "integration.stripe.payout.paid",
  "steps": [
    {
      "command": "broadcast",
      "input": {
        "content": "Payout of ${{payload.data.object.amount}} has been deposited to your bank account. Payout ID: {{payload.data.object.id}}",
        "overrides": {
          "providers": {
            "slack": {}
          }
        },
        "recipients": [
          {
            "external_id": "finance-team"
          }
        ],
        "title": "Payout deposited"
      }
    }
  ]
}

Save with the CLI

Use the MagicBell CLI to save this workflow to your project. You can also use the Workflows API endpoint instead.

magicbell workflow save \
  --data '{"key":"integration.stripe.payout.paid","steps":[{"command":"broadcast","input":{"content":"Payout of ${{payload.data.object.amount}} has been deposited to your bank account. Payout ID: {{payload.data.object.id}}","overrides":{"providers":{"slack":{}}},"recipients":[{"external_id":"finance-team"}],"title":"Payout deposited"}}]}'

Event payload

Sample payload for the payout.paid event. Use liquid templates to access fields in your workflow.

{
  "api_version": "2023-10-16",
  "created": 1694109801,
  "data": {
    "object": {
      "amount": 50000,
      "arrival_date": 1694109801,
      "created": 1694109741,
      "currency": "usd",
      "description": "STRIPE PAYOUT",
      "destination": "ba_1NqImRLkdIwHu7ixFfP8Qr1s",
      "id": "po_1NqImRLkdIwHu7ixEeO7Pq0r",
      "livemode": false,
      "object": "payout",
      "status": "paid",
      "type": "bank_account"
    }
  },
  "id": "evt_1NqImSLkdIwHu7ixDdN6Op9q",
  "livemode": false,
  "object": "event",
  "type": "payout.paid"
}
View all Stripe workflows →