Getting an Informational Quote
Returns an informational crypto quote for the amount exchanged from one currency to another. Unlike the Transactional Quote endpoint, this response does not include a quoteId (since it's just informative) nor any expiration time. A buy or sell flow cannot be initiated with this quote.
Sample API Request for BUY: POST
URL: https://caas-staging.coinme.com/services/cryptoquote/informative
headers:
"Authorization":"asdfghj", // authorization token, required
'User-Agent: partnerapi' // required
Request Body:
{
"debitCurrencyCode":"USD", // required
"creditCurrencyCode":"DOGE", // required
"amountValue":"100", // required
"amountCurrencyCode":"USD", //required
"cryptoSettlementType": "EXTERNAL", // optional, possible values are "INTERNAL" or "EXTERNAL". defaults to "INTERNAL". Use "EXTERNAL" to also calculate blockchain fees
"chain": "" //optional, possible values are "XLM", "ETH", "SOL" or "LINEA". use only if Coinme supports trading this currency on multiple chains. otherwise unnecessary
}
Sample API Response for BUY
Note: spread = 0.015, market value for 1 USD to Dogecoin = 7.8
Successful Response:
{
"data":
{
"creditCurrencyUnitPrice":"7.917", // 7.8(market value for 1 USD to Dogecoin)*(1+ 0.015(spread))
"creditCurrencyUnitPriceCode":"DOGE/USD",
"debitCurrencyUnitPrice":"0.1263104711", // 1/7.917(creditCurrencyUnitPrice)
"debitCurrencyUnitPriceCode":"USD/DOGE",
"creditCurrencyAmount":"771.9075", // include the spread.Calculation- (100(debitCurrencyAmount)-2.5(totalFees))*7.917(creditCurrencyUnitPrice)
"creditCurrencyCode":"DOGE",
"debitCurrencyAmount":"100", // Amount value requested by User
"debitCurrencyCode":"USD",
"totalFees":"2.5", // exchange fee value
"feeCurrency":"USD", // exchange fee currency code
"feesMap":{
"exchangeFee":"2.5",
"processingFee":"0",
"blockchainFee": "0.4" // will be present if cryptoSettlementType == EXTERNAL
},
"spread":"0.117",
"spreadCurrencyCode":"USD"
},
"errorResponse": null
}
Failure Response:
{
"data": null,
"errorResponse": {
"httpStatus":"200",
"timestamp":"2022-02-01T18:59:28.297Z",//UTC
"path":"/services/cryptoquote POST",
"errorData": [
{
"errorCode":"123-123-123-123", // The error code is just a sample showing the structure of the error code.
"message":"CreditCurrencyCode cannot be same as DebitCurrencyCode"
}
]
}
Crypto Quote using Crypto Amount
Quotes can also use cryptocurrencies (i.e., BTC) as the amount when the user wants to buy/sell a specific amount of crypto.
Sample API Request for BUY: POST
URL: https://caas-staging.coinme.com/services/cryptoquote
headers:
"Authorization":"asdfghj", //authorization token,required
'User-Agent: partnerapi' //required
Request Body:
{
"customerId": "654987321" //required
"providerId": "654987321", //optional. required if using Coinme payment processing
"debitCurrencyCode":"USD" // required
"creditCurrencyCode":"BTC"//required
"amountValue":"0.000987", //required
"amountCurrencyCode":"BTC", //required
"cryptoSettlementType": "EXTERNAL", // optional, possible values are "INTERNAL" or "EXTERNAL". defaults to "INTERNAL". Use "EXTERNAL" to also calculate blockchain fees
"chain": "" //optional, possible values are "XLM", "ETH", "SOL" or "LINEA". use only if Coinme supports trading this currency on multiple chains. otherwise unnecessary
}
Sample API Response for BUY:
{
"data": {
"quoteId": "1251838985953988608",
"creditCurrencyUnitPrice": "0.00000906",
"creditCurrencyUnitPriceCode": "BTC/USD",
"debitCurrencyUnitPrice": "110379.90",
"debitCurrencyUnitPriceCode": "USD/BTC",
"creditCurrencyAmount": "0.00098700",
"creditCurrencyCode": "BTC",
"debitCurrencyAmount": "118.81",
"debitCurrencyCode": "USD",
"totalFees": "9.87",
"feeCurrency": "USD",
"feesMap": {
"blockchainFee": "9.87"
},
"expiresIn": 60000,
"expirationTime": "2025-06-16T10:02:12.295Z",
"spread": "2.61",
"spreadCurrencyCode": "USD",
"chain": "BTC"
},
"errorResponse": null
Error Codes
| Error Code | Error Message |
|---|---|
| 280-500-201-000 | Internal error occurred, please try again or contact support |
| 280-500-201-999 | Internal error occurred, please contact support |
| 280-400-201-667 | Field <field_name> cannot be null or empty |
| 280-400-201-902 | CreditCurrencyCode cannot be same as DebitCurrencyCode |
| 280-400-201-901 | AmountCurrencyCode must match DebitCurrencyCode or CreditCurrencyCode |
| 280-400-201-909 | Unsupported operation BUY/SELL |
| 280-400-201-903 | amountCurrencyCode must be of type FIAT |
| 280-400-201-910 | Promo code is not valid! |
| 280-400-201-913 | Currency {currency} is NOT supported for partnerId {partnerId} |
| 280-400-201-914 | Did not receive chain in request for partner {partnerId} and currency {currency} |
| 280-400-201-915 | Received invalid value {chain} for currency {currency}, valid chains are: [list of valid chains for this currency] |
| 280-400-201-916 | NO {currency} wallet found for user {userId} and partnerId {partnerId} |
| 280-400-201-917 | {currency} wallet doesn’t have enough balance for user {userId} and partnerId {partnerId} |
| 280-400-201-918 | Fees {fees} are higher than input {amount}, unable to create quote! |
Error messages for errors that occur while retrieving user data:
| Error Code | Error Message |
|---|---|
| 121-500-317-000 | Internal error occurred, please try again or contact support |
| 121-404-317-704 | UserProfile not found with identifier: partnerId=<partner_id> and accountId=<account_id> |
| 121-401-317-706 | User profile for account <account_id> found, but account is currently locked |
Error messages for errors that occur while retrieving partner data:
| Error Code | Error Message |
|---|---|
| 205-500-317-000 | Internal error occurred, please try again or contact support |
| 205-400-317-602 | Field <field> can’t be empty or null |
| 205-400-317-600 | Field <field> exceeds maximum length of <max_length> |
| 205-404-317-704 | PartnerAssignedProvider resource not found with identifier partnerId=<partner_id> and providerId=<provider_id> |
| 205-400-317-702 | Unsupported partner currency: <currency> |
| 205-400-317-802 | Unsupported provider currency: <currency> |
Updated about 13 hours ago
What’s Next