Coinme Cryptoquote API

The Cryptoquote API from Coinme — 4 operation(s) for cryptoquote.

OpenAPI Specification

coinme-cryptoquote-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Coinme Crypto-as-a-Service AuthLinkResult Cryptoquote API
  version: '1.2'
  description: 'Coinme Crypto-as-a-Service (CaaS) API. Harvested from provider-published per-endpoint OpenAPI blocks at docs.coinme.com/reference. Modular crypto infrastructure: KYC onboarding, quotes, buy/sell orders, wallets, sends, cash on/off-ramp, payment methods, and webhooks.'
servers:
- url: https://caas.coinme.com/services
  description: production
- url: https://caas-staging.coinme.com/services
  description: staging
tags:
- name: Cryptoquote
paths:
  /cryptoquote:
    post:
      summary: Initiate Transactional Quote
      description: Return crypto quote for amount exchanged from one currency to another and it’s expiration time in UTC. Response also includes a quoteId, which can be used to initiate a transaction. Quotes expire after 30 seconds by default.
      operationId: initiate-transactional-quote
      parameters:
      - name: Authorization
        in: header
        description: Bearer token {authorize} endpoint
        required: true
        schema:
          type: string
          default: Bearer ******
      - name: User-Agent
        in: header
        description: Partner User Agent ID (provided by Coinme)
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - customerId
              - debitCurrencyCode
              - creditCurrencyCode
              - amountValue
              - amountCurrencyCode
              properties:
                customerId:
                  type: integer
                  description: Unique customer identifier
                  format: int64
                providerId:
                  type: string
                  description: ID of payment provider (provided by Coinme)
                debitCurrencyCode:
                  type: string
                  description: Debit currency code (i.e. USD)
                creditCurrencyCode:
                  type: string
                  description: Credit currency code (i.e. DOGE)
                amountValue:
                  type: string
                  description: Amount to buy or sell. This is used as the input value to calculate the quote
                amountCurrencyCode:
                  type: string
                  description: Currency code of amount (i.e. USD). It must match either creditCurrency or debitCurrency
                locationReference:
                  type: string
                  description: should be specified only if fiat settlement is done through Coinme and requires a physical location (i.e. selling crypto for cash)
                gpsCoordinates:
                  type: object
                  description: alternative to locationReference
                  properties:
                    latitude:
                      type: string
                      description: latitude of location when selling crypto for cash (i.e. -78.617716)
                    longitude:
                      type: string
                      description: longitude of location when selling crypto for cash (i.e. 62.936942)
                cryptoSettlementType:
                  type: string
                  description: Possible values are "INTERNAL" or "EXTERNAL". defaults to "INTERNAL". Use "EXTERNAL" to also calculate blockchain fees
                  default: INTERNAL
                  enum:
                  - INTERNAL
                  - EXTERNAL
                chain:
                  type: string
                  description: Possible values are "XLM", "ETH", or "LINEA". Use only if Coinme supports trading this currency on multiple chains. otherwise unnecessary
                promoCode:
                  type: string
                  description: Applies promotional fees for this transaction. Please contact your Coinme Account Manager to set up a custom promotional code
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Business error:
                  summary: Business error
                  value: "{\n  \"data\": null,\n  \"errorResponse\": {\n    \"httpStatus\":\"200\",\n    \"timestamp\":\"2022-02-01T18:59:28.297Z\",//UTC\n    \"path\":\"/services/cryptoquote POST\",\n    \"errorData\": [\n      {\n        \"errorCode\":\"123-123-123-123\",//The error code is just a sample showing the structure of the error code.\n        \"message\":\"CreditCurrencyCode cannot be same as DebitCurrencyCode\"\n      }\n    ]\n}"
                Success:
                  value: "{\n  \"data\": \n  {\n    \"expiresIn\": 30000,// in milliseconds\n    \"expirationTime\": \"2022-02-01T18:59:28.297Z\",//UTC\n    \"quoteId\": \"1006491596889587712\",\n    \"creditCurrencyUnitPrice\":\"7.917\", // 7.8(market value for 1 USD to Dogecoin)*(1+ 0.015(spread))\n    \"creditCurrencyUnitPriceCode\":\"DOGE/USD\",\n    \"debitCurrencyUnitPrice\":\"0.1263104711\",// 1/7.917(creditCurrencyUnitPrice)\n    \"debitCurrencyUnitPriceCode\":\"USD/DOGE\",\n    \"creditCurrencyAmount\":\"771.9075\",//include the spread.Calculation- (100(debitCurrencyAmount)-2.5(totalFees))*7.917(creditCurrencyUnitPrice)\n    \"creditCurrencyCode\":\"DOGE\",\n    \"debitCurrencyAmount\":\"100\",//Amount value requested by User\n    \"debitCurrencyCode\":\"USD\",\n    \"totalFees\":\"2.5\",//exchange fee value\n    \"feeCurrencyCode\":\"USD\", // exchange fee currency code\n    \"feesMap\":{\n      \"exchangeFee\":\"2.5\",\n      \"processingFee\":\"0\",\n      \"blockchainFee\": \"0.3\" // will be present if cryptoSettlementType is EXTERNAL\n    },\n    \"spreadAmount\":\"0.117\",\n    \"spreadCurrencyCode\":\"USD\",\n  },\n  \"errorResponse\": null\n}"
                  summary: Success
              schema:
                type: object
                properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"data\": null,\n  \"errorResponse\": {\n    \"httpStatus\":\"200\",\n    \"timestamp\":\"2022-02-01T18:59:28.297Z\",//UTC\n    \"path\":\"/services/cryptoquote POST\",\n    \"errorData\": [\n      {\n        \"errorCode\":\"123-123-123-123\",//The error code is just a sample showing the structure of the error code.\n        \"message\":\"CreditCurrencyCode cannot be same as DebitCurrencyCode\"\n      }\n    ]\n}"
        '401':
          description: '401'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
        '500':
          description: '500'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
      security:
      - x-api-key: []
      tags:
      - Cryptoquote
  /cryptoquote/{quoteId}:
    get:
      summary: Get Transactional Quote
      description: Gathers details on a transactional quote based on the quoteId
      operationId: get-transactional-quote
      parameters:
      - name: quoteId
        in: path
        description: Quote Identifier referring to the specific crypto quote
        schema:
          type: string
        required: true
      - name: Authorization
        in: header
        description: Bearer token {authorize} endpoint
        required: true
        schema:
          type: string
          default: Bearer ******
      - name: User-Agent
        in: header
        description: Partner User Agent ID (provided by Coinme)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"data\": {\n        \"quoteId\": \"1016647805236006912\",\n        \"creditCurrencyUnitPrice\": \"0.00003840\",\n        \"creditCurrencyUnitPriceCode\": \"BTC/USD\",\n        \"debitCurrencyUnitPrice\": \"26041.78\",\n        \"debitCurrencyUnitPriceCode\": \"USD/BTC\",\n        \"creditCurrencyAmount\": \"0.00028147\",\n        \"creditCurrencyCode\": \"BTC\",\n        \"debitCurrencyAmount\": \"7.47\",\n        \"debitCurrencyCode\": \"USD\",\n        \"totalFees\": \"0.14\",\n        \"feeCurrency\": \"USD\",\n        \"feesMap\": {\n            \"exchangeFee\": \"0.14\",\n            \"blockchainFee\": \"0.3\" // will be present if cryptoSettlementType is EXTERNAL\n        },\n        \"expiresIn\": 54600,\n        \"expirationTime\": \"2023-09-06T09:56:25.171Z\",\n        \"spread\": \"0.08\",\n        \"spreadCurrencyCode\": \"USD\"\n    },\n    \"errorResponse\": null\n}"
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      quoteId:
                        type: string
                        example: '1016647805236006912'
                      creditCurrencyUnitPrice:
                        type: string
                        example: '0.00003840'
                      creditCurrencyUnitPriceCode:
                        type: string
                        example: BTC/USD
                      debitCurrencyUnitPrice:
                        type: string
                        example: '26041.78'
                      debitCurrencyUnitPriceCode:
                        type: string
                        example: USD/BTC
                      creditCurrencyAmount:
                        type: string
                        example: '0.00028147'
                      creditCurrencyCode:
                        type: string
                        example: BTC
                      debitCurrencyAmount:
                        type: string
                        example: '7.47'
                      debitCurrencyCode:
                        type: string
                        example: USD
                      totalFees:
                        type: string
                        example: '0.14'
                      feeCurrency:
                        type: string
                        example: USD
                      feesMap:
                        type: object
                        properties:
                          exchangeFee:
                            type: string
                            example: '0.14'
                          blockchainFee:
                            type: string
                            example: '0.3'
                      expiresIn:
                        type: integer
                        example: 54600
                        default: 0
                      expirationTime:
                        type: string
                        example: '2023-09-06T09:56:25.171Z'
                      spread:
                        type: string
                        example: '0.08'
                      spreadCurrencyCode:
                        type: string
                        example: USD
                  errorResponse: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: ''
        '401':
          description: '401'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
        '500':
          description: '500'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
      security:
      - x-api-key: []
      tags:
      - Cryptoquote
  /cryptoquote/informative:
    post:
      summary: Initiate Informative Quote
      description: Returns an informational crypto quote for amount exchanged from one currency to another. Unlike the Transactional Quote endpoint, this response does not include a quoteId (since its just informative) nor any expiration time. A buy or sell flow cannot be initiated with this quote
      operationId: initiate-informative-quote
      parameters:
      - name: Authorization
        in: header
        description: Bearer token {authorize} endpoint
        required: true
        schema:
          type: string
          default: Bearer ******
      - name: User-Agent
        in: header
        description: Partner User Agent ID (provided by Coinme)
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - debitCurrencyCode
              - creditCurrencyCode
              - amountValue
              - amountCurrencyCode
              properties:
                debitCurrencyCode:
                  type: string
                  description: Debit currency code (i.e. USD)
                creditCurrencyCode:
                  type: string
                  description: Credit currency code (i.e. DOGE)
                amountValue:
                  type: string
                  description: Amount to buy or sell
                amountCurrencyCode:
                  type: string
                  description: Currency code of amount (i.e. USD)
                  default: USD
                cryptoSettlementType:
                  type: string
                  description: Possible values are "INTERNAL" or "EXTERNAL". defaults to "INTERNAL". Use "EXTERNAL" to also calculate blockchain fees
                  default: INTERNAL
                  enum:
                  - INTERNAL
                  - EXTERNAL
                chain:
                  type: string
                  description: Possible values are "XLM" or "ETH". use only if Coinme supports trading this currency on multiple chains. otherwise unnecessary
                latitude:
                  type: string
                  description: Latitude  of the selected location. Either lat & long , or the locationReference must be provided
                longitude:
                  type: string
                  description: Longitude of the selected location. Either lat & long , or the locationReference must be provided
                locationReference:
                  type: string
                  description: Encoded reference of the location. Either lat & long , or the locationReference must be provided
                promoCode:
                  type: string
                  description: Applies promotional fees for this transaction. Please contact your Coinme Account Manager to set up a custom promotional code
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"data\": \n  {\n    \"creditCurrencyUnitPrice\":\"7.917\", // 7.8(market value for 1 USD to Dogecoin)*(1+ 0.015(spread))\n    \"creditCurrencyUnitPriceCode\":\"DOGE/USD\",\n    \"debitCurrencyUnitPrice\":\"0.1263104711\",// 1/7.917(creditCurrencyUnitPrice)\n    \"debitCurrencyUnitPriceCode\":\"USD/DOGE\",\n    \"creditCurrencyAmount\":\"771.9075\",//include the spread.Calculation- (100(debitCurrencyAmount)-2.5(totalFees))*7.917(creditCurrencyUnitPrice)\n    \"creditCurrencyCode\":\"DOGE\",\n    \"debitCurrencyAmount\":\"100\",//Amount value requested by User\n    \"debitCurrencyCode\":\"USD\",\n    \"totalFees\":\"2.5\",//exchange fee value\n    \"feeCurrency\":\"USD\", // exchange fee currency code\n    \"feesMap\":{\n      \"exchangeFee\":\"2.5\",\n      \"processingFee\":\"0\",\n      \"blockchainFee\": \"0.4\" // will be present if cryptoSettlementType == EXTERNAL\n    },\n    \"spread\":\"0.117\",\n    \"spreadCurrencyCode\":\"USD\"\n  },\n  \"errorResponse\": null\n}"
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      creditCurrencyUnitPrice:
                        type: string
                        example: '7.917'
                      creditCurrencyUnitPriceCode:
                        type: string
                        example: DOGE/USD
                      debitCurrencyUnitPrice:
                        type: string
                        example: '0.1263104711'
                      debitCurrencyUnitPriceCode:
                        type: string
                        example: USD/DOGE
                      creditCurrencyAmount:
                        type: string
                        example: '771.9075'
                      creditCurrencyCode:
                        type: string
                        example: DOGE
                      debitCurrencyAmount:
                        type: string
                        example: '100'
                      debitCurrencyCode:
                        type: string
                        example: USD
                      totalFees:
                        type: string
                        example: '2.5'
                      feeCurrency:
                        type: string
                        example: USD
                      feesMap:
                        type: object
                        properties:
                          exchangeFee:
                            type: string
                            example: '2.5'
                          processingFee:
                            type: string
                            example: '0'
                          blockchainFee:
                            type: string
                            example: '0.4'
                      spread:
                        type: string
                        example: '0.117'
                      spreadCurrencyCode:
                        type: string
                        example: USD
                  errorResponse: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"data\": null,\n  \"errorResponse\": {\n    \"httpStatus\":\"200\",\n    \"timestamp\":\"2022-02-01T18:59:28.297Z\",//UTC\n    \"path\":\"/services/cryptoquote POST\",\n    \"errorData\": [\n      {\n        \"errorCode\":\"123-123-123-123\",//The error code is just a sample showing the structure of the error code.\n        \"message\":\"CreditCurrencyCode cannot be same as DebitCurrencyCode\"\n      }\n    ]\n}"
        '401':
          description: '401'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
        '500':
          description: '500'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
      security:
      - x-api-key: []
      tags:
      - Cryptoquote
  /cryptoquote/sell-all:
    post:
      summary: Initiate Sell All Transaction
      description: Sells all of the customer's remaining cryptocurrency as specified. The response is exactly same as the Cryptoquote end point. This is usable only if the user’s crypto asset are managed by Coinme’s custody wallet
      operationId: initiate-sell-all-transaction
      parameters:
      - name: Authorization
        in: header
        description: Bearer token {authorize} endpoint
        required: true
        schema:
          type: string
          default: Bearer ******
      - name: User-Agent
        in: header
        description: Partner User Agent ID (provided by Coinme)
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - customerId
              - debitCurrencyCode
              - creditCurrencyCode
              properties:
                customerId:
                  type: integer
                  description: Unique customer identifier
                  format: int64
                debitCurrencyCode:
                  type: string
                  description: Debit currency code (i.e. USD)
                creditCurrencyCode:
                  type: string
                  description: Credit currency code (i.e. DOGE)
                cryptoSettlementType:
                  type: string
                  description: Possible values are "INTERNAL" or "EXTERNAL". defaults to "INTERNAL". Use "EXTERNAL" to also calculate blockchain fees
                chain:
                  type: string
                  description: Possible values are "XLM" or "ETH". use only if Coinme supports trading this currency on multiple chains. otherwise unnecessary
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"data\": \n  {\n    \"expiresIn\": 30000,// in milliseconds\n    \"expirationTime\": \"2022-02-01T18:59:28.297Z\",//UTC\n    \"quoteId\": \"eyJhbGciOiJIUzI1NiJ9.eyJxdW90ZSI6eyJwcmljZSI6IjM4NTA0Ljc4IiwiZXhwaXJlc0luIjo2MCwiZXhwaXJhdGlvblRpbWUiOiIyMDIyLTAyLTAxVDE4OjU5OjI4LjI5N1oiLCJxdW90ZUNvZGUiOm51bGwsImN1cnJlbmN5UGFpciI6IkJUQy9VU0QiLCJpbnZlcnRlZFByaWNlIjoiMC4wMDAwMjU5NyIsImFwcGxpY2FibGVGZWVQZXJjZW50YWdlcyI6bnVsbCwiYXBwbGljYWJsZURpc2NvdW50UGVyY2VudGFnZXMiOm51bGx9LCJwcm92aWRlck5hbWUiOiJCaXR0cmV4In0.jUHyINH8t71Xyk2GonwIwIkAIuIfT6L64Y4eNnU_gvA\",\n    \"creditCurrencyUnitPrice\":\"0.1301574906\",//1/(7.8(market value for 1 USD to Dogecoin) * (1 - 0.015(spread)))\n    \"creditCurrencyUnitPriceCode\":\"USD/DOGE\",\n    \"debitCurrencyUnitPrice\":\"7.683\",// 1/0.1301574906(creditCurrencyUnitPrice)\n    \"debitCurrencyUnitPriceCode\":\"DOGE/USD\",\n    \"creditCurrencyAmount\":\"100\",//Amount value requested by User \n    \"creditCurrencyCode\":\"USD\",\n    \"debitCurrencyAmount\":\"749.0925\",//Calculation: 7.683(debitCurrencyUnitPrice)*(100(creditCurrencyAmount)-2.5(totalFees))\n    \"debitCurrencyCode\":\"DOGE\",\n    \"totalFees\":\"2.5\",//exchange fee value\n    \"feeCurrencyCode\":\"USD\", // exchange fee currency code\n    \"feesMap\":{\n      \"exchangeFee\":\"2.5\",\n      \"processingFee\":\"0\",\n      \"blockchainFee\": \"0.4\" // present if request had cryptoSettlementType: EXTERNAL\n    },\n    \"spreadAmount\":\"0.117\",\n    \"spreadCurrencyCode\":\"USD\",\n    \"timestamp\":\"2022-02-01T18:59:28.297Z\"//UTC\n  },\n  \"errorResponse\": null\n}"
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      expiresIn:
                        type: integer
                        example: 30000
                        default: 0
                      expirationTime:
                        type: string
                        example: '2022-02-01T18:59:28.297Z'
                      quoteId:
                        type: string
                        example: eyJhbGciOiJIUzI1NiJ9.eyJxdW90ZSI6eyJwcmljZSI6IjM4NTA0Ljc4IiwiZXhwaXJlc0luIjo2MCwiZXhwaXJhdGlvblRpbWUiOiIyMDIyLTAyLTAxVDE4OjU5OjI4LjI5N1oiLCJxdW90ZUNvZGUiOm51bGwsImN1cnJlbmN5UGFpciI6IkJUQy9VU0QiLCJpbnZlcnRlZFByaWNlIjoiMC4wMDAwMjU5NyIsImFwcGxpY2FibGVGZWVQZXJjZW50YWdlcyI6bnVsbCwiYXBwbGljYWJsZURpc2NvdW50UGVyY2VudGFnZXMiOm51bGx9LCJwcm92aWRlck5hbWUiOiJCaXR0cmV4In0.jUHyINH8t71Xyk2GonwIwIkAIuIfT6L64Y4eNnU_gvA
                      creditCurrencyUnitPrice:
                        type: string
                        example: '0.1301574906'
                      creditCurrencyUnitPriceCode:
                        type: string
                        example: USD/DOGE
                      debitCurrencyUnitPrice:
                        type: string
                        example: '7.683'
                      debitCurrencyUnitPriceCode:
                        type: string
                        example: DOGE/USD
                      creditCurrencyAmount:
                        type: string
                        example: '100'
                      creditCurrencyCode:
                        type: string
                        example: USD
                      debitCurrencyAmount:
                        type: string
                        example: '749.0925'
                      debitCurrencyCode:
                        type: string
                        example: DOGE
                      totalFees:
                        type: string
                        example: '2.5'
                      feeCurrencyCode:
                        type: string
                        example: USD
                      feesMap:
                        type: object
                        properties:
                          exchangeFee:
                            type: string
                            example: '2.5'
                          processingFee:
                            type: string
                            example: '0'
                          blockchainFee:
                            type: string
                            example: '0.4'
                      spreadAmount:
                        type: string
                        example: '0.117'
                      spreadCurrencyCode:
                        type: string
                        example: USD
                      timestamp:
                        type: string
                        example: '2022-02-01T18:59:28.297Z'
                  errorResponse: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"data\": null,\n  \"errorResponse\": {\n    \"httpStatus\":\"200\",\n    \"timestamp\":\"2022-02-01T18:59:28.297Z\",//UTC\n    \"path\":\"/services/cryptoquote POST\",\n    \"errorData\": [\n      {\n        \"errorCode\":\"123-123-123-123\",//The error code is just a sample showing the structure of the error code.\n        \"message\":\"CreditCurrencyCode cannot be same as DebitCurrencyCode\"\n      }\n    ]\n}"
        '401':
          description: '401'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
        '500':
          description: '500'
          content:
            text/plain:
              examples:
                Result:
                  value: ''
      deprecated: false
      security:
      - x-api-key: []
      tags:
      - Cryptoquote
components:
  securitySchemes:
    basic:
      type: http
      scheme: basic
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key