# Create a Transfer source: https://developer.mastercard.com/mastercard-send-funding/documentation/use-cases/create-transfer/index.md ## Create a Transfer {#create-a-transfer} This example flow shows how you use a **Funding API POST** request to create a funding transfer. For details of using the API and sample requests and responses, see [API Reference](https://developer.mastercard.com/mastercard-send-funding/documentation/api-reference/index.md). ### Example sequence {#example-sequence} Diagram mastercard-send-sequence-funding-post 1. You send a [Funding API POST](https://developer.mastercard.com/mastercard-send-funding/documentation/api-reference/index.md) request to Mastercard Send, including a unique `transfer_reference` value that you generated for this transaction, for example 'fun_000001328'. API endpoint: `.../v1/partners/{partnerId}/transfers/funding` Example: `.../v1/partners/ptnr_BEeCrYJHh2BXTXPy_PEtp-8DBOo/transfers/funding` Your request can include a `decline_details` query parameter that determines the type of API response when a transfer is declined. If set to 'true', a decline will be a 201 response with extra details. Otherwise, it will be a 402 error message. This example is a 'Transfer to Own Staged Digital Wallet Account' for $100 USD, so the request payload might start as follows: * JSON * XML ```JSON { "funding_transfer": { "transfer_reference": "fun_000001328", "payment_type": "SWL", "amount": "10000", "currency": "USD", ... ``` ```XML fun_000001328 SWL 10000 USD ... ``` See the endpoint structure: API Reference: `POST /v1/partners/{partnerId}/transfers/funding`
2. Mastercard Send validates your API request and checks the values against settings applicable to your implementation. If the API request fails validation, Mastercard Send stops processing the request and returns a 4xx error message with the appropriate [error code](https://developer.mastercard.com/mastercard-send-funding/documentation/response-error-codes/error-codes/index.md). 3. If your API request passes the validation and checks, Mastercard routes a Funding Transaction request message to the issuer that holds the sending account. 4. The issuer validates the request, determines whether it approves the transaction, and includes its decision in a Funding Transaction response message to Mastercard. 5. If the issuer approves the transaction, it debits the sending account. 6. Mastercard processes the response and sends a Funding API response to you. The API response depends on the [transfer status](https://developer.mastercard.com/mastercard-send-funding/documentation/response-error-codes/status/index.md): | Status | Response type | |--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Approved (success) | 201 response with `status` value as 'APPROVED'. | | Declined | If `decline_details` query parameter was set to 'true': 201 response with `status` value as 'DECLINED'. Some `transaction` array values indicate the decline reason, see [Network Response Codes](https://developer.mastercard.com/mastercard-send-funding/documentation/response-error-codes/network-response-codes/index.md). Otherwise: 402 error with `ReasonCode` as 'DECLINE'. | | Unknown | 202 response with `status` value as 'UNKNOWN', see [this guidance](https://developer.mastercard.com/mastercard-send-funding/documentation/tutorials-and-guides/exception-management/index.md#procedure-when-transaction-status-unknown-or-pending). | 201 and 202 responses include: * `id` = A system-generated Transfer ID for the funding transfer, for example 'trn_1357924680', which can be used to retrieve its details. * `transaction_history.data.transaction[].id` = A Transaction ID for the associated Funding Transaction, for example 'txn_A9B8C7D6E5F4G3H2'. If you need to reverse an approved funding transfer, you will need to provide its Transfer ID and Transaction ID. If you receive a 202 or 402 response, you can do a GET call after a few seconds to [retrieve](https://developer.mastercard.com/mastercard-send-funding/documentation/use-cases/retrieve-transfer/index.md) the latest transfer status and more details.