> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/payouts/create-payout/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Create a Payout POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/payouts/bankwire Content-Type: application/json Initiate a payout request from a user's wallet to a Recipient **Note – Local Recipients can only receive local currencies** Attempting a payout to a newly created local Recipient (with the `PayoutMethodType` of `LocalBankTransfer`) in a non-local currency may return an HTTP 400 error because the Recipient's Country doesn't correspond to the currency sent (for example, a USD payout sent to local SEPA Recipient). To receive non-local currencies, create a new Recipient with `PayoutMethodType` of `InternationalBankTransfer` and retry the payout. Mangopay automatically optimizes the payout route, so if a local currency is sent to an international Recipient, the domestic rail is used. Read more about [how Mangopay routes funds](/guides/payouts#how-mangopay-routes-funds) **→** **Note – `PayoutModeRequested` property only relevant for EUR** The `PayoutModeRequested` property is only relevant for EUR payouts, where the value determines which of the SEPA schemes (SCT, SCT Inst, or T2) is used. For other currencies, Mangopay automatically uses the relevant local scheme (e.g. FPS for GBP) if the Recipient's destination country corresponds, or otherwise uses SWIFT. [Read more](/guides/payouts#how-mangopay-routes-funds) **→** If your platform offers User-Owned Accounts (Virtual Account or Banking Alias) to your end users, Verification of Payee (VOP) may impact their payouts. There is no impact for platforms not offering User-Owned Accounts. [Read more](/guides/vop) **→** Reference: https://docs.mangopay.com/api-reference/payouts/create-payout ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. If your platform is using a [proxy](/guides/sca/proxy-management) to take SCA-triggering action on behalf of users, you also need to integrate [mTLS authentication](/guides/sca/platform) and use the `api-mtls` base URL. ## Servers - `https://api.sandbox.mangopay.com` (Sandbox, default) - `https://api.mangopay.com` (Production) - `https://api-mtls.sandbox.mangopay.com` (mTLS Sandbox) - `https://api-mtls.mangopay.com` (mTLS Production) ## Request ### Path parameters - `ClientId` (string, required) — Platform's API account identifier, associated with the API key. ### Body (application/json) This endpoint expects a CreateAPayoutRequest. - `AuthorId` (string, required) — The unique identifier of the user at the source of the transaction. **Best practice:** When the payout author is different from the bank account owner, the Payout `AuthorId` value must be different from the Recipient `UserId` value as well. Otherwise, Mangopay's Compliance team will reject the payout. - `DebitedFunds` (CreateAPayoutRequestDebitedFunds, required) — Information about the debited funds. - `Fees` (CreateAPayoutRequestFees, required) — Information about the fees. - `DebitedWalletId` (string, required) — The unique identifier of the debited wallet. - `RecipientId` (string, optional) — The unique identifier of the [Recipient](/api-reference/recipients/recipient-object) object to which the payout is being requested. This property should be used by platforms integrating for the first time (and not the `BankAccountId`). - `BankAccountId` (string, optional) — The unique identifier of the Bank Account. This property should **not** be used by platforms integrating for the first time – send the `RecipientId` instead. - `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`. - `BankWireRef` (string, optional) — Max. length: 255 characters (\< 12 recommended) Custom description to appear on the user's bank statement along with the platform name. The recommended length is 12 characters – strings longer than this may be truncated depending on the bank. For the full structure of the string, see the Customizing bank statement references article. - `PayoutModeRequested` (string, optional) — **Possible values:** `STANDARD`, `INSTANT_PAYMENT`, `INSTANT_PAYMENT_ONLY`, `RTGS_PAYMENT` **Default value:** `STANDARD` The mode defining how the payout request is sent: - `STANDARD` – **Non-EUR:** Sent via the relevant local rail if the Recipient's destination country corresponds, or otherwise sent via SWIFT. Mangopay automatically routes funds via the [available rails](/guides/payouts#all-rails-by-currency), which also determines [delivery times](/guides/payouts#delivery-times). Requests received after the applicable cutoff are processed the next working day. **EUR:** Sent via the SEPA Credit Transfer scheme or SWIFT (if non-domestic). - `INSTANT_PAYMENT` – **EUR only:** Sent via the SEPA Instant Credit Transfer scheme (funds processed within 10 seconds) with a fallback to `STANDARD` mode if any of the prerequisites are not met or if another issue occurs. If the payout is above the threshold agreed with Mangopay, the payout fails and there is no fallback. - `INSTANT_PAYMENT_ONLY` – **EUR only:** sent via the SEPA Instant Credit Transfer scheme (funds processed within 10 seconds) without a fallback. If an issue occurs, the wallet automatically refunded. - `RTGS_PAYMENT` – **EUR only:** sent via the Eurozone's [real-time gross settlement (RGTS)](/guides/payouts#real-time-gross-settlement-rtgs) scheme T2 (funds processed same working day) without a fallback. If the request is received after the applicable cutoff (16:15 CET), it is processed the next working day (from 07:00 CET). - `PaymentRef` (CreateAPayoutRequestPaymentRef, optional, nullable) — Information about the payment reference provided for the payout. This object must be used to provide the reference of a [bank wire pay-in](/api-reference/bank-wire-payins/bank-wire-payin-object) or a [pay-in to virtual IBAN](/api-reference/virtual-accounts/external-instruction-bank-wire-payin-object), if the payout is being used to refund it. - `ChargeBearer` (string, optional) — Possible values: `SHA`, `OUR` Default value: `SHA` The allocation of [processing fees](/guides/payouts#fees-for-international-payouts) for an international SWIFT payout: - `SHA` - Fees are shared between the remitter and beneficiary. The beneficiary's share is deducted from the payout, meaning that the amount arriving on the recipient's bank account may be less than the Payout's `CreditedFunds.Amount`. - `OUR` - All fees are paid by the remitter. The recipient receives the full `CreditedFunds.Amount` of the Payout, and Mangopay recovers the fees from the platform during the billing cycle. A 400 HTTP error is returned if Mangopay's network of partners does not support `OUR` fees for the given currency and recipient country, or if this feature is not activated. For non-SWIFT requests, the `ChargeBearer` is ignored and `SHA` or `null` is displayed by default in the response. ## Response ### 200 Success - `Id` (string, optional) — Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details) The unique identifier of the object. - `Tag` (string, optional) — Max. length: 255 characters Custom data that you can add to this object, such as unique identifiers in your system. To store multiple values, you can serialize them into a single string, for example a JSON object: `"{\"id_1\":AB123,\"id_2\":DE456}"`. - `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created. - `AuthorId` (string, optional) — The unique identifier of the user at the source of the transaction. Best practice: When the payout author is different from the bank account owner, the Payout `AuthorId` value must be different from the Bank Account `UserId` value as well. Otherwise, Mangopay's Compliance team will reject the payout. - `CreditedUserId` (any, optional) — For a payout, the `CreditedUserId` is always `null` as the funds are being paid out of the Mangoapy environment. - `DebitedFunds` (CreatePayoutResponseDebitedFunds, optional) — Information about the debited funds. - `CreditedFunds` (CreatePayoutResponseCreditedFunds, optional) — Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). - `Fees` (CreatePayoutResponseFees, optional) — Information about the fees. - `Status` (string, optional) — **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. - `ResultCode` (string, optional) — The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. - `ResultMessage` (string, optional) — The explanation of the result code. - `ExecutionDate` (integer, optional) — Unix timestamp (UTC) of the date and time the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`. - `Type` (string, optional) — **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT` The type of the transaction. - `Nature` (string, optional) — **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT` The nature of the transaction, providing more information about the context in which the transaction occurred: - `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow. - `REPUDIATION` – Automatic withdrawal of funds from the platform's repudiation wallet as part of the dispute process (when the user has requested a chargeback). - `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay). - `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute. - `CreditedWalletId` (string, optional) — The unique identifier of the credited wallet. In the specific case of the Payout object, this value is always `null` since there is no credited wallet. - `DebitedWalletId` (string, optional) — The unique identifier of the debited wallet. - `PaymentType` (string, optional) — **Returned values:** `BANK_WIRE` The payment type of the payout. - `BankAccountId` (string, optional) — The unique identifier of the bank account. - `BankWireRef` (string, optional) — Max. length: 255 characters (\< 12 recommended) Custom description to appear on the user's bank statement along with the platform name. The recommended length is 12 characters – strings longer than this may be truncated depending on the bank. For the full structure of the string, see the Customizing bank statement references article. - `ModeRequested` (string, optional) — **Returned values:** `STANDARD`, `INSTANT_PAYMENT`, `INSTANT_PAYMENT_ONLY`, `RTGS_PAYMENT` The value set for the `PayoutModeRequested` parameter when making the request. - `ModeApplied` (string, optional) — **Returned values:** `STANDARD`, `INSTANT_PAYMENT`, `RTGS_PAYMENT`, `PENDING_RESPONSE` The mode defining how the payout request is sent: - `STANDARD` – **Non-EUR:** Sent via the relevant local rail if the Recipient's destination country corresponds, or otherwise sent via SWIFT. Mangopay automatically routes funds via the [available rails](/guides/payouts#all-rails-by-currency), which also determines [delivery times](/guides/payouts#delivery-times). Requests received after the applicable cutoff are processed the next working day. **EUR:** Sent via the SEPA Credit Transfer scheme or SWIFT (if non-domestic). - `INSTANT_PAYMENT` – **EUR only:** Sent via the SEPA Instant Credit Transfer scheme (funds processed within 10 seconds). - `RTGS_PAYMENT` – **EUR only:** Sent via the Eurozone's [real-time gross settlement (RGTS)](/guides/payouts#real-time-gross-settlement-rtgs) scheme T2 (funds processed same working day) without a fallback. If the request is received after the applicable cutoff (16:15 CET), it is processed the next working day (from 07:00 CET). - `PENDING_RESPONSE` – Temporary state to accommodate the possible latency between the creation of the request and the mode being applied in the case of instant payment and RGTS modes. - `FallbackReason` (CreatePayoutResponseFallbackReason, optional, nullable) — Information regarding the reason for the refusal of the instant payout request. - `EndToEndId` (string, optional) — The unique identifier of a bank wire for tracking purposes only. - `PaymentRef` (CreatePayoutResponsePaymentRef, optional, nullable) — Information about the payment reference provided for the payout. This object must be used to provide the reference of a [bank wire pay-in](/api-reference/bank-wire-payins/bank-wire-payin-object) or a [pay-in to virtual IBAN](/api-reference/virtual-accounts/external-instruction-bank-wire-payin-object), if the payout is being used to refund it. - `RecipientVerificationOfPayee` (RecipientVerificationOfPayeePayout, optional, nullable) — Information about the [Verification of Payee (VOP)](/guides/vop) check performed on the Recipient as part of a Payout request. Because VOP only applies to SEPA local schemes, this object is returned `null` if the Recipient's `Currency` is not `EUR` or its `PayoutMethodType` is not `LocalBankTransfer`. Unlike [Recipient](/api-reference/recipients/recipient-object) endpoints, `RecipientVerificationPayeeSuggestedName` is not returned on Payout responses, even if the result is `CLOSE_MATCH`. - `RecipientId` (string, optional) — The unique identifier of the [Recipient](/api-reference/recipients/recipient-object) object to which the payout is being requested. This property should be used by platforms integrating for the first time (and not the `BankAccountId`). - `ChargeBearer` (string, optional) — Possible values: `SHA`, `OUR` Default value: `SHA` The allocation of [processing fees](/guides/payouts#fees-for-international-payouts) for an international SWIFT payout: - `SHA` - SWIFT fees are shared between the remitter and beneficiary. The beneficiary's share is deducted from the payout, meaning that the amount arriving on the recipient's bank account may be less than the Payout's `CreditedFunds.Amount`. - `OUR` - All SWIFT fees are paid by the remitter. The recipient receives the full `CreditedFunds.Amount` of the Payout, and Mangopay recovers the fees from the platform during the billing cycle. A 400 HTTP error is returned if Mangopay's network of partners does not support `OUR` fees for the given currency and recipient country, or if this feature is not activated. For non-SWIFT requests, the `ChargeBearer` is ignored and `SHA` or `null` is displayed by default in the response. ## Errors ### 400 Bad Request Error Bad Request - `Message` (string, optional) — Description of the error. - `Type` (string, optional) — The category of the error. - `Id` (string, optional) — Unique identifier of the error instance, useful when contacting Mangopay for support. - `Date` (double, optional) — Unix timestamp (UTC) of the date and time the error was triggered. - `errors` (map from string to string, optional, nullable) — Object containing one or more field-level errors. ## Types ### CreateAPayoutRequestDebitedFunds Information about the debited funds. - `Currency` (string, required) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount. - `Amount` (integer, required) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ### CreateAPayoutRequestFees Information about the fees. - `Currency` (string, required) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount. - `Amount` (integer, required) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ### CreateAPayoutRequestPaymentRef Information about the payment reference provided for the payout. This object must be used to provide the reference of a [bank wire pay-in](/api-reference/bank-wire-payins/bank-wire-payin-object) or a [pay-in to virtual IBAN](/api-reference/virtual-accounts/external-instruction-bank-wire-payin-object), if the payout is being used to refund it. - `ReasonType` (string, required) — **Allowed values:** `PAYIN_REFUND` The reason for the reference being provided: - `PAYIN_REFUND` – The payout serves to reimburse a pay-in. - `ReferenceId` (string, required) — **Allowed values:** The valid `Id` of a successful pay-in. The unique identifier associated with the reference, whose value corresponds to the `ReasonType`: - `PAYIN_REFUND` – The `ReferenceId` value provided is the same as the `Id` of the initial pay-in being refunded. ### CreatePayoutResponseDebitedFunds Information about the debited funds. - `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount. - `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ### CreatePayoutResponseCreditedFunds Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`). - `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount. - `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ### CreatePayoutResponseFees Information about the fees. - `Currency` (string, optional) — **Allowed values:** The three-letter ISO 4217 code (EUR, GBP, etc.) of a supported currency (depends on feature, contract, and activation settings). The currency of the amount. - `Amount` (integer, optional) — The amount of the currency in its minor unit. For example, EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`. ### CreatePayoutResponseFallbackReason Information regarding the reason for the refusal of the instant payout request. - `ResultCode` (string, optional) — The code indicating the result of the operation. This information is mostly used to handle errors or for filtering purposes. - `ResultMessage` (string, optional) — The explanation of the result code. ### CreatePayoutResponsePaymentRef Information about the payment reference provided for the payout. This object must be used to provide the reference of a [bank wire pay-in](/api-reference/bank-wire-payins/bank-wire-payin-object) or a [pay-in to virtual IBAN](/api-reference/virtual-accounts/external-instruction-bank-wire-payin-object), if the payout is being used to refund it. - `ReasonType` (string, optional) — **Allowed values:** `PAYIN_REFUND` The reason for the reference being provided: - `PAYIN_REFUND` – The payout serves to reimburse a pay-in. - `ReferenceId` (string, optional) — **Allowed values:** The valid `Id` of a successful pay-in. The unique identifier associated with the reference, whose value corresponds to the `ReasonType`: - `PAYIN_REFUND` – The `ReferenceId` value provided is the same as the `Id` of the initial pay-in being refunded. ### RecipientVerificationOfPayeePayout Information about the [Verification of Payee (VOP)](/guides/vop) check performed on the Recipient as part of a Payout request. Because VOP only applies to SEPA local schemes, this object is returned `null` if the Recipient's `Currency` is not `EUR` or its `PayoutMethodType` is not `LocalBankTransfer`. Unlike [Recipient](/api-reference/recipients/recipient-object) endpoints, `RecipientVerificationPayeeSuggestedName` is not returned on Payout responses, even if the result is `CLOSE_MATCH`. - `RecipientVerificationId` (string, optional, nullable) — The unique identifier of the VOP check. This value may be `null` if the check could not be performed. - `RecipientVerificationCheck` (string, optional, nullable) — **Possible values:** `MATCH`, `CLOSE_MATCH`, `NO_MATCH`, `MATCH_NOT_POSSIBLE` The result of the VOP check: - `MATCH` – The account is valid and the account name matches the IBAN. - `CLOSE_MATCH` – The account is valid but the name doesn't match exactly. - `NO_MATCH` – This account likely belongs to a different owner. - `MATCH_NOT_POSSIBLE` – The check could not be completed. - `RecipientVerificationMessage` (string, optional, nullable) — A human-readable message describing the result of the `RecipientVerificationCheck`: * If `MATCH`, then `Account name fully matches account identifier.` * If `CLOSE_MATCH`, then `Account name partially matches account identifier. Name returned by check: {Name}. Payment made to this account may not reach its intended counterparty.` * If `NO_MATCH`, then `Account name does not matches account identifier. Payment made to this account may not reach its intended counterparty.` * If `MATCH_NOT_POSSIBLE`, then `Account name does not matches account identifier. Payment made to this account may not reach its intended counterparty.` ## Examples ### Standard **Request** ```json { "body": { "AuthorId": "user_m_01KF3087EDXEAK8VPD9DTMZW8N", "BankWireRef": "Example123", "DebitedFunds": { "Amount": 5792, "Currency": "EUR" }, "DebitedWalletId": "wlt_m_01KF30AN0HCMPPCGEEGY4DCBGZ", "Fees": { "Amount": 579, "Currency": "EUR" }, "RecipientId": "rec_01KF0MPAA8X9C80Q394TSF7MEY", "Tag": "Created using Mangopay API Postman Collection" } } ``` **Response** ```json { "Id": "po_m_01HQMZSGSQPPXC51TZHDAYFAJF", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1709027672, "AuthorId": "204069570", "CreditedUserId": null, "DebitedFunds": { "Currency": "EUR", "Amount": 5792 }, "CreditedFunds": { "Currency": "EUR", "Amount": 5213 }, "Fees": { "Currency": "EUR", "Amount": 579 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYOUT", "Nature": "REGULAR", "CreditedWalletId": null, "DebitedWalletId": "204069727", "PaymentType": "BANK_WIRE", "BankAccountId": null, "BankWireRef": "Example123", "ModeRequested": null, "ModeApplied": "PENDING_RESPONSE", "FallbackReason": null, "EndToEndId": "2c2184396eef4e5da90ab48a2feeb51d", "PaymentRef": null, "RecipientVerificationOfPayee": null, "RecipientId": "rec_01KF0MPAA8X9C80Q394TSF7MEY", "ChargeBearer": "OUR" } ``` **SDK Code** ```python Standard from pprint import pprint import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import BankWirePayOut from mangopay.utils import Money natural_user_id = '213753890' natural_user_wallet_id = '213754077' payout = BankWirePayOut( author_id = natural_user_id, debited_funds = Money(amount=200, currency='EUR'), fees = Money(amount=0, currency='EUR'), debited_wallet_id = natural_user_wallet_id, bank_account_id = '214651521', tag = 'Created using Mangopay Python SDK' ) create_payout = payout.save() pprint(create_payout) ``` ```javascript Standard const mangopayInstance = require('mangopay4-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myUser = { Id: '146476890', WalletId: '148968396', } let myBankAccount = { Id: '154876798', } let myPayout = { DebitedWalletId: myUser.WalletId, PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount.Id, BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser.Id, DebitedFunds: { Currency: 'EUR', Amount: 12, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay NodeJS SDK', } const createPayout = async (payout) => { return await mangopay.PayOuts.create(payout) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createPayout(myPayout) ``` ```java Standard import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.PayoutMode; import com.mangopay.entities.PayOut; import com.mangopay.entities.subentities.PayOutPaymentDetailsBankWire; public class CreatePayout { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var bankAccountId = "bankacc_m_01HTJ7P7Y8K9DS5SZ08MDQRHHE"; PayOut payout = new PayOut(); payout.setAuthorId(userId); payout.setDebitedWalletId(walletId); payout.setDebitedFunds(new Money(CurrencyIso.EUR, 500)); payout.setFees(new Money(CurrencyIso.EUR, 0)); PayOutPaymentDetailsBankWire paymentDetails = new PayOutPaymentDetailsBankWire(); paymentDetails.setBankAccountId(bankAccountId); paymentDetails.setPayoutModeRequested(PayoutMode.STANDARD); payout.setMeanOfPaymentDetails(paymentDetails); PayOut createPayout = mangopay.getPayOutApi().create(payout); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayout); System.out.println(prettyJson); } } ``` ```csharp Standard using MangoPay.SDK; using MangoPay.SDK.Entities; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var bankAccountId = "bankacc_m_01J534QNZZSRCXXAJ1VXP58DDH"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var debitedFunds = new Money { Amount = 2000, Currency = CurrencyIso.EUR }; var fees = new Money { Amount = 50, Currency = CurrencyIso.EUR }; var bankWireRef = "ExampleInvoice1234"; var payout = new PayOutBankWirePostDTO( userId, walletId, debitedFunds, fees, bankAccountId, bankWireRef, PayoutModeRequested.STANDARD ) { Tag = "Created using the Mangopay .NET SDK" }; var createPayout = await api.PayOuts.CreateBankWireAsync(payout); string prettyPrint = JsonConvert.SerializeObject(createPayout, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` ```php Standard Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payout = new \MangoPay\PayOut(); $payout->Tag = 'Created with Mangopay PHP SDK'; $payout->AuthorId = '146476890'; $payout->DebitedFunds = new \MangoPay\Money(); $payout->DebitedFunds->Currency = 'EUR'; $payout->DebitedFunds->Amount = 1000; $payout->Fees = new \MangoPay\Money(); $payout->Fees->Currency = 'EUR'; $payout->Fees->Amount = 0; $payout->DebitedWalletId = '148968396'; $payout->PayoutPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire(); $payout->PayoutPaymentDetails->BankAccountId = '198982485'; $payout->PayoutPaymentDetails->BankWireRef = 'MangopayPHP'; $payout->MeanOfPaymentDetails = $payout->PayoutPaymentDetails; $payout->PaymentType = \MangoPay\PayOutPaymentType::BankWire; $payout->PayoutModeRequested = 'STANDARD'; $response = $api->PayOuts->Create($payout); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```ruby Standard require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def createPayout(payoutObject) begin response = MangoPay::PayOut::BankWire.create(payoutObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create payout: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '146476890', WalletId: '148968396' } myBankAccount = { Id: '154876798' } myPayout = { DebitedWalletId: myUser[:WalletId], PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount[:Id], BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser[:Id], DebitedFunds: { Currency: 'EUR', Amount: 1200, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay Ruby SDK' } createPayout(myPayout) ``` ### SCT Inst (no fallback) **Request** ```json { "body": { "AuthorId": "204069570", "BankAccountId": "204070675", "BankWireRef": "Example123", "DebitedFunds": { "Amount": 3387, "Currency": "EUR" }, "DebitedWalletId": "204069727", "Fees": { "Amount": 339, "Currency": "EUR" }, "PayoutModeRequested": "INSTANT_PAYMENT_ONLY", "Tag": "Created using Mangopay API Postman Collection" } } ``` **Response** ```json { "Id": "po_m_01HQMZZV376RRXYQGQAHZ4TN9K", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1709027880, "AuthorId": "204069570", "CreditedUserId": null, "DebitedFunds": { "Currency": "EUR", "Amount": 3387 }, "CreditedFunds": { "Currency": "EUR", "Amount": 3048 }, "Fees": { "Currency": "EUR", "Amount": 339 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYOUT", "Nature": "REGULAR", "CreditedWalletId": null, "DebitedWalletId": "204069727", "PaymentType": "BANK_WIRE", "BankAccountId": null, "BankWireRef": "Example123", "ModeRequested": "INSTANT_PAYMENT_ONLY", "ModeApplied": "PENDING_RESPONSE", "FallbackReason": null, "EndToEndId": "e8052ae4729f4abe9355442020f411a9", "PaymentRef": null, "RecipientVerificationOfPayee": null, "RecipientId": "rec_01KF0MPAA8X9C80Q394TSF7MEY" } ``` **SDK Code** ```python SCT Inst (no fallback) from pprint import pprint import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import BankWirePayOut from mangopay.utils import Money natural_user_id = '213753890' natural_user_wallet_id = '213754077' payout = BankWirePayOut( author_id = natural_user_id, debited_funds = Money(amount=200, currency='EUR'), fees = Money(amount=0, currency='EUR'), debited_wallet_id = natural_user_wallet_id, bank_account_id = '214651521', tag = 'Created using Mangopay Python SDK' ) create_payout = payout.save() pprint(create_payout) ``` ```javascript SCT Inst (no fallback) const mangopayInstance = require('mangopay4-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myUser = { Id: '146476890', WalletId: '148968396', } let myBankAccount = { Id: '154876798', } let myPayout = { DebitedWalletId: myUser.WalletId, PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount.Id, BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser.Id, DebitedFunds: { Currency: 'EUR', Amount: 12, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay NodeJS SDK', } const createPayout = async (payout) => { return await mangopay.PayOuts.create(payout) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createPayout(myPayout) ``` ```java SCT Inst (no fallback) import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.PayoutMode; import com.mangopay.entities.PayOut; import com.mangopay.entities.subentities.PayOutPaymentDetailsBankWire; public class CreatePayout { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var bankAccountId = "bankacc_m_01HTJ7P7Y8K9DS5SZ08MDQRHHE"; PayOut payout = new PayOut(); payout.setAuthorId(userId); payout.setDebitedWalletId(walletId); payout.setDebitedFunds(new Money(CurrencyIso.EUR, 500)); payout.setFees(new Money(CurrencyIso.EUR, 0)); PayOutPaymentDetailsBankWire paymentDetails = new PayOutPaymentDetailsBankWire(); paymentDetails.setBankAccountId(bankAccountId); paymentDetails.setPayoutModeRequested(PayoutMode.STANDARD); payout.setMeanOfPaymentDetails(paymentDetails); PayOut createPayout = mangopay.getPayOutApi().create(payout); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayout); System.out.println(prettyJson); } } ``` ```csharp SCT Inst (no fallback) using MangoPay.SDK; using MangoPay.SDK.Entities; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var bankAccountId = "bankacc_m_01J534QNZZSRCXXAJ1VXP58DDH"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var debitedFunds = new Money { Amount = 2000, Currency = CurrencyIso.EUR }; var fees = new Money { Amount = 50, Currency = CurrencyIso.EUR }; var bankWireRef = "ExampleInvoice1234"; var payout = new PayOutBankWirePostDTO( userId, walletId, debitedFunds, fees, bankAccountId, bankWireRef, PayoutModeRequested.STANDARD ) { Tag = "Created using the Mangopay .NET SDK" }; var createPayout = await api.PayOuts.CreateBankWireAsync(payout); string prettyPrint = JsonConvert.SerializeObject(createPayout, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` ```php SCT Inst (no fallback) Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payout = new \MangoPay\PayOut(); $payout->Tag = 'Created with Mangopay PHP SDK'; $payout->AuthorId = '146476890'; $payout->DebitedFunds = new \MangoPay\Money(); $payout->DebitedFunds->Currency = 'EUR'; $payout->DebitedFunds->Amount = 1000; $payout->Fees = new \MangoPay\Money(); $payout->Fees->Currency = 'EUR'; $payout->Fees->Amount = 0; $payout->DebitedWalletId = '148968396'; $payout->PayoutPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire(); $payout->PayoutPaymentDetails->BankAccountId = '198982485'; $payout->PayoutPaymentDetails->BankWireRef = 'MangopayPHP'; $payout->MeanOfPaymentDetails = $payout->PayoutPaymentDetails; $payout->PaymentType = \MangoPay\PayOutPaymentType::BankWire; $payout->PayoutModeRequested = 'STANDARD'; $response = $api->PayOuts->Create($payout); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```ruby SCT Inst (no fallback) require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def createPayout(payoutObject) begin response = MangoPay::PayOut::BankWire.create(payoutObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create payout: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '146476890', WalletId: '148968396' } myBankAccount = { Id: '154876798' } myPayout = { DebitedWalletId: myUser[:WalletId], PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount[:Id], BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser[:Id], DebitedFunds: { Currency: 'EUR', Amount: 1200, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay Ruby SDK' } createPayout(myPayout) ``` ### RTGS **Request** ```json { "body": { "AuthorId": "user_m_01JKWYDT94N91CW572D7QNNYRP", "BankAccountId": "bankacc_m_01JMCS94W97ZM6XF5HR0KEVSGV", "BankWireRef": "Example123", "DebitedFunds": { "Amount": 1135, "Currency": "EUR" }, "DebitedWalletId": "wlt_m_01JMAAKGM0VCBCQ5V4DB3EZPER", "Fees": { "Amount": 113, "Currency": "EUR" }, "PayoutModeRequested": "RTGS_PAYMENT", "Tag": "Created using Mangopay API Postman Collection" } } ``` **Response** ```json { "Id": "po_m_01JMCS9ED9YTYZBJ3CH0GEMEDS", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1739890932, "AuthorId": "user_m_01JKWYDT94N91CW572D7QNNYRP", "CreditedUserId": null, "DebitedFunds": { "Currency": "EUR", "Amount": 1135 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1022 }, "Fees": { "Currency": "EUR", "Amount": 113 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYOUT", "Nature": "REGULAR", "CreditedWalletId": null, "DebitedWalletId": "wlt_m_01JMAAKGM0VCBCQ5V4DB3EZPER", "PaymentType": "BANK_WIRE", "BankAccountId": null, "BankWireRef": "Example123", "ModeRequested": "RTGS_PAYMENT", "ModeApplied": "PENDING_RESPONSE", "FallbackReason": null, "EndToEndId": "a66784a74c7b4357bbe4f10abccbe411", "PaymentRef": null, "RecipientVerificationOfPayee": null, "RecipientId": "rec_01KF0MPAA8X9C80Q394TSF7MEY" } ``` **SDK Code** ```python RTGS from pprint import pprint import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import BankWirePayOut from mangopay.utils import Money natural_user_id = '213753890' natural_user_wallet_id = '213754077' payout = BankWirePayOut( author_id = natural_user_id, debited_funds = Money(amount=200, currency='EUR'), fees = Money(amount=0, currency='EUR'), debited_wallet_id = natural_user_wallet_id, bank_account_id = '214651521', tag = 'Created using Mangopay Python SDK' ) create_payout = payout.save() pprint(create_payout) ``` ```javascript RTGS const mangopayInstance = require('mangopay4-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myUser = { Id: '146476890', WalletId: '148968396', } let myBankAccount = { Id: '154876798', } let myPayout = { DebitedWalletId: myUser.WalletId, PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount.Id, BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser.Id, DebitedFunds: { Currency: 'EUR', Amount: 12, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay NodeJS SDK', } const createPayout = async (payout) => { return await mangopay.PayOuts.create(payout) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createPayout(myPayout) ``` ```java RTGS import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.PayoutMode; import com.mangopay.entities.PayOut; import com.mangopay.entities.subentities.PayOutPaymentDetailsBankWire; public class CreatePayout { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var bankAccountId = "bankacc_m_01HTJ7P7Y8K9DS5SZ08MDQRHHE"; PayOut payout = new PayOut(); payout.setAuthorId(userId); payout.setDebitedWalletId(walletId); payout.setDebitedFunds(new Money(CurrencyIso.EUR, 500)); payout.setFees(new Money(CurrencyIso.EUR, 0)); PayOutPaymentDetailsBankWire paymentDetails = new PayOutPaymentDetailsBankWire(); paymentDetails.setBankAccountId(bankAccountId); paymentDetails.setPayoutModeRequested(PayoutMode.STANDARD); payout.setMeanOfPaymentDetails(paymentDetails); PayOut createPayout = mangopay.getPayOutApi().create(payout); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayout); System.out.println(prettyJson); } } ``` ```csharp RTGS using MangoPay.SDK; using MangoPay.SDK.Entities; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var bankAccountId = "bankacc_m_01J534QNZZSRCXXAJ1VXP58DDH"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var debitedFunds = new Money { Amount = 2000, Currency = CurrencyIso.EUR }; var fees = new Money { Amount = 50, Currency = CurrencyIso.EUR }; var bankWireRef = "ExampleInvoice1234"; var payout = new PayOutBankWirePostDTO( userId, walletId, debitedFunds, fees, bankAccountId, bankWireRef, PayoutModeRequested.STANDARD ) { Tag = "Created using the Mangopay .NET SDK" }; var createPayout = await api.PayOuts.CreateBankWireAsync(payout); string prettyPrint = JsonConvert.SerializeObject(createPayout, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` ```php RTGS Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payout = new \MangoPay\PayOut(); $payout->Tag = 'Created with Mangopay PHP SDK'; $payout->AuthorId = '146476890'; $payout->DebitedFunds = new \MangoPay\Money(); $payout->DebitedFunds->Currency = 'EUR'; $payout->DebitedFunds->Amount = 1000; $payout->Fees = new \MangoPay\Money(); $payout->Fees->Currency = 'EUR'; $payout->Fees->Amount = 0; $payout->DebitedWalletId = '148968396'; $payout->PayoutPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire(); $payout->PayoutPaymentDetails->BankAccountId = '198982485'; $payout->PayoutPaymentDetails->BankWireRef = 'MangopayPHP'; $payout->MeanOfPaymentDetails = $payout->PayoutPaymentDetails; $payout->PaymentType = \MangoPay\PayOutPaymentType::BankWire; $payout->PayoutModeRequested = 'STANDARD'; $response = $api->PayOuts->Create($payout); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```ruby RTGS require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def createPayout(payoutObject) begin response = MangoPay::PayOut::BankWire.create(payoutObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create payout: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '146476890', WalletId: '148968396' } myBankAccount = { Id: '154876798' } myPayout = { DebitedWalletId: myUser[:WalletId], PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount[:Id], BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser[:Id], DebitedFunds: { Currency: 'EUR', Amount: 1200, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay Ruby SDK' } createPayout(myPayout) ``` ### PAYIN_REFUND **Request** ```json { "body": { "AuthorId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "BankAccountId": "bankacc_m_01JCN1X2EHWG0JNJNPNQ21CW5G", "BankWireRef": "Example123", "DebitedFunds": { "Amount": 24581, "Currency": "EUR" }, "DebitedWalletId": "wlt_m_01J9KR4A7BH8KVE4PG6DTNS817", "Fees": { "Amount": 0, "Currency": "EUR" }, "PaymentRef": { "ReasonType": "PAYIN_REFUND", "ReferenceId": "payin_m_01JCR21X56KVHF7F5TVGYNT9G7" }, "Tag": "Created using Mangopay API Postman Collection" } } ``` **Response** ```json { "Id": "po_b_01JCR32EMBXRWNWRN5KVW2DXE1", "Tag": "Created using Mangopay API Postman Collection", "CreationDate": 1731680352, "AuthorId": "user_m_01JCQYJNHFPENP1SKTCBYER0F8", "CreditedUserId": null, "DebitedFunds": { "Currency": "EUR", "Amount": 24581 }, "CreditedFunds": { "Currency": "EUR", "Amount": 24581 }, "Fees": { "Currency": "EUR", "Amount": 0 }, "Status": "CREATED", "ResultCode": null, "ResultMessage": null, "ExecutionDate": null, "Type": "PAYOUT", "Nature": "REGULAR", "CreditedWalletId": null, "DebitedWalletId": "wlt_m_01J9KR4A7BH8KVE4PG6DTNS817", "PaymentType": "BANK_WIRE", "BankAccountId": null, "BankWireRef": "Example123", "ModeRequested": null, "ModeApplied": "STANDARD", "FallbackReason": null, "EndToEndId": "2da75c747abf4fbd83d6fd746d63fad4", "PaymentRef": { "ReasonType": "PAYIN_REFUND", "ReferenceId": "payin_m_01JCR21X56KVHF7F5TVGYNT9G7" }, "RecipientVerificationOfPayee": null, "RecipientId": "rec_01KF0MPAA8X9C80Q394TSF7MEY" } ``` **SDK Code** ```python PAYIN_REFUND from pprint import pprint import mangopay mangopay.client_id='your-client-id' mangopay.apikey='your-api-key' from mangopay.api import APIRequest handler = APIRequest(sandbox=True) from mangopay.resources import BankWirePayOut from mangopay.utils import Money natural_user_id = '213753890' natural_user_wallet_id = '213754077' payout = BankWirePayOut( author_id = natural_user_id, debited_funds = Money(amount=200, currency='EUR'), fees = Money(amount=0, currency='EUR'), debited_wallet_id = natural_user_wallet_id, bank_account_id = '214651521', tag = 'Created using Mangopay Python SDK' ) create_payout = payout.save() pprint(create_payout) ``` ```javascript PAYIN_REFUND const mangopayInstance = require('mangopay4-nodejs-sdk') const mangopay = new mangopayInstance({ clientId: 'your-client-id', clientApiKey: 'your-api-key', }) let myUser = { Id: '146476890', WalletId: '148968396', } let myBankAccount = { Id: '154876798', } let myPayout = { DebitedWalletId: myUser.WalletId, PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount.Id, BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser.Id, DebitedFunds: { Currency: 'EUR', Amount: 12, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay NodeJS SDK', } const createPayout = async (payout) => { return await mangopay.PayOuts.create(payout) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createPayout(myPayout) ``` ```java PAYIN_REFUND import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.core.Money; import com.mangopay.core.enumerations.CurrencyIso; import com.mangopay.core.enumerations.PayoutMode; import com.mangopay.entities.PayOut; import com.mangopay.entities.subentities.PayOutPaymentDetailsBankWire; public class CreatePayout { public static void main(String[] args) throws Exception { MangoPayApi mangopay = new MangoPayApi(); mangopay.getConfig().setClientId("your-client-id"); mangopay.getConfig().setClientPassword("your-api-key"); var userId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var walletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var bankAccountId = "bankacc_m_01HTJ7P7Y8K9DS5SZ08MDQRHHE"; PayOut payout = new PayOut(); payout.setAuthorId(userId); payout.setDebitedWalletId(walletId); payout.setDebitedFunds(new Money(CurrencyIso.EUR, 500)); payout.setFees(new Money(CurrencyIso.EUR, 0)); PayOutPaymentDetailsBankWire paymentDetails = new PayOutPaymentDetailsBankWire(); paymentDetails.setBankAccountId(bankAccountId); paymentDetails.setPayoutModeRequested(PayoutMode.STANDARD); payout.setMeanOfPaymentDetails(paymentDetails); PayOut createPayout = mangopay.getPayOutApi().create(payout); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createPayout); System.out.println(prettyJson); } } ``` ```csharp PAYIN_REFUND using MangoPay.SDK; using MangoPay.SDK.Entities; using MangoPay.SDK.Entities.POST; using MangoPay.SDK.Core.Enumerations; using Newtonsoft.Json; class Program { static async Task Main(string[] args) { MangoPayApi api = new MangoPayApi(); api.Config.ClientId = "your-client-id"; api.Config.ClientPassword = "your-api-key"; var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN"; var bankAccountId = "bankacc_m_01J534QNZZSRCXXAJ1VXP58DDH"; var walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3"; var debitedFunds = new Money { Amount = 2000, Currency = CurrencyIso.EUR }; var fees = new Money { Amount = 50, Currency = CurrencyIso.EUR }; var bankWireRef = "ExampleInvoice1234"; var payout = new PayOutBankWirePostDTO( userId, walletId, debitedFunds, fees, bankAccountId, bankWireRef, PayoutModeRequested.STANDARD ) { Tag = "Created using the Mangopay .NET SDK" }; var createPayout = await api.PayOuts.CreateBankWireAsync(payout); string prettyPrint = JsonConvert.SerializeObject(createPayout, Formatting.Indented); Console.WriteLine(prettyPrint); } } ``` ```php PAYIN_REFUND Config->ClientId = 'your-client-id'; $api->Config->ClientPassword = 'your-api-key'; $api->Config->TemporaryFolder = 'tmp/'; try { $payout = new \MangoPay\PayOut(); $payout->Tag = 'Created with Mangopay PHP SDK'; $payout->AuthorId = '146476890'; $payout->DebitedFunds = new \MangoPay\Money(); $payout->DebitedFunds->Currency = 'EUR'; $payout->DebitedFunds->Amount = 1000; $payout->Fees = new \MangoPay\Money(); $payout->Fees->Currency = 'EUR'; $payout->Fees->Amount = 0; $payout->DebitedWalletId = '148968396'; $payout->PayoutPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire(); $payout->PayoutPaymentDetails->BankAccountId = '198982485'; $payout->PayoutPaymentDetails->BankWireRef = 'MangopayPHP'; $payout->MeanOfPaymentDetails = $payout->PayoutPaymentDetails; $payout->PaymentType = \MangoPay\PayOutPaymentType::BankWire; $payout->PayoutModeRequested = 'STANDARD'; $response = $api->PayOuts->Create($payout); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ``` ```ruby PAYIN_REFUND require 'mangopay' MangoPay.configure do |client| client.preproduction = true client.client_id = 'your-client-id' client.client_apiKey = 'your-api-key' client.log_file = File.join(Dir.pwd, 'mangopay.log') end def createPayout(payoutObject) begin response = MangoPay::PayOut::BankWire.create(payoutObject) puts response return response rescue MangoPay::ResponseError => error puts "Failed to create payout: #{error.message}" puts "Error details: #{error.details}" return false end end myUser = { Id: '146476890', WalletId: '148968396' } myBankAccount = { Id: '154876798' } myPayout = { DebitedWalletId: myUser[:WalletId], PaymentType: 'BANK_WIRE', BankAccountId: myBankAccount[:Id], BankWireRef: 'Mangopay Ref', PayoutModeRequested: 'STANDARD', AuthorId: myUser[:Id], DebitedFunds: { Currency: 'EUR', Amount: 1200, }, Fees: { Currency: 'EUR', Amount: 0, }, Tag: 'Created using Mangopay Ruby SDK' } createPayout(myPayout) ```