Skip to main content
Use this recipe to push funds to beneficiaries such as drivers, vendors, or partners. Payouts share the same aggregator credentials you use for pay-ins.

Prerequisites

  • {{aggregator_id}} and {{secret_key}}
  • Beneficiary IBAN validated with the account validation utilities
  • Webhook endpoint ready to receive payout status updates

Flow summary

1

Validate the beneficiary

Resolve the beneficiary’s details with GET /title-fetch or GET /account-info to avoid payout failures.
2

Call the payout endpoint

Send POST /v1/aggregators/{{aggregator_id}}/payout with a unique request_id, the payout amount (string, in PKR), and the beneficiary creditor_iban.
3

Track completion

Listen for webhook notifications or poll GET /v1/aggregators/{{aggregator_id}}/payments to confirm settlement and update ledgers.
Set {{base_url}} to https://dev.api.getsafepay.com/raastwire in Sandbox or https://api.getsafepay.com/raastwire in Production.

Payouts

string
required
UUID v4 that keeps payout submissions idempotent (exactly 36 characters with hyphens).
string
required
Amount in PKR represented as a string (for example, "200" = PKR 200).
string
required
Beneficiary IBAN that will receive the funds.

Webhook events to expect

Payouts use the payment.* event family. Expect payment.created, payment.pending_authorization, and a terminal event such as payment.settled or payment.failed. Identify payout events by checking whether subject.payment.type is PAYOUT or SETTLEMENT_PAYOUT; there is no separate payout.* event family. Refer to the webhooks delivery guide for the full delivery contract and Webhook events and payloads for an example.

Failure handling checklist

  • Inspect webhook payloads for failure reasons (insufficient funds, invalid account, compliance hold).
  • Retry transient errors with the same request_id to stay idempotent.
  • Raise manual review tasks for permanent failures and notify beneficiaries.

See also