> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mangopay.com/api-reference/conversions/create-quoted-conversion-user-wallets/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server. # Create a Quoted Conversion between user Wallets POST https://api.sandbox.mangopay.com/v2.01/{ClientId}/conversions/quoted-conversion Content-Type: application/json This call triggers a conversion at the rate defined in its quote. The debited funds (sell currency), credited funds (buy currency), and amounts are defined in the quote. Each quoted conversion requires a dedicated [Quote](/api-reference/quotes/quote-object) object, linked in the `QuoteId`. Reference: https://docs.mangopay.com/api-reference/conversions/create-quoted-conversion-user-wallets ## 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 CreateAQuotedConversionBetweenUserWalletsRequest. - `QuoteId` (string, required) — The unique identifier of the active quote which guaranteed the rate for the conversion. - `AuthorId` (string, required) — The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. - `DebitedWalletId` (string, required) — The unique identifier of the debited wallet (in the sell currency). - `CreditedWalletId` (string, required) — The unique identifier of the credited wallet (in the buy currency). - `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}"`. ## 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. - `QuoteId` (string, optional, nullable) — The unique identifier of the active quote which guaranteed the rate for the conversion. Returned `null` in the case of an instant conversion. - `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. - `CreationDate` (integer, optional) — Unix timestamp (UTC) of the date and time the object was created. - `Status` (string, optional) — **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED` The status of the transaction. - `AuthorId` (string, optional) — The unique identifier of the user at the source of the transaction. In a conversion, both the debited and credited wallets are owned by the author. - `DebitedWalletId` (string, optional) — The unique identifier of the debited wallet (in the sell currency). - `CreditedWalletId` (string, optional) — The unique identifier of the credited wallet (in the buy currency). - `DebitedFunds` (CreateAQuotedConversionBetweenUserWalletsResponseDebitedFunds, optional) — Information about the debited funds. - `CreditedFunds` (CreateAQuotedConversionBetweenUserWalletsResponseCreditedFunds, optional) — Information about the credited funds. - `Fees` (Fees_ConversionResponse, optional) — Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. - `RequestedFees` (RequestedFees_Conversion, optional) — Information about the `Fees` sent in the 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. - `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`. - `ConversionRateResponse` (ConversionRateResponse, optional) — Information about the `MarketRate` used to convert funds and other indicative rates. - `MarginsResponse` (MarginsResponse, optional) — Information about the margins calculated for the transaction. - `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}"`. ## 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 ### CreateAQuotedConversionBetweenUserWalletsResponseDebitedFunds 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) — An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`). During a conversion, (`DebitedFunds.Amount` - `Fees`) * `MarketRate` = `CreditedFunds.Amount`. ### CreateAQuotedConversionBetweenUserWalletsResponseCreditedFunds Information about the credited 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) — An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`). During a conversion, `CreditedFunds.Amount` = (`DebitedFunds.Amount` - `Fees`) * `MarketRate`. ### Fees_ConversionResponse Information about the fees taken by the platform for this transaction (and hence transferred to the Fees Wallet). **Note:** The fees currency must match the debited funds currency. - `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`. ### RequestedFees_Conversion Information about the `Fees` sent in the request. - `Type` (string, optional) — **Allowed values:** `PERCENTAGE`, `FIXED` **Default value:** `FIXED` The type of the `Value`. - `Value` (integer, optional) — The value to be used for the `Type`: - `PERCENTAGE` – In quantities of 0.1% (e.g. `150` equals 1.5%), the percentage of `DebitedFunds.Amount` deducted as fees. - `FIXED` – The amount deducted from `DebitedFunds.Amount` as fees, as an amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`). - `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 fees, which must match the debited currency. ### ConversionRateResponse Information about the `MarketRate` used to convert funds and other indicative rates. - `ClientRate` (double, optional) — Max. 7 decimal places The indicative rate including Mangopay's markup, used during the billing cycle: `ClientRate` = `MarketRate` * (1 - `MarginsResponse.Mangopay`). The `MarginsResponse.Mangopay.Amount` gives the amount of debited currency that will be billed by Mangopay to your platform for the transaction. The `ClientRate` fluctuates in line with the `MarketRate`. - `MarketRate` (double, optional) — Max. 7 decimal places The rate used to convert funds during the conversion: (`DebitedFunds.Amount` - `Fees`) * `MarketRate` = `CreditedFunds.Amount`. The market rate fluctuates in line with FX market dynamics and is common to all platforms for the currency pair. - `FinalRate` (double, optional) — Max. 7 decimal places The indicative rate including the `UserMargin`, if your platform defined it in the request or the quote: `FinalRate` = `ClientRate` * (1 - `MarginsResponse.User`). The `MarginsResponse.User.Amount` gives the amount of debited currency that your platform could bill to the user for the transaction. If no `UserMargin` was included, the `FinalRate` is the same as the `ClientRate`. ### MarginsResponse Information about the margins calculated for the transaction. - `Mangopay` (MarginsResponseMangopay, optional) — The margin used by Mangopay to bill your platform (which is defined during contracting). - `User` (MarginsResponseUser, optional) — The margin your platform could use to bill the user, as calculated by `UserMargin` in the request or quote (otherwise `null` if not set). ### MarginsResponseMangopay The margin used by Mangopay to bill your platform (which is defined during contracting). - `Type` (string, optional) — **Response value:** `PERCENTAGE` The type of the `Value`, which for Mangopay is always `PERCENTAGE`. - `Value` (double, optional) — The value to be used for the `Type`. Mangopay's markup is expressed as a percentage (to convert to decimal, divide by 100). - `Amount` (integer, optional) — The amount of debited currency that Mangopay will charge your platform for the transaction during the billing cycle. ### MarginsResponseUser The margin your platform could use to bill the user, as calculated by `UserMargin` in the request or quote (otherwise `null` if not set). - `Type` (string, optional) — **Response values:** `PERCENTAGE`, `PIP` The type of the `Value`. - `Value` (double, optional) — The value to be used for the `Type`: - `PERCENTAGE` – The quantities of 1% used to calculate the user margin. - `PIP` – The quantities of `0.0001` (one pip) used to calculate the user margin. - `Amount` (integer, optional) — The amount of debited currency that your platform could bill to the user for the transaction. ## Examples **Request** ```json { "body": { "AuthorId": "204071581", "CreditedWalletId": "209408867", "DebitedWalletId": "204079338", "QuoteId": "cvrquote_01HP1H6EK4H39SCQ8WJ349WMBB", "Tag": "Created using the Mangopay API Postman collection" } } ``` **Response** ```json { "Id": "cvr_01KH3JAVX32DNZ2141BFMERP5V", "QuoteId": "cvrquote_01KH3J69K96FXNMQ875PTDJ13A", "Type": "CONVERSION", "Nature": "REGULAR", "CreationDate": 1770720161, "Status": "SUCCEEDED", "AuthorId": "user_m_01KGHXXFF6AQZA68MESVQVY7RA", "DebitedWalletId": "wlt_m_01KGSJDM69VNXPKKGH1B3QFVFC", "CreditedWalletId": "wlt_m_01KGSJ7GQY0P12EBB6XFAC866C", "DebitedFunds": { "Currency": "GBP", "Amount": 1000 }, "CreditedFunds": { "Currency": "EUR", "Amount": 1067 }, "Fees": { "Currency": "GBP", "Amount": 70 }, "RequestedFees": { "Type": "PERCENTAGE", "Value": 700, "Currency": "GBP" }, "ResultCode": "000000", "ResultMessage": "Success", "ExecutionDate": 1770720162, "ConversionRateResponse": { "ClientRate": 1.1360925, "MarketRate": 1.1471047, "FinalRate": 1.1190511 }, "MarginsResponse": { "Mangopay": { "Type": "PERCENTAGE", "Value": 0.96, "Amount": 10 }, "User": { "Type": "PERCENTAGE", "Value": 1.5, "Amount": 16 } }, "Tag": "Created using the Mangopay API Postman collection" } ``` **SDK Code** ```javascript const mangopayInstance = require('mangopay4-nodejs-sdk'); const mangopay = new mangopayInstance({ clientId: "client-id", clientApiKey: "api-key" }) let myConversion = { QuoteId: "cvrquote_01JDHAEJF2QRC0MZ6WTJHETDQZ", AuthorId: "user_m_01HQK25M6KVHKDV0S36JY9NRKR", DebitedWalletId: "wlt_m_01HT2J9Q2M6GMFW4Z7GYBAFJ4T", CreditedWalletId: "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV", Tag: "Created using the Mangopay NodeJS SDK" } const createQuotedUserConversion = async (conversion) => { return await mangopay.Conversions.createQuotedConversion(conversion) .then((response) => { console.info(response) return response }) .catch((err) => { console.log(err) return false }) } createQuotedUserConversion(myConversion) ``` ```java import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.mangopay.MangoPayApi; import com.mangopay.entities.Conversion; import com.mangopay.entities.CreateQuotedConversion; public class CreatingQuotedConversion { 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 debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; var debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; var creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; var quoteId = "cvrquote_01J1YPZQXF6A5AAG7YCZAM9D9N"; CreateQuotedConversion quotedConversion = new CreateQuotedConversion(); quotedConversion.setQuoteId(quoteId); quotedConversion.setAuthorId(debitedUserId); quotedConversion.setDebitedWalletId(debitedWalletId); quotedConversion.setCreditedWalletId(creditedWalletId); quotedConversion.setTag("Created using the Mangopay Java SDK"); Conversion createQuotedConversion = mangopay.getConversionsApi().createQuotedConversion(quotedConversion, null); Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create(); String prettyJson = prettyPrint.toJson(createQuotedConversion); System.out.println(prettyJson); } } ``` ```php Config->ClientId = 'client-id'; $api->Config->ClientPassword = 'api-key'; $api->Config->TemporaryFolder = '../tmp/'; $api->Config->DebugMode = false; try { $quotedConversion = new \MangoPay\Conversion(); $debitedUserId = "user_m_01HQK25M6KVHKDV0S36JY9NRKR"; $debitedWalletId = "wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV"; $creditedWalletId = "wlt_m_01HQT6422EER2N7FPRXWTSDCSV"; $quoteId = "cvrquote_01JE92SJATA0X9YXNXKP9N1VFT"; $quotedConversion->QuoteId = $quoteId; $quotedConversion->AuthorId = $debitedUserId; $quotedConversion->DebitedWalletId = $debitedWalletId; $quotedConversion->CreditedWalletId = $creditedWalletId; $quotedConversion->Tag = "Created using the Mangopay PHP SDK"; $response = $api->Conversions->CreateQuotedConversion($quotedConversion); print_r($response); } catch(MGPResponseException $e) { print_r($e); } catch(MGPException $e) { print_r($e); } ```