Skip to main content

Balance Exchange

The Balance Exchange API enables merchants to programmatically transfer funds between different currency accounts within their Skrill merchant account. This tool provides the same functionality available through the Skrill Business Portal, allowing you to streamline currency conversions and fund transfers without manual intervention.

Business Benefits

  • Automated Currency Management: Eliminate manual currency conversions and transfers
  • Real-time Exchange Rates: Access current FX rates with guaranteed validity periods
  • Reduced Operational Costs: Minimize manual processing and administrative overhead
  • Enhanced Cash Flow Management: Optimize fund allocation across different currency accounts
  • Integration Flexibility: Seamlessly integrate with existing business systems and workflows

Prerequisites

Before implementing the Balance Exchange API, ensure you have:

  1. Enabled Automated Payment Interface: API access must be activated on your account
  2. API/MQI Password: A secure password specifically configured for API access
  3. Valid Currency Accounts: At least two currency accounts with sufficient balances

Technical Specifications

API Endpoint

  • Base URL: https://www.skrill.com/app/exchange
  • Protocol: HTTPS only
  • Authentication: Email and MD5-hashed password

Supported Request Methods

  • GET: URL-encoded parameters
  • POST (application/x-www-form-urlencoded): Form-encoded data
  • POST (multipart/form-data): Multipart form data

Response Formats

  • Default: JSON responses
  • Alternative: XML responses (specify Accept: application/xml header)

Exchange Process Workflow

The Balance Exchange API follows a three-step process designed for security and reliability:

  1. Preview (Optional): Calculate exchange rates and amounts without executing the transfer
  2. Prepare: Generate a secure session ID for the exchange transaction
  3. Exchange: Execute the actual fund transfer using the session ID

API Parameters

Required Parameters

ParameterPreviewPrepareExchangeDescriptionExample
actionSpecifies the operation to perform. Must be one of: preview, prepare, or exchangepreview
emailThe email address associated with your Skrill merchant accountmerchant@company.com
passwordmd5Hex-hashed version of your API/MQI password.5d41402abc4b2a76b9719d911017c592
fromAccountIdUnique identifier of the source currency account. Use Get Balances API to retrieve account IDs5008285931
toAccountIdUnique identifier of the destination currency account. Must be different from fromAccountId5025309388
amountThe amount to exchange. Must be positive with maximum 6 decimal places100.50
currency⚠️⚠️Currency code for the exchange. Must match either source or destination account currency. Determines which account pays FX feesEUR
sidSession ID returned from the prepare step. Valid for 15 minutes2e9c42f8ece2a64f698042328db96468
info

You can get the fromAccountId and toAccountId for each currency account along with their available balance using the Get Balances MQI Action

Parameter Details

Currency Parameter Logic

The currency parameter determines the base currency for the exchange and affects fee allocation:

  • If currency matches fromAccountId currency: FX fees are deducted from the destination account (toAccountId)
  • If currency matches toAccountId currency: FX fees are deducted from the source account (fromAccountId)
  • If currency is omitted: Defaults to the source account currency (fromAccountId)

Amount Precision

  • Maximum precision: 6 decimal places
  • Minimum amount: 0.01 (varies by currency)
  • Must be a positive number

Session Management

  • Session IDs (sid) are valid for 15 minutes after generation
  • Each session ID can only be used once for exchange execution

API Actions

The Balance Exchange API provides three distinct actions that work together to ensure secure and reliable fund transfers.

Preview Action

The preview action allows you to calculate exchange rates and amounts without executing any actual transfers. This is particularly useful for:

  • Rate Discovery: Check current exchange rates before committing to a transfer
  • Amount Calculation: Verify the exact amounts that will be transferred
  • Cost Analysis: Understand FX fees and total costs before execution

Example Request

The following examples demonstrate how to preview a currency exchange of 1.000 EUR to USD:

curl "https://www.skrill.com/app/exchange?action=preview&email=merchant@company.com&password=5d41402abc4b2a76b9719d911017c592&fromAccountId=5008285930&toAccountId=5025309388&amount=1000&currency=EUR"

Example Response

The preview response provides detailed information about the proposed exchange:

{
"transaction": {
"fromAccountCurrency": "EUR",
"fromAccountAmount": 1000.000000,
"toAccountCurrency": "USD",
"toAccountAmount": 1085.500000,
"skrillExchangeFxRate": 1.085500,
"fxValidUntil": 1748444198000
}
}

Response Field Descriptions

FieldDescriptionExample
fromAccountCurrencyCurrency code of the source accountEUR
fromAccountAmountAmount to be deducted from source account1000.000000
toAccountCurrencyCurrency code of the destination accountUSD
toAccountAmountAmount to be credited to destination account1085.500000
skrillExchangeFxRateExchange rate applied for the conversion1.085500
fxValidUntilUnix timestamp indicating rate validity expiration1748444198000

Rate Validity Guarantee

The fxValidUntil field (fx_valid_until in XML) is a Unix timestamp indicating the validity window of the exchange rate. Skrill guarantees that the FX rate provided in the preview response will be applied during the exchange step only if the following conditions are met:

  • The fromAccountId, toAccountId, and currency parameters remain unchanged between preview and prepare steps
  • The exchange step is executed before the fxValidUntil timestamp expires
  • The exchange amount remains the same
Rate Validity Period

