LogoLogo
  • SWAPPLE API
    • Changelog
      • 2022, 26 January
      • 2022, 29 December
      • 2022, 14 June
      • 2024, 11 March
      • 2024, 27 June
      • 2024, 31 July
      • 2024, 27 August
      • 2024, 3 September
    • API Reference
      • Authorization
      • Orders
      • Statuses
      • Currencies
      • Webhook
      • Sandbox
    • Examples and sample usages
      • Sample usage
      • Merchant User Flow
      • Fixed Rate Order Guide
    • FAQ
  • CRYPTO ACQUIRING API
Powered by GitBook
On this page
  1. SWAPPLE API
  2. Examples and sample usages

Fixed Rate Order Guide

This section is described in detail because a fixed rate requires additional steps to make it work. With a floating rate, you send a request for an endpoint and do not specify anything additional.

PreviousMerchant User FlowNextFAQ

Last updated 8 months ago

In order to work with a fixed rate, you need to specify the value of the rateType field

Let's make an request

{
    "from": "CARDUAH",
    "to": "USDTTRC20",
    "toNetwork": "TRX",
    "fromAmount": 3000,
    "rateType": "FIXED"
}

We received a response from the API:

{
    "extraFromFee": 0.0,
    "extraToFee": 0.0,
    "from": "CARDUAH",
    "fromAmount": 3000.0,
    "fromFee": 6.0,
    "fromNetwork": null,
    "fromRate": 37.45992,
    "fromRevenueShare": 12.0,
    "rateType": "FIXED",
    "side": "BUY",
    "to": "USDTTRC20",
    "toAmount": 78.605082,
    "toFee": 1.0,
    "toNetwork": "TRX",
    "toRate": 1,
    "toRevenueShare": 0.0
}

Here we have two additional fields rateId and rateIdExpirationTimestamp

rateId - ID of the fixed rate which you will pass when creating an order.

rateIdExpirationTimestamp - time when fixed rate will expire.

Now we need to create order with field rateId from estimate.

Estimate amount
#create-a-new-order.