Create a payout
Send money to your customers.
You can use payout to send money to your customer without any reference to previous transactions. Possible use cases for this transaction could be paying out sellers on your marketplace, online gaming, lottery wins, and so on.
The payout transaction is currently available for the following payment types:
- Unzer Direct Debit secured
Payout triggers a payment transaction from the merchant to the customer.
A payout is triggered by calling the
/payments/payouts after you have created your preferred payment type with an amount, a currency, transactions’ description and a reference to a payment type.
$unzer = new UnzerSDK\Unzer('s-priv-xxxxxxxxxx'); $card = $unzer->fetchPaymentType('s-crd-9wmri5mdlqps'); $payout = $unzer->payout(100.00, 'EUR', $card, 'https://your.return.url');
$unzer = new UnzerSDK\Unzer('s-priv-xxxxxxxxxx'); $card = $unzer->fetchPaymentType('s-crd-9wmri5mdlqps'); $payout = $card->payout(100.0, 'EUR', 'https://your.return.url', null, null, null, null, 'invoiceId', 'payment reference text');
|amount||float||The amount to credit the given payment type with.
|currency||string||The currency of the amount.
|returnUrl||string||A return URL (which is not used in this transaction).|
||A reference to the customer resource corresponding to this transaction.
This can be either a customer object or the ID of an existing customer resource. If a customer object is used whose ID is not set (i. e. the resource does not exist yet in the PAPI) the customer resource will automatically be created and referenced with the transaction call.
For more details, see Manage customer.
Required: only in case of guaranteed payment types
|orderId||string||The ID of the order in your store.
||A reference to the metadata corresponding to this payment.
The metadata object can be used to pass along custom information which you whish to reference to the payment.
For more details, see Manage metadata
||A reference to the basket corresponding to this payment.
For more details, see Manage baskets.
|invoiceId||string||This is used to transmit the invoice ID from your shop to the API.
|paymentReference||string||The reference string is show to the customer as reference text on his bank statement.
payout call returns a payment ID and the payout ID 1, because only one payout per payment is possible.
isError indicate the result of the transaction. Only one of these three can be true.
When fetching the
payout resource (s-out-…), transaction value will be positive, for example 100. But when fetching the
payment resource (of which
payout is part of), transaction value will be negative (-100).
$amount = $payment->getAmount()->getTotal // is-100