The current validity period is 5 minutes. If the prepare step is performed after fxValidUntil, the FX rate may differ from the one shown in the preview step, as the current market rate at that time will be used instead.

Prepare Action

The prepare action generates a secure session ID that must be used in the subsequent exchange step. This two-step process ensures transaction security and prevents unauthorized exchanges.

Key Features:

  • Session Generation: Creates a unique, time-limited session ID
  • Parameter Validation: Validates all exchange parameters before execution
  • Security Layer: Adds an additional security checkpoint before fund transfer
  • Rate Locking: Locks in the exchange rate (if preview was used within validity period)
Session Management
  • Session IDs expire after 15 minutes
  • Each session ID can only be used once

Example Request

Prepare the exchange with the same parameters used in the preview:

curl "https://www.skrill.com/app/exchange?action=prepare&email=merchant@company.com&password=5d41402abc4b2a76b9719d911017c592&fromAccountId=5008285930&toAccountId=5025309388&amount=1000&currency=EUR"

Example Response

{
"sid": "1e8ff8f16ec19b7f337e03cde2f1692f"
}

Exchange Action

The exchange action executes the actual fund transfer between accounts using the session ID obtained from the prepare step. This is the final step that completes the currency exchange process.

Important Considerations:

  • One-time Use: Each session ID can only be used once
  • Irreversible: Once an exchange has been executed, it cannot be reversed. A new exchange must be initiated if changes are required.
  • Immediate Processing: Funds are transferred immediately upon successful execution

Example Request

Execute the exchange using the session ID from the prepare step:

curl "https://www.skrill.com/app/exchange?action=exchange&sid=1e8ff8f16ec19b7f337e03cde2f1692f"

Example Response

The exchange response confirms the successful completion of the fund transfer:

{
"transaction": {
"status": 2,
"statusMsg": "processed",
"mbTransactionId": 5098434837,
"fromAccountCurrency": "EUR",
"fromAccountAmount": 1000.000000,
"toAccountCurrency": "USD",
"toAccountAmount": 1085.500000,
"skrillExchangeFxRate": 1.085500
}
}

Response Field Descriptions

FieldDescriptionExample
statusTransaction status code2
statusMsgHuman-readable status messageprocessed
mbTransactionIdSkrill's internal transaction id5098434837
fromAccountCurrencyCurrency code of the source accountEUR
fromAccountAmountAmount deducted from source account1000.000000
toAccountCurrencyCurrency code of the destination accountUSD
toAccountAmountAmount credited to destination account1085.500000
skrillExchangeFxRateExchange rate applied for the conversion1.085500

Error Categories

Authentication Errors

Error CodeDescriptionAffects ActionsResolution
INVALID_LOGINMissing username or password parameterspreview, prepareInclude both email and password parameters
INVALID_EMAILInvalid email formatpreview, prepareVerify email format and ensure it matches your merchant account
INVALID_PASSWORDPassword exceeds maximum lengthpreview, prepareEnsure password is MD5-hashed and within length limits
CANNOT_LOGINIncorrect email or passwordpreview, prepareVerify credentials and ensure API access is enabled

Parameter Validation Errors

Error CodeDescriptionAffects ActionsResolution
INVALID_OR_MISSING_ACTIONInvalid or missing action parameterAll actionsUse one of: preview, prepare, exchange
MISSING_AMOUNTAmount parameter is missingpreview, prepareInclude the amount parameter
INVALID_AMOUNTInvalid amount (zero, negative, or excessive precision)preview, prepareUse positive amounts with max 6 decimal places
MISSING_FROM_ACCOUNT_IDSource account ID is missingpreview, prepareInclude valid fromAccountId parameter
INVALID_FROM_ACCOUNT_IDInvalid source account ID formatpreview, prepareUse numeric account ID from Get Balances API
MISSING_TO_ACCOUNT_IDDestination account ID is missingpreview, prepareInclude valid toAccountId parameter
INVALID_TO_ACCOUNT_IDInvalid destination account ID formatpreview, prepareUse numeric account ID from Get Balances API
INVALID_CURRENCYInvalid currency codepreview, prepareUse valid ISO currency codes
FROM_ACCOUNT_ID_MUST_BE_DIFFERENT_THAN_TO_ACCOUNT_IDSource and destination accounts are the samepreview, prepareUse different account IDs for source and destination

Business Logic Errors

Error CodeDescriptionAffects ActionsResolution
ACCOUNT_ID_DOES_NOT_BELONG_TO_CUSTOMERAccount doesn't belong to merchantpreview, prepareVerify account IDs belong to your merchant account
CURRENCY_MUST_BE_THE_SAME_AS_ACCOUNT_CURRENCYCurrency doesn't match account currenciespreview, prepareUse currency that matches either source or destination account
NOT_ENOUGH_BALANCEInsufficient funds in source accountAll actionsCheck account balance and reduce amount

Session Management Errors

Error CodeDescriptionAffects ActionsResolution
SESSION_EXPIREDSession ID has expired (15 minutes)exchangeGenerate new session ID using prepare action
EXECUTION_PENDINGExchange is still processingexchangeWait for completion or check status

System Errors

Error CodeDescriptionAffects Actions
GENERIC_ERRORUnexpected system errorAll actions

Error Response Examples

JSON Error Response

{
"error": {
"message": "INVALID_CURRENCY"
}
}

XML Error Response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<error>
<error_msg>INVALID_CURRENCY</error_msg>
</error>
</response>