Creating a Valid Quote

For this step, we will be engaging with the Create Quote endpoint of the API.

Now that you have given an estimate exchange rate which you could have displayed to your EPM merchant, you can create a valid quote to finalise the exchange between wallets.

❗️

This step requires the exclusive use of Parent API keys since the operation is meant to be performed at the EP level.

🚧

The query parameter estimate must be set to false (?estimate=false) to generate a valid quote, transitioning from an indicative to a concrete quote.

Example Request

Here is how you can request an exchange of 1000 EUR from your EP wallet to USDT in your EPM account:

{
  "from": "EUR",
  "to": "USDT",
  "fromWallet": 543660,
  "toWallet": 578199,
  "amountIn": 1000,
  "payInMethod": "wallet",
  "payOutMethod": "wallet"
}

Lets look at what the request body parameters are:

FieldDescription
fromThe currency to exchange from
toThe currency to exchange to
fromWalletThe ID of the wallet the amount will come from
toWalletThe wallet that the exchanged amount will be deposited in
amountInThe amount taken from the wallet to be exchanged
payInMethodThe method to pay in, only use wallet as it is a transfer in to a wallet
payOutMethodThe method to pay out of, only use wallet as it is a transfer out of a wallet

Example Response

Responding to the request for an exchange from EUR to USDT, the API provides:

{
    "id": 336859,
    "from": "EUR",
    "to": "USDT",
    "amountIn": 1000.000000000000000000,
    "amountDue": 1000.000000000000000000,
    "amountOut": 1068.103764000000000000,
    "price": 0.936238625600000000,
    "quoteStatus": "PENDING",
    "paymentStatus": "PENDING",
    "acceptanceExpiryDate": 1708453101864,
    "acceptanceDate": null,
    "paymentExpiryDate": 1708453980430,
    "paymentReceiptDate": null,
    "payInLegs": [],
    "payInMethod": {
        "id": 5,
        "code": "wallet",
        "settlementCurrency": "EUR",
        "requestedCurrency": null,
        "estimatedExchangeRate": null,
        "accountMethods": []
    },
    "payOutMethod": {
        "id": 3,
        "code": "wallet",
        "currency": "USDT",
        "accountMethods": [
            {
                "id": 1456,
                "display": null
            },
            {
                "id": 1665,
                "display": null
            },
            {
                "id": 1892,
                "display": null
            },
            {
                "id": 2029,
                "display": null
            }
        ]
    },
    "uuid": "b0294ad5-044d-47c0-b6f9-45c850f43106",
    "payOutInstruction": null,
    "payInInstruction": null,
    "usePayInMethod": {
        "id": 1319693,
        "display": null
    },
    "usePayOutMethod": {
        "id": 1456,
        "display": null
    },
    "fee": 1.000000000000000021,
    "processingFee": 0E-18,
    "type": "FIXED",
    "netPrice": 0.936238625600000000,
    "grossPrice": 0.936238625600000000,
    "amountInGross": 1E+3,
    "amountInNet": 1000.000000000000000000,
    "fees": {
        "percentage": {
            "service": 0.0010,
            "processing": 0.0000
        },
        "value": {
            "service": 1,
            "processing": 0
        }
    },
    "dateCreated": 1708453082098,
    "lastUpdated": 1708453082098
}

Key fields in the response:

FieldsDescription
idThe ID of the quote, valid quote as it is present.
quoteStatusThe status of the quote is now PENDING and waiting to be accepted or abandoned.
uuidThe uuid of the exchange estimate, used to accept the quote
priceThe existing exchange rate of required amount of the from currency to get 1 of the to currency.
amountInThe amount of from currency into the estimate.
amountOutThe amount of the to currency that you will get for the given amountIn.

This quote includes an expiry time and should be refreshed periodically to obtain a new spot exchange rate. Each refresh will generate a new uuid.

The quote's uuid ("b0294ad5-044d-47c0-b6f9-45c850f43106") should be noted for proceeding to the next step.


What’s Next