LogoLogo
  • About Aquapay
    • Introduction
    • Payments Facilitation
    • Web Portal
  • Features
    • Account Management
    • Payments and Payouts
    • Crypto Conversion
    • Address Whitelisting
    • CSV Exports
  • Integration Guide
    • API Key
    • Authorization
    • Adding Webhook URLs
    • Webhooks
    • Payment Flow
    • Confirmations & Limits
    • Testnet and Faucet
  • API Endpoints
    • Payment API
    • Conversion API
    • Transaction API
  • Common Scenarios and FAQs
    • Scenario Examples
    • FAQs
Powered by GitBook
On this page
  • Get conversions
  • Create a conversion
  • Cancel a conversion
  • Quote a conversion
  • Execute a conversion

Was this helpful?

  1. API Endpoints

Conversion API

PreviousPayment APINextTransaction API

Last updated 28 days ago

Was this helpful?

API specs for conversion workflow, for web portal access, please see .

Get conversions

GET https://api.aquanow.io/payment/v1/conversion

Get conversion history by ID or time range.

Query Parameters

Name
Type
Description

invoiceId*

String

startTime*

String

ISO 8601 format

endTime

String

ISO 8601 format. Default to request time.

[
    {
        "quantity": 54.692493,
        "baseSymbol": "USDC",
        "status": "CANCELLED",
        "created": "2022-06-24T23:50:23.486Z",
        "items": [
            {
                "txId": "f473123d-a0c1-4a25-a713-2c5ecab27bfa",
                "address": "0x0aE90a043419DAe46774Ba067263202c1a0F60FF",
                "quantity": 52.461662,
                "subaccount": "usdc-5"
            },
            {
                "txId": "948bf813-e055-4e24-be26-5ead961f1fd2",
                "address": "0x1e4622932738763107E949e011167176F14C5327",
                "quantity": 2.230831,
                "subaccount": "usdc-4"
            }
        ],
        "quoteSymbol": "CAD",
        "username": "jeffen",
        "side": "SELL",
        "invoiceId": "f81123c8-2edd-4f29-88e7-6da5f855e48c",
        "type": "CONVERSION"
    }
]
{
    // Response
}
{
    // Response
}

Create a conversion

POST https://api.aquanow.io/payment/v1/conversion

Create a conversion invoice by passing conversion info and conversion items(addresses of bills)

Request Body

Name
Type
Description

baseSymbol*

String

Crypto to convert

quoteSymbol*

String

Fiat to receive

quantity*

Number

Total crypto quantity to convert

items*

Array<{paymentId: string}>

An array of object that contains paymentId of each bills. They must have the same baseSymbol and quoteSymbol

{
    "invoiceId": "1663abe9-509c-4e0a-ab0a-aa340cbe7340",
    "status": "CREATED",
    "items": [
        {
            "txId": "72302a49-6948-4217-9131-534bec20cc4c",
            "quantity": 52.461662,
            "subaccount": "aq-3578-usdc-5",
            "address": "0x11182D6C867B17c6BCE7a2d5711C33a0B61621C9"
        },
        {
            "txId": "fcfdc253-cc05-4121-a2be-ab3e77323128",
            "quantity": 2.230831,
            "subaccount": "aq-3578-usdc-4",
            "address": "0x693eDfb2352FE1e3a6D1ce95291c30FCc4b5990C"
        }
    ],
    "username": "jeffen",
    "baseSymbol": "USDC",
    "quoteSymbol": "CAD",
    "side": "SELL",
    "quantity": 54.692493
}
{
    // Response
}

Cancel a conversion

DELETE https://api.aquanow.io/payment/v1/conversion

Request Body

Name
Type
Description

invoiceId*

String

{
    // Response
}
{
    // Response
}

Quote a conversion

POST https://api.aquanow.io/payment/v1/conversion/quote

Request Body

Name
Type
Description

invoiceId*

String

{
    "quoteId": "768b49f3-5359-471d-812f-398c0544e646",
    "quoteTime": 1656191311136,
    "expireTime": 1656191319136,
    "symbol": "USDC-CAD",
    "side": "sell",
    "receiveCurrency": "CAD",
    "receiveQuantity": 70.4001769896,
    "deliverCurrency": "USDC",
    "deliverQuantity": 54.692493,
    "price": 1.2872
}
{
    // Response
}

Execute a conversion

POST https://api.aquanow.io/payment/v1/conversion/execute

Request Body

Name
Type
Description

invoiceId*

String

{
    "invoiceId": "1663abe9-509c-4e0a-ab0a-aa340cbe7340"
}
{
    // Response
}
here