Note: Replace YOUR_ACCESS_TOKEN with a valid access token when making requests.
Learn more about Authorization
/api/vouchers/buy/infoThis endpoint retrieves information needed for purchasing a voucher, including the calculated amount to be charged from the wallet with the commission fee applied. The response helps users understand the total cost before proceeding with the actual voucher purchase.
Important Notes:
USD Wallets Only: Only USD wallets are allowed for voucher purchases. Ensure your wallet currency is USD before making the request.
User Authorization: Valid bearer token is required. The user must not be blocked.
Minimum/Maximum Limits: Voucher amounts must be within the allowed range based on currency settings and application limits.
Commission Calculation: The system calculates commission based on user type (partner or merchant) and applies different fee percentages accordingly.
Balance Verification: The wallet must have sufficient funds to cover both the voucher amount and the commission fee.
POSThttps://api.money-go.com/api/vouchers/buy/infoAuthorization: Bearer YOUR_ACCESS_TOKENContent-Type: application/json
Note: Replace YOUR_ACCESS_TOKEN with a valid access token when making requests.
Learn more about Authorization
The following JSON body must be sent with the POST request:
{ "voucher_amount": 100.00, "wallet_from": "U123456"}| Field | Type | Required | Description |
|---|---|---|---|
| voucher_amount | number | Yes | The desired voucher amount in USD. |
| wallet_from | string | Yes | Your USD wallet number from which funds will be debited. |
curl -X POST "https://api.money-go.com/api/vouchers/buy/info" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "voucher_amount": 100.00, "wallet_from": "U123456" }'<?php$url = "https://api.money-go.com/api/vouchers/buy/info";$data = [ "voucher_amount" => 100.00, "wallet_from" => "U123456"];
$options = [ 'http' => [ 'header' => [ "Authorization: Bearer YOUR_ACCESS_TOKEN", "Content-Type: application/json" ], 'method' => 'POST', 'content' => json_encode($data) ]];
$context = stream_context_create($options);$result = file_get_contents($url, false, $context);
if ($result === FALSE) { die('Error occurred while fetching voucher buy info');}
$response = json_decode($result, true);print_r($response);import fetch from 'node-fetch';
interface VoucherBuyInfoRequest { voucher_amount: number; wallet_from: string;}
async function getVoucherBuyInfo(): Promise<void> { const url = "https://api.money-go.com/api/vouchers/buy/info"; const requestData: VoucherBuyInfoRequest = { voucher_amount: 100.00, wallet_from: "U123456" };
try { const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify(requestData) });
if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); }
const data = await response.json(); console.log("Voucher Buy Info:", data); } catch (error) { console.error("Error fetching voucher buy info:", error); }}
getVoucherBuyInfo();{ "voucher_amount": 100.00, "voucher_currency": "USD", "fee_percent": 2.5, "wallet_amount": 102.50, "wallet_currency": "USD"}| Field | Type | Description |
|---|---|---|
| voucher_amount | number | The voucher amount (rounded according to ISO mathematical rules) |
| voucher_currency | string | The voucher currency (always “USD”) |
| fee_percent | number | The commission percentage charged by MoneyGo |
| wallet_amount | number | Total amount to be debited from wallet (voucher + commission) |
| wallet_currency | string | The currency of the wallet (should match voucher currency) |
When a POST request is made to the /api/vouchers/buy/info endpoint, the API may return error responses with HTTP status codes 401 or 422 if any validation fails. Below is a table summarizing the possible error responses:
| Error Code | Error Message | Description |
|---|---|---|
| 401 | Unauthorized | Missing or invalid bearer token. |
| 422 | Buy voucher disabled | Voucher purchase is currently disabled. |
| 422 | User is blocked | The user account is blocked. Please check the “translation” field for more details (e.g., "server_error.sender_account_is_blocked"). |
| 422 | Wallet from not exists | The source wallet (wallet_from) does not exist or is inactive (e.g., deleted or in status NEW) or Insufficient balance. |
| 422 | Only USD wallet allowed | Only USD wallets are allowed for voucher purchase. |
| 422 | Min amount | Minimum amount constraint violated for voucher_amount. |
| 422 | Max amount | Maximum amount constraint violated for voucher_amount. |
is_blocked = 0)max_voucher_amount from application limits
Important: This endpoint only provides calculation information. To actually purchase a voucher, you’ll need to use a separate voucher purchase endpoint after reviewing the costs presented by this endpoint.