Quote API

If you want to fully customize the user interface and the user experience, you can use our quote API to get data from Poko. Our quote API returns payment URL embeddable to your product and a master list of payment methods, providers and rates.

Endpoint

  • Staging: https://stg.api.onramp.pokoapp.xyz/api/public/quote

  • Production: https://api.onramp.pokoapp.xyz/api/public/quote

Making request

  • Method: POST

  • Header: attach your API_KEY into this key x-api-key

  • Body

    • fiat: Fiat currency (USD, VND,..)

    • crypto: Cryptocurrency (ETH, BTC,..)

    • amount: amount to pay

    • amountType: fiat or crypto

    • network: blockchain network (ethereum, bsc, bitcoin, polygon,..)

    • merchantUserId: Merchant’s userID to identify their users

If amountType is crypto, it would take a longer time to process than if amountType is fiat. The amount of receiving crypto would not be exactly the crypto amount input in the API.

Example:

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://stg.api.onramp.pokoapp.xyz/api/public/quote',
  'headers': {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "amount": 100,
    "fiat": "USD",
    "crypto": "ETH",
    "network": "ethereum",
    "amountType": "fiat",
    "merchantUserId": "your_user_id"
  })
};

request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Response

  • paymentUrl: a complete payment URL that can be embedded into an iframe or used directly to purchase.

  • providers: a master list of providers and their available payment methods, including the estimation of receiving crypto amount, fees, etc.

  • suggestionWithBestRate: a suggestion provided by Poko for the best provider that can be used if any. If there is a suggestion with the best provider, we would attach &providerId=XXX&paymentMethodId=YYY to the paymentUrl to open the suggested provider directly instead of Poko widget. You can remove it manually if don't want that behavior.

Example response

{
    "paymentUrl": "https://stg.onramp.pokoapp.xyz/?apiKey=YOUR_API_KEY&userId=your_user_id&fiat=USD&crypto=ETH-ethereum&fiatAmount=100&providerId=sardine&paymentMethodId=credit_debit_card",
    "providers": [
        {
            "id": "transak",
            "name": "Transak",
            "paymentMethods": [
                {
                    "id": "credit_debit_card",
                    "name": "Card Payment",
                    "icon": "https://cdn.pokoapp.xyz/transak/visa_master_h.png",
                    "minFiat": 30,
                    "maxFiat": 1500,
                    "providerFee": 4.49,
                    "networkFee": 6.44,
                    "rate": 1850.8381091457284,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.048124144170076065
                },
                {
                    "id": "apple_pay",
                    "name": "Apple Pay",
                    "icon": "https://cdn.pokoapp.xyz/transak/apple_logo.svg",
                    "minFiat": 30,
                    "maxFiat": 1500,
                    "providerFee": 4.49,
                    "networkFee": 6.44,
                    "rate": 1850.8381091457284,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.048124144170076065
                },
                {
                    "id": "google_pay",
                    "name": "Google Pay",
                    "icon": "https://cdn.pokoapp.xyz/transak/google_pay.svg",
                    "minFiat": 30,
                    "maxFiat": 1500,
                    "providerFee": 4.49,
                    "networkFee": 6.44,
                    "rate": 1850.8381091457284,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.048124144170076065
                },
                {
                    "id": "pm_cash_app",
                    "name": "Cash App",
                    "icon": "https://cdn.pokoapp.xyz/transak/cash_app_icon.svg",
                    "minFiat": 30,
                    "maxFiat": 1000,
                    "providerFee": 1.4899999999999998,
                    "networkFee": 6.44,
                    "rate": 1850.8381091457284,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.04974503147792639
                },
                {
                    "id": "pm_jwire",
                    "name": "Wire",
                    "icon": "https://cdn.pokoapp.xyz/transak/wire_payment_icon.svg",
                    "minFiat": 30,
                    "maxFiat": 500,
                    "providerFee": 1.4899999999999998,
                    "networkFee": 6.44,
                    "rate": 1850.8381091457284,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.04974503147792639
                }
            ]
        },
        {
            "id": "moonpay",
            "name": "Moonpay",
            "paymentMethods": [
                {
                    "id": "credit_debit_card",
                    "name": "Card Payment",
                    "icon": "https://cdn.pokoapp.xyz/transak/visa_master_h.png",
                    "minFiat": 30,
                    "maxFiat": 12000,
                    "providerFee": 4.46,
                    "networkFee": 2.32,
                    "rate": 1907.7256281407035,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.048864469096037436
                },
                {
                    "id": "pm_jach",
                    "name": "ACH bank transfer",
                    "icon": "https://cdn.pokoapp.xyz/transak/ach_payment_icon.svg",
                    "minFiat": 30,
                    "maxFiat": 12000,
                    "providerFee": 4.46,
                    "networkFee": 2.32,
                    "rate": 1907.7256281407035,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.048864469096037436
                }
            ]
        },
        {
            "id": "sardine",
            "name": "Sardine",
            "paymentMethods": [
                {
                    "id": "pm_jach",
                    "name": "ACH bank transfer",
                    "icon": "https://cdn.pokoapp.xyz/transak/ach_payment_icon.svg",
                    "minFiat": 10,
                    "maxFiat": 1000,
                    "providerFee": 5.5,
                    "networkFee": 2.25,
                    "rate": 1880.6122448979581,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.04905317417254479
                },
                {
                    "id": "credit_debit_card",
                    "name": "Card Payment",
                    "icon": "https://cdn.pokoapp.xyz/transak/visa_master_h.png",
                    "minFiat": 10,
                    "maxFiat": 3000,
                    "providerFee": 3.7,
                    "networkFee": 2.25,
                    "rate": 1880.6122448979581,
                    "fiatAmount": 100,
                    "cryptoAmount": 0.05001030927835054
                }
            ]
        }
    ],
    "suggestionWithBestRate": {
        "providerId": "sardine",
        "paymentMethodId": "credit_debit_card"
    }
}

Last updated