1. Currency Exchange
Partner API
  • Getting Started
    • Introduction
    • Authentication
    • Business Use Cases
  • API References
    • Balances & History
      • Get Balances
      • Get Balance History
    • Crypto Deposits
      • Get Crypto Deposit Details
      • Add Travel Rule
    • Crypto Withdrawals
      • Get Whitelisted Wallets
      • Add Whitelisted Wallet
      • Delete Whitelisted Wallet
      • Create Crypto Withdrawal
      • Get Crypto Withdrawal Details
    • SEPA Deposits
      • Get SEPA Payment Details
      • Get SEPA Deposit Details
    • SEPA Withdrawals
      • Create SEPA Withdrawal
      • Get SEPA Withdrawal Details
    • Currency Exchange
      • Get Rates
        GET
      • Create Lock
        POST
      • Create Exchange
        POST
      • Get Exchange Details
        GET
  • Integration
    • Integration Guides
    • Transaction Processing
    • Error Handling
    • Rate Limiting
    • Webhooks
      • Crypto Deposit Webhook
      • Crypto Withdrawal Webhook
      • SEPA Deposit Webhook
      • SEPA Withdrawal Webhook
      • Exchange Webhook
  • Reference
    • Supported Currencies
    • Fees
    • FAQ
    • Changelog
    • Support
  1. Currency Exchange

Create Lock

Testing Env
http://k8s-partnera-partnera-7873f15634-69ebb7c047cac3d1.elb.eu-central-1.amazonaws.com
Testing Env
http://k8s-partnera-partnera-7873f15634-69ebb7c047cac3d1.elb.eu-central-1.amazonaws.com
POST
/v1/partner/lock
Locks the current exchange rates of all supported currencies. Use the returned lockId in Create Exchange to execute an exchange at the locked rates.

Lock#

The request has no body.
A lock is valid until validUntil (about 45 seconds). Rely on validUntil, not on a fixed duration.
A lock can be used only once. If it expires, create a new one.

Calculating the exchange result#

Before executing the exchange, you can calculate its exact result from the locked rates:
1.
rate = rates[sourceCurrency] / rates[destinationCurrency]
2.
totalDestinationAmount = sourceAmount * rate, rounded down to the precision of the destination currency.
3.
fee = totalDestinationAmount * feePercent, rounded down to the precision of the destination currency, where feePercent is exchange.feePercent of the source balance (see Get Balances).
4.
destinationAmount = totalDestinationAmount - fee - the amount credited to the destination balance.
The response of Create Exchange returns the final amounts.

Request

Authorization
API Key
Add parameter in header
x-api-key
Example:
x-api-key: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢201Success
application/json
Rates locked.
Bodyapplication/json

🟠401Access Denied
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'http://k8s-partnera-partnera-7873f15634-69ebb7c047cac3d1.elb.eu-central-1.amazonaws.com/v1/partner/lock' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "sourceBalanceId": "ea93abc7-389d-4bd6-aeff-2257bfa72683",
    "destinationBalanceId": "6d1c19f5-993f-4495-95f2-90b88413eb47",
    "amount": "10"
}'
Response Response Example
201 - Success
{
    "lockId": "a4dfe06a-aea6-4495-be18-9c186cdf08f8",
    "rates": {
        "EUR": "1",
        "BNB": "697.4289328896075",
        "BONK": "0.000003378081234922667",
        "BTC": "76668.35965215057",
        "DOGE": "0.08486608381715906",
        "ETH": "2414.8950771588015",
        "FLOKI": "0.000025798385419486263",
        "LDO": "0.4184109184600882",
        "LTC": "62.60283800458973",
        "PEPE": "0.000003870044411626293",
        "POL": "0.09828135783460011",
        "SHIB": "0.0000052399782566326545",
        "SOL": "107.07084297181892",
        "TON": "1.386",
        "TRUMP": "1.8080351855064887",
        "WIF": "0.2103106326962024",
        "WOO": "0.01219437454697455",
        "XRP": "1.3413472194463831"
    },
    "validUntil": "2026-10-06T11:16:13.364Z"
}
Previous
Get Rates
Next
Create Exchange
Built with