API DOCS
  • Introduction
  • Getting Started
  • Supported Assets
  • Reference
    • API Reference
      • Common Parameters
      • Order
        • Pay Example
          • MuseWallet Checkout
          • Direct Integration
            • India
              • Wallet
            • Vietnam
              • Virtual_account
              • Qrcode
            • Indonesia
              • Wallet
              • Virtual_account
              • Qrcode
            • Brazil
              • Wallet
            • USA
              • Credit Card
            • Philippine
              • Wallet
              • Qrcode
          • On-Chain
        • Payout Example
          • India
            • BankTransfer
          • Vietnam
            • BankTransfer
          • Brazil
            • WalletTransfer
          • Indonesia
            • WalletTransfer
            • BankTransfer
          • Philippine
            • WalletTransfer
            • BankTransfer
      • Balance
      • Conversion
      • Fee
  • WebHook
  • API Responses
  • Enums
    • Payment Method
    • Payment Type
      • Vietnam
        • qrcode
        • virtual_account
      • Brazil
        • wallet
      • Indonesia
        • virtual_account
        • wallet
        • qrcode
      • India
        • wallet
      • Philippine
    • Payout Method
      • Vietnam
        • Bank
      • Indonesia
        • Bank
        • Wallet
      • Brazil
        • Wallet
      • India
        • bank
      • Philippine
        • Bank
        • wallet
    • Order Type
    • Order Status
    • Country Code
  • Data(Test)
Powered by GitBook
On this page
  • Trade Rate
  • Get a Quote
  • Execute a trade
  1. Reference
  2. API Reference

Conversion

Convert from one fungible asset to another and settle transactions without ever taking assets out of custody.

PreviousBalanceNextFee

Last updated 6 months ago

Every request must contain

Demo code can be found at

Trade Rate

POST /v1/conversion/rate

Retrieves exchange rate between currencies.

Request Body

Name
Type
Description

symbol*

String

Symbol of the pair to trade, for example, btc-usdt

side*

String

side of trade: buy or sell. buy: the price for buying the base currency. sell: the price for selling the quote currency.

{
  "code": "200",
  "data": {
    "rate": "16078.8636472720095",
    "symbol": "USDT-IDR",
    "timeMills": 1678085017746,
    "expiredMills": 1678085077746
  },
  "message": "success"
}
Code Example
curl --location --request POST 'https:///api.musepay.io/v1/rate/queryTradeRate' \
--header 'Content-Type: application/json' \
--data-raw '{
   * "symbol": "BTC-USDT",
   * "side": "BUY"
   
}'

Get a Quote

POST /v1/conversion/quote

Get a quote for currency conversion.

Request Body

Name
Type
Description

symbol*

String

Symbol of the pair to trade, for example, btc-usdt

amount*

String

Amount of asset used to trade

currency*

String

The asset used to trade

side*

String

side of trade: buy or sell. buy: the price for buying the base currency. sell: the price for selling the quote currency.

xid*

String

External identifier, unique across all resources created under this account.

{
"code":"200",
"message":"success",
"data":        
   {
      "quoteId":"2024102220000600011072223306",
      "payCurrency":"USDT",
      "payAmt":"100",
      "settleCurrency":"ETH",
      "settleAmt":"0.0375626384",
      "feeCurrency":"ETH",
      "feeAmt":"0.00003761",
      "rate":"2659.5569",
      "timeMills":1729581743749,
      "expiredMills":1729582343749
   }
}

Execute a trade

POST /v1/conversion/execute

Execute a trade that has been previously quoted

Request Body

Name
Type
Description

quoteId*

String

Quote ID

{
  "code": "200",
  "data": {
    "orderNo": "12323",
    "status": 22
  },
  "message": "success"
}
common parameters
Github