openapi: 3.1.0
info:
  title: Hosted Checkout API
  version: v2
  description: >-
    > For the complete documentation index, see
    [llms.txt](https://docs.banxa.com/llms.txt). Append `.md` to any page URL
    for its markdown version.
servers:
  - url: https://api.banxa.com
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: x-api-key
      x-bearer-format: token
      x-default: xxxxxxxxxxxxxxxxxx
security:
  - sec0: []
paths:
  /{partner}/v2/fiats/{orderType}:
    get:
      summary: Retrieve a list of fiats
      description: Retrieve all available fiat currencies supported by Banxa.
      operationId: retrieve-a-list-of-fiats
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: orderType
          in: path
          description: >-
            Determines availability for Buy or Sell orders. By default if this
            value is not passed, then fiat availability for Buy orders will be
            returned.
          schema:
            type: string
            default: buy
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    [
                        {
                            "id": "USD",
                            "description": "US Dollar",
                            "symbol": "$",
                            "supportedPaymentMethods": [
                                {
                                    "id": "debit-credit-card",
                                    "name": "Credit Debit Card",
                                    "minimum": "10",
                                    "maximum": "50000"
                                },
                                {
                                    "id": "apple-pay",
                                    "name": "Apple Pay",
                                    "minimum": "75",
                                    "maximum": "50000"
                                }
                            ]
                        }
                    ]
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: USD
                    description:
                      type: string
                      example: US Dollar
                    symbol:
                      type: string
                      example: $
                    supportedPaymentMethods:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            example: debit-credit-card
                          name:
                            type: string
                            example: Credit Debit Card
                          minimum:
                            type: string
                            example: '10'
                          maximum:
                            type: string
                            example: '50000'
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metmask/v2/fiats/sell
        samples-languages:
          - http
  /{partner}/v2/crypto/{orderType}:
    get:
      summary: Retrieve a list of cryptocurrencies
      description: Retrieve all available cryptocurrencies supported by Banxa.
      operationId: retrieve-a-list-of-cryptocurrencies
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: orderType
          in: path
          description: >-
            Determines availability for Buy or Sell orders. By default if this
            value is not passed, then fiat availability for Buy orders will be
            returned.
          schema:
            type: string
            default: buy
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |
                    [
                      {
                        "id": "AAVE",
                        "description": "Ethereum (ERC-20)",
                        "blockchains": [
                          {
                            "id": "ETH",
                            "description": "Ethereum (ERC-20)",
                            "isDefaultBlockchain": true,
                            "address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
                            "network": "1",
                            "minimum": "1",
                            "unsupportedCountries": {
                              "CA": [],
                              "US": ["NY", "CT", "WV", "OK"]
                            }
                          }
                        ]
                      },
                      {
                        "id": "USDC",
                        "description": "Ethereum (ERC-20)",
                        "blockchains": [
                          {
                            "id": "ETH",
                            "description": "Ethereum (ERC-20)",
                            "isDefaultBlockchain": true,
                            "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                            "network": "1",
                            "minimum": "1",
                            "unsupportedCountries": []
                          }
                        ]
                      },
                      {
                        "id": "USDT",
                        "description": "Polygon",
                        "blockchains": [
                          {
                            "id": "MATIC",
                            "description": "Polygon",
                            "isDefaultBlockchain": false,
                            "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
                            "network": "137",
                            "minimum": "10",
                            "unsupportedCountries": []
                          },
                          {
                            "id": "BSC",
                            "description": "Binance Smart Chain",
                            "isDefaultBlockchain": false,
                            "address": "0x55d398326f99059ff775485246999027b3197955",
                            "network": "56",
                            "minimum": "50",
                            "unsupportedCountries": []
                          },
                          {
                            "id": "TRON",
                            "description": "TRC20",
                            "isDefaultBlockchain": false,
                            "address": null,
                            "network": null,
                            "minimum": "0",
                            "unsupportedCountries": []
                          },
                          {
                            "id": "ZKSYNC",
                            "description": "zkSync",
                            "isDefaultBlockchain": false,
                            "address": null,
                            "network": null,
                            "minimum": "0",
                            "unsupportedCountries": []
                          },
                          {
                            "id": "OPTIMISM",
                            "description": "Optimistic Ethereum",
                            "isDefaultBlockchain": true,
                            "address": "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
                            "network": "10",
                            "minimum": "0",
                            "unsupportedCountries": []
                          },
                          {
                            "id": "STARK",
                            "description": "Starkware",
                            "isDefaultBlockchain": false,
                            "address": null,
                            "network": null,
                            "minimum": "0",
                            "unsupportedCountries": []
                          }
                        ]
                      }
                    ]
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: AAVE
                    description:
                      type: string
                      example: Ethereum (ERC-20)
                    blockchains:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            example: ETH
                          description:
                            type: string
                            example: Ethereum (ERC-20)
                          isDefaultBlockchain:
                            type: boolean
                            example: true
                            default: true
                          address:
                            type: string
                            example: '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'
                          network:
                            type: string
                            example: '1'
                          minimum:
                            type: string
                            example: '1'
                          unsupportedCountries:
                            type: object
                            properties:
                              CA:
                                type: array
                                items:
                                  type: object
                                  properties: {}
                              US:
                                type: array
                                items:
                                  type: string
                                  example: NY
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metmask/v2/crypto/buy
        samples-languages:
          - http
  /{partner}/v2/countries:
    get:
      summary: Retrieve a list of countries
      description: >-
        Provides a list of countries that are supported by Banxa. The list is
        the same regardless of whether a buy or sell order.
      operationId: retrieve-a-list-of-countries
      parameters:
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    [
                      {
                        "id": "US",
                        "description": "United States of America",
                        "states": [
                          {
                            "id": "AL",
                            "description": "Alabama"
                          }
                        ]
                      },
                      {
                        "id": "AE",
                        "description": "United Arab Emirates",
                        "states": []
                      },
                      {
                        "id": "DE",
                        "description": "Germany",
                        "states": []
                      }
                    ]
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: US
                    description:
                      type: string
                      example: United States of America
                    states:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            example: AL
                          description:
                            type: string
                            example: Alabama
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metamask/v2/countries
        samples-languages:
          - http
  /{partner}/v2/payment-methods/{orderType}:
    get:
      summary: Retrieve a list of payment methods
      description: Retrieve all available payment methods or filter by fiat.
      operationId: retrieve-a-list-of-payment-methods
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: orderType
          in: path
          description: >-
            Determines availability for Buy or Sell orders. By default if this
            value is not passed, then fiat availability for Buy orders will be
            returned.
          schema:
            type: string
            default: buy
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
        - name: fiat
          in: query
          description: >-
            If the fiat is passed, then all payment methods available for the
            fiat will be returned. If not provided, then return all payment
            methods will be returned.
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    [
                        {
                            "id": "apple-pay",
                            "name": "Apple Pay",
                            "description": "Conveniently buy digital currency using your personal VISA or MasterCard.",
                            "supportedFiats": [
                                "CAD",
                                "CZK",
                                "DKK",
                                "HKD",
                                "JPY",
                                "NOK",
                                "NZD",
                                "PLN",
                                "RUB",
                                "SEK",
                                "SGD",
                                "TRY"
                            ]
                        }
                    ]
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: apple-pay
                    name:
                      type: string
                      example: Apple Pay
                    description:
                      type: string
                      example: >-
                        Conveniently buy digital currency using your personal
                        VISA or MasterCard.
                    supportedFiats:
                      type: array
                      items:
                        type: string
                        example: CAD
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metamask/v2/payment-methods?fiat=USD
        samples-languages:
          - http
  /{partner}/v2/quotes/{orderType}:
    get:
      summary: Retrieve quotes
      description: >-
        Allows you to retrieve a detailed quote for a user order. This endpoint
        should only be called when a user requests a quote by providing the
        cryptocurrency, fiat, amounts and payment method. This endpoint is for
        dynamic quotations and not to retrieve a list of static prices that can
        be cached.  For all partners, the rate limit is capped at 500/minute for
        all endpoints combined which is tied to a single IP.
      operationId: retrieve-quotes
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: orderType
          in: path
          description: >-
            Determines availability for Buy or Sell orders. By default if this
            value is not passed, then fiat availability for Buy orders will be
            returned.
          schema:
            type: string
            default: buy
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
        - name: paymentMethodId
          in: query
          description: The payment method chosen by the user.
          required: true
          schema:
            type: string
        - name: crypto
          in: query
          description: This is the crypto type the customer wants to buy or sell.
          required: true
          schema:
            type: string
        - name: blockchain
          in: query
          description: The blockchain that the crypto token is associated with.
          required: true
          schema:
            type: string
        - name: fiat
          in: query
          description: This is the fiat type the customer wants to buy or sell.
          required: true
          schema:
            type: string
        - name: cryptoAmount
          in: query
          description: >-
            The amount of cryptocurrency the user wants to buy or sell. Either
            fiatAmount OR cryptoAmount must be provided. If both are provided,
            then cryptoAmount will be used.
          required: true
          schema:
            type: string
        - name: fiatAmount
          in: query
          description: >-
            The amount of fiat the user wants to buy or sell. Either fiatAmount
            OR cryptoAmount must be provided. If both are provided, then
            cryptoAmount will be used.
          required: true
          schema:
            type: string
        - name: externalCustomerId
          in: query
          description: >-
            The customer ID that you define. By passing this value, we will be
            able to provide the customer the most accurate pricing based on
            their customer details.
          schema:
            type: string
        - name: ipAddress
          in: query
          description: >-
            User’s IP address. Used to validate whether the user is in a
            location that is supported by Banxa. If invalid IP address or IP
            address associated to a country that is not supported, then an error
            will be returned..
          schema:
            type: string
        - name: discountCode
          in: query
          description: >-
            Allows you to configure the discount to your commission rate per
            quote. This can be a promotion code such as XMAS or a way to
            differentiate between your customers.
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "paymentMethodId": "debit-credit-card",
                        "cryptoAmount": "0.03564700",
                        "fiatAmount": "100.00",
                        "processingFee": "0.92", //This is the payment gateway fee. 
                        "networkFee": "1.67"
                      }
                Option 2 With Discount Code:
                  value: |-
                    [
                      {
                        "paymentMethodId": "debit-credit-card",
                        "cryptoAmount": "0.03564700",
                        "fiatAmount": "100.00",
                        "processingFee": "0.92",
                        "networkFee": "1.67",
                        "discount": {
                          "originalQuote": {
                            "originalCryptoAmount": "0.235214",
                            "orginalNetworkFee": "0.00",
                            "originalProcessingFee": "0.00",
                            "originalFiatAmount": "500.00"
                          },
                          "discountCode": "XMAS"
                        }
                      }
                    ]
              schema:
                oneOf:
                  - type: object
                    properties:
                      paymentMethodId:
                        type: string
                        example: debit-credit-card
                      cryptoAmount:
                        type: string
                        example: '0.03564700'
                      fiatAmount:
                        type: string
                        example: '100.00'
                      processingFee:
                        type: string
                        example: '0.92'
                      networkFee:
                        type: string
                        example: '1.67'
                  - title: Option 2 With Discount Code
                    type: array
                    items:
                      type: object
                      properties:
                        paymentMethodId:
                          type: string
                          example: debit-credit-card
                        cryptoAmount:
                          type: string
                          example: '0.03564700'
                        fiatAmount:
                          type: string
                          example: '100.00'
                        processingFee:
                          type: string
                          example: '0.92'
                        networkFee:
                          type: string
                          example: '1.67'
                        discount:
                          type: object
                          properties:
                            originalQuote:
                              type: object
                              properties:
                                originalCryptoAmount:
                                  type: string
                                  example: '0.235214'
                                orginalNetworkFee:
                                  type: string
                                  example: '0.00'
                                originalProcessingFee:
                                  type: string
                                  example: '0.00'
                                originalFiatAmount:
                                  type: string
                                  example: '500.00'
                            discountCode:
                              type: string
                              example: XMAS
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metamask/v2/quotes/buy
        samples-languages:
          - http
  /{partner}/v2/buy:
    post:
      summary: Create a buy order
      description: >-
        Allows your customer to create a buy crypto order with Banxa. Upon
        success, the response will contain a checkout URL which will be unique
        for the order. The customer will be redirected to this URL to complete
        the checkout process, which will expire after 1 minute if a redirect
        does not occur.
      operationId: create-a-buy-order
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - crypto
                - fiat
                - fiatAmount
                - cryptoAmount
                - walletAddress
                - redirectUrl
                - externalCustomerId
              properties:
                paymentMethodId:
                  type: string
                  description: The payment method chosen by the user.
                crypto:
                  type: string
                  description: This is the crypto type the customer wants to buy.
                blockchain:
                  type: string
                  description: >-
                    This is the blockchain that is associated with the crypto
                    token. If none is provided, then a default will be used.
                fiat:
                  type: string
                  description: This is the fiat type the customer wants to buy.
                fiatAmount:
                  type: string
                  description: >-
                    The amount of fiat the user wants to buy. Either fiatAmount
                    OR cryptoAmount must be provided. If both are provided, then
                    cryptoAmount will be used.
                cryptoAmount:
                  type: string
                  description: >-
                    The amount of crypto the user wants to buy. Either
                    fiatAmount OR cryptoAmount must be provided. If both are
                    provided, then cryptoAmount will be used.
                walletAddress:
                  type: string
                  description: >-
                    The user wallet address that Banxa will use to send the
                    crypto.
                walletAddressTag:
                  type: string
                  description: >-
                    Wallet tag or memo associated with the wallet address. This
                    is required when the Customer's wallet address has a Memo or
                    Tag such as BNB (Memo) and XRP (Tag).
                redirectUrl:
                  type: string
                  description: >-
                    The URL the user will be redirected to after the buy flow
                    has been completed. If the case of an order failure or
                    cancellation, then the returnUrl will be appended with the
                    status e.g. /?status=failure, /?status=cancel
                subPartnerId:
                  type: string
                  description: >-
                    Your defined ID for associating an order with. e.g. you may
                    use this to differentiate between channels such as Exchange,
                    Wallet, Web, Mobile.
                metadata:
                  type: string
                  description: >-
                    Free form string that you can use to send us any information
                    that will be returned in the Get Orders endpoint
                externalCustomerId:
                  type: string
                  description: >-
                    Unique customer reference provided by you. Used to check
                    whether customer has completed KYC.
                externalOrderId:
                  type: string
                  description: >-
                    An order ID that you may define and will be returned to you
                    in a Get Order call.
                discountCode:
                  type: string
                  description: >-
                    Allows you to configure the discount to your commission rate
                    per order. This can be a promotion code such as XMAS or a
                    way to differentiate between your customers.
                email:
                  type: string
                  description: >-
                    The user's email address that can be used to pre-populate
                    the Banxa form.
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n\_ \_ \"checkoutUrl\": \"https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx\",\n\_ \_ \"id\": \"191fa5b4b1f45e1cf784422e09317d56\", // This is the Banxa defined Order ID\n\_ \_ \"externalOrderId\": \"a4b427ccb872a1744b317456bd0d165f\", // If not provided, then this value will be null\n\_ \_ \"externalCustomerId\": \"awasdf-fg34fg-34hhsdf\",\n\_ \_ \"fiat\": \"CAD\",\n\_ \_ \"fiatAmount\": \"1000.00\",\n\_ \_ \"crypto\": \"USDC\",\n\_ \_ \"cryptoAmount\": null, // If not provided, then this value will be null.\n\_ \_ \"blockchain\": \"TRON\"\n}"
                With Discount Code:
                  value: |-
                    {
                        "checkoutUrl": "https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx",
                        "id": "191fa5b4b1f45e1cf784422e09317d56",
                        "externalId": "a4b427ccb872a1744b317456bd0d165f",
                        "externalCustomerId": "awasdf-fg34fg-34hhsdf",
                        "fiat": "CAD",
                        "fiatAmount": "1000.00",
                        "crypto": "USDC",
                        "cryptoAmount": "696.63",
                        "blockchain": "TRON",
                        "discountCode": "XMAS"
                    }
              schema:
                type: object
                properties:
                  checkoutUrl:
                    type: string
                    example: >-
                      https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx
                  id:
                    type: string
                    example: 191fa5b4b1f45e1cf784422e09317d56
                  externalId:
                    type: string
                    example: a4b427ccb872a1744b317456bd0d165f
                  externalCustomerId:
                    type: string
                    example: awasdf-fg34fg-34hhsdf
                  fiat:
                    type: string
                    example: CAD
                  fiatAmount:
                    type: string
                    example: '1000.00'
                  crypto:
                    type: string
                    example: USDC
                  cryptoAmount:
                    type: string
                    example: '696.63'
                  blockchain:
                    type: string
                    example: TRON
                  discountCode:
                    type: string
                    example: XMAS
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metamask/v2/buy
        samples-languages:
          - http
  /{partner}/v2/orders/{orderId}:
    get:
      summary: Retrieve a specific order
      description: Retrieves details for single order.
      operationId: retrieve-a-specific-order
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
        - name: orderId
          in: path
          description: The Banxa Order ID to be retrieved.
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    createdAt: '2022-08-22T09:10:43.724Z'
                    updatedAt: '2022-08-22T09:13:56.165Z'
                    id: 191fa5b4b1f45e1cf784422e09317d56
                    externalId: a4b427ccb872a1744b317456bd0d165f
                    externalCustomerId: testing123
                    country: US
                    orderStatusUrl: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                    orderType: BUY
                    crypto:
                      id: USDC
                      blockchain: TRON
                      address: '0x0000000000000000000000000000000000000000'
                      network: '1'
                    fiat: CAD
                    fiatAmount: '1000.00'
                    cryptoAmount: '696.63'
                    paymentMethodId: apple-pay
                    paymentMethodName: Apple Pay
                    processingFee: '0.30'
                    networkFee: '1.67'
                    transactionHash: >-
                      0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                    walletAddress: '0x75b8d4d81377d4b0f11798779563462264914a24'
                    walletAddressTag: '1651352'
                    status: completed
                    metadata: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
                With Discount Code:
                  value:
                    orders:
                      - createdAt: '2022-08-22T09:10:43.724Z'
                        updatedAt: '2022-08-22T09:13:56.165Z'
                        id: 191fa5b4b1f45e1cf784422e09317d56
                        externalId: a4b427ccb872a1744b317456bd0d165f
                        externalCustomerId: testing123
                        country: US
                        orderStatusUrl: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                        orderType: BUY
                        crypto:
                          id: USDC
                          blockchain: TRON
                          address: '0x0000000000000000000000000000000000000000'
                          network: '1'
                        fiat: CAD
                        fiatAmount: '1000.00'
                        cryptoAmount: '696.63'
                        paymentMethodId: aabkd8792kd
                        paymentMethodName: debit-credit-card
                        processingFee: '0.30'
                        networkFee: '1.67'
                        partnerFee: '0.03'
                        discount:
                          originalQuote:
                            originalCryptoAmount: '0.235214'
                            orginalNetworkFee: '0.00'
                            originalProcessingFee: '0.00'
                            originalFiatAmount: '500.00'
                          discountCode: XMAS
                        transactionHash: >-
                          0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                        walletAddress: '0x75b8d4d81377d4b0f11798779563462264914a24'
                        walletAddressTag: '1651352'
                        status: completed
                        metadata: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
                    pageTotal: 100
                    total: 2654
              schema:
                type: object
                properties:
                  createdAt:
                    type: string
                    example: '2022-08-22T09:10:43.724Z'
                  updatedAt:
                    type: string
                    example: '2022-08-22T09:13:56.165Z'
                  id:
                    type: string
                    example: 191fa5b4b1f45e1cf784422e09317d56
                  externalId:
                    type: string
                    example: a4b427ccb872a1744b317456bd0d165f
                  externalCustomerId:
                    type: string
                    example: testing123
                  country:
                    type: string
                    example: US
                  orderStatusUrl:
                    type: string
                    example: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                  orderType:
                    type: string
                    example: BUY
                  crypto:
                    type: object
                    properties:
                      id:
                        type: string
                        example: USDC
                      blockchain:
                        type: string
                        example: TRON
                      address:
                        type: string
                        example: '0x0000000000000000000000000000000000000000'
                      network:
                        type: string
                        example: '1'
                  fiat:
                    type: string
                    example: CAD
                  fiatAmount:
                    type: string
                    example: '1000.00'
                  cryptoAmount:
                    type: string
                    example: '696.63'
                  paymentMethodId:
                    type: string
                    example: apple-pay
                  paymentMethodName:
                    type: string
                    example: Apple Pay
                  processingFee:
                    type: string
                    example: '0.30'
                  networkFee:
                    type: string
                    example: '1.67'
                  transactionHash:
                    type: string
                    example: >-
                      0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                  walletAddress:
                    type: string
                    example: '0x75b8d4d81377d4b0f11798779563462264914a24'
                  walletAddressTag:
                    type: string
                    example: '1651352'
                  status:
                    type: string
                    example: completed
                  metadata:
                    type: string
                    example: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: >-
              https://api.banxa.com/metamask/v2/orders/orderId=a4b427ccb872a1744b317456bd0d165f
        samples-languages:
          - http
  /{partner}/v2/orders:
    get:
      summary: Retrieve a list of orders
      description: >-
        Retrieves details for a bulk of orders that have been submitted within a
        given time range and optionally by order status or customer.
      operationId: retrieve-a-list-of-orders
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
        - name: start
          in: query
          description: >-
            The start date of the dataset in UTC. This is inclusive: orders
            created at this exact date will be included.
          required: true
          schema:
            type: string
        - name: end
          in: query
          description: >-
            The end date of the dataset in UTC. This is inclusive: orders
            created at this exact date will be included.
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: The number of orders to skip in the dataset.
          schema:
            type: string
        - name: page
          in: query
          description: The page of orders that are returned.
          schema:
            type: string
        - name: externalCustomerId
          in: query
          description: >-
            Indicates the customer identifier that was used when creating the
            order. Orders will be filtered based on orders made by this
            customer.
          schema:
            type: string
        - name: status
          in: query
          description: >-
            Indicates the current status of the order. One or many statuses can
            be passed.
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            The limit of orders that are returned. If not provided, then default
            to 100 records.
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    orders:
                      - createdAt: '2022-08-22T09:10:43.724Z'
                        updatedAt: '2022-08-22T09:13:56.165Z'
                        id: 191fa5b4b1f45e1cf784422e09317d56
                        externalId: a4b427ccb872a1744b317456bd0d165f
                        externalCustomerId: testing123
                        country: US
                        orderStatusUrl: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                        orderType: BUY
                        crypto:
                          id: USDC
                          blockchain: TRON
                          address: '0x0000000000000000000000000000000000000000'
                          network: '1'
                        fiat: CAD
                        fiatAmount: '1000.00'
                        cryptoAmount: '696.63'
                        paymentMethodId: aabkd8792kd
                        paymentMethodName: debit-credit-card
                        processingFee: '0.30'
                        networkFee: '1.67'
                        transactionHash: >-
                          0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                        walletAddress: '0x75b8d4d81377d4b0f11798779563462264914a24'
                        walletAddressTag: '1651352'
                        status: completed
                        metadata: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
                      - createdAt: '2022-08-22T09:10:43.724Z'
                        updatedAt: '2022-08-22T09:13:56.165Z'
                        id: 191fa5b4b1f45e1cf784422e09317d56
                        externalId: a4b427ccb872a1744b317456bd0d165f
                        externalCustomerId: testing123
                        orderStatusUrl: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                        orderType: BUY
                        crypto:
                          id: USDC
                          blockchain: TRON
                          address: '0x0000000000000000000000000000000000000000'
                          network: '1'
                        fiat: CAD
                        fiatAmount: '1000.00'
                        cryptoAmount: '696.63'
                        paymentMethodId: aabkd8792kd
                        paymentMethodName: debit-credit-card
                        processingFee: '0.30'
                        networkFee: '1.67'
                        partnerFee: '0.03'
                        transactionHash: >-
                          0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                        walletAddress: '0x75b8d4d81377d4b0f11798779563462264914a24'
                        walletAddressTag: '1651352'
                        status: completed
                        metadata: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
                    pageTotal: 100
                    total: 2654
              schema:
                type: object
                properties:
                  orders:
                    type: array
                    items:
                      type: object
                      properties:
                        createdAt:
                          type: string
                          example: '2022-08-22T09:10:43.724Z'
                        updatedAt:
                          type: string
                          example: '2022-08-22T09:13:56.165Z'
                        id:
                          type: string
                          example: 191fa5b4b1f45e1cf784422e09317d56
                        externalId:
                          type: string
                          example: a4b427ccb872a1744b317456bd0d165f
                        externalCustomerId:
                          type: string
                          example: testing123
                        country:
                          type: string
                          example: US
                        orderStatusUrl:
                          type: string
                          example: https//banxa.status/a4b427ccb872a1744b317456bd0d165f
                        orderType:
                          type: string
                          example: BUY
                        crypto:
                          type: object
                          properties:
                            id:
                              type: string
                              example: USDC
                            blockchain:
                              type: string
                              example: TRON
                            address:
                              type: string
                              example: '0x0000000000000000000000000000000000000000'
                            network:
                              type: string
                              example: '1'
                        fiat:
                          type: string
                          example: CAD
                        fiatAmount:
                          type: string
                          example: '1000.00'
                        cryptoAmount:
                          type: string
                          example: '696.63'
                        paymentMethodId:
                          type: string
                          example: aabkd8792kd
                        paymentMethodName:
                          type: string
                          example: debit-credit-card
                        processingFee:
                          type: string
                          example: '0.30'
                        networkFee:
                          type: string
                          example: '1.67'
                        partnerFee:
                          type: string
                          default: ''
                        transactionHash:
                          type: string
                          example: >-
                            0x5ea06c4724e8119704a1b57c918acf31742eb06cdf3f8678fdb17f41bbaf968e
                        walletAddress:
                          type: string
                          example: '0x75b8d4d81377d4b0f11798779563462264914a24'
                        walletAddressTag:
                          type: string
                          example: '1651352'
                        status:
                          type: string
                          example: completed
                        metadata:
                          type: string
                          example: '{''tracking_id'': ''HSKJDGHKSJG0393LJKJF''}'
                  pageTotal:
                    type: integer
                    example: 100
                    default: 0
                  total:
                    type: integer
                    example: 2654
                    default: 0
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: >-
              https://api.banxa.com/metamask/v2/orders?start=2022-08-22T09:10:43.724Z&end=2022-08-22T09:10:43.724Z&limit=2&externalCustomerId=testing123&status=pendingPayment,completed
        samples-languages:
          - http
  /{partner}/v2/sell:
    post:
      summary: Create a sell order
      description: >-
        Allows your customer to create a sell crypto order with Banxa. Upon
        success, the response will contain a checkout URL which will be unique
        for the order. The customer will be redirected to this URL to complete
        the checkout process, which will expire after 1 minute if a redirect
        does not occur.
      operationId: create-a-sell-order-2
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
        - name: x-api-key
          in: header
          description: This is the API Key that has been provided to you during onboarding.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - crypto
                - fiat
                - fiatAmount
                - cryptoAmount
                - walletAddress
                - redirectUrl
                - externalCustomerId
              properties:
                paymentMethodId:
                  type: string
                  description: The payment method chosen by the user.
                crypto:
                  type: string
                  description: This is the crypto type the customer wants to sell.
                blockchain:
                  type: string
                  description: >-
                    This is the blockchain that is associated with the crypto
                    token. If none is provided, then a default will be used.
                fiat:
                  type: string
                  description: This is the fiat type the customer wants to sell.
                fiatAmount:
                  type: string
                  description: >-
                    The amount of fiat the user wants to sell. Either fiatAmount
                    OR cryptoAmount must be provided. If both are provided, then
                    cryptoAmount will be used.
                cryptoAmount:
                  type: string
                  description: >-
                    The amount of crypto the user wants to sell. Either
                    fiatAmount OR cryptoAmount must be provided. If both are
                    provided, then cryptoAmount will be used.
                walletAddress:
                  type: string
                  description: >-
                    The wallet address that the user will use to send the
                    crypto. This will also be the wallet address used for
                    refunds if a refund is necessary.
                redirectUrl:
                  type: string
                  description: >-
                    The URL the user will be redirected to after the buy flow
                    has been completed. If the case of an order failure or
                    cancellation, then the returnUrl will be appended with the
                    status e.g. /?status=failure, /?status=cancel
                subPartnerId:
                  type: string
                  description: >-
                    Your defined ID for associating an order with. e.g. you may
                    use this to differentiate between channels such as Exchange,
                    Wallet, Web, Mobile.
                metadata:
                  type: string
                  description: >-
                    Free form string that you can use to send us any information
                    that will be returned in the Get Orders endpoint
                externalCustomerId:
                  type: string
                  description: >-
                    Unique customer reference provided by you. Used to check
                    whether customer has completed KYC.
                externalOrderId:
                  type: string
                  description: >-
                    An order ID that you may define and will be returned to you
                    in a Get Order call.
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n\_ \_ \"checkoutUrl\": \"https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx\",\n\_ \_ \"id\": \"191fa5b4b1f45e1cf784422e09317d56\", // This is the Banxa defined Order ID\n\_ \_ \"externalOrderId\": \"a4b427ccb872a1744b317456bd0d165f\", // If not provided, then this value will be null\n\_ \_ \"externalCustomerId\": \"awasdf-fg34fg-34hhsdf\",\n\_ \_ \"fiat\": \"CAD\",\n\_ \_ \"fiatAmount\": \"1000.00\",\n\_ \_ \"crypto\": \"USDC\",\n\_ \_ \"cryptoAmount\": null, // If not provided, then this value will be null.\n\_ \_ \"blockchain\": \"TRON\"\n}"
                test:
                  value: "{\n\_ \_ \"checkoutUrl\": \"https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx\",\n\_ \_ \"id\": \"191fa5b4b1f45e1cf784422e09317d56\", // This is the Banxa defined Order ID\n\_ \_ \"externalOrderId\": \"a4b427ccb872a1744b317456bd0d165f\", // If not provided, then this value will be null\n\_ \_ \"externalCustomerId\": \"awasdf-fg34fg-34hhsdf\",\n\_ \_ \"fiat\": \"CAD\",\n\_ \_ \"fiatAmount\": \"1000.00\",\n\_ \_ \"crypto\": \"USDC\",\n\_ \_ \"cryptoAmount\": null, // If not provided, then this value will be null.\n\_ \_ \"blockchain\": \"TRON\"\n}"
      deprecated: false
      security: []
      x-readme:
        code-samples:
          - language: http
            code: https://api.banxa.com/metamask/v2/sell
        samples-languages:
          - http
  /{partner}/v2/identities/token/share:
    post:
      summary: Share identity token
      description: >-
        Share a customer's Sumsub identity token with Banxa before creating an
        order. Banxa uses the token to retrieve KYC details directly from
        Sumsub, reducing re-verification friction in the checkout flow.


        Requires HMAC authorization.
      operationId: share-identity-token
      parameters:
        - name: partner
          in: path
          description: >-
            This is the partner code provided to you during onboarding. e.g.
            metamask.
          schema:
            type: string
          required: true
        - name: Accept
          in: header
          schema:
            type: string
            default: application/json
          description: ''
        - in: header
          name: Authorization
          schema:
            type: string
          description: Authorization
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - externalCustomerId
                - provider
                - mobileNumber
                - email
              properties:
                externalCustomerId:
                  type: string
                  description: Unique customer reference provided by you.
                email:
                  type: string
                  description: The user's email address
                mobileNumber:
                  type: string
                  description: The customer mobile number
                provider:
                  type: object
                  properties:
                    vendor:
                      type: string
                      default: ''
                      description: The identity provider e.g. sumsub
                    token:
                      type: string
                      description: The applicant token
                  required:
                    - token
                    - vendor
      responses:
        '202':
          description: '202'
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalCustomerId:
                    type: string
                required:
                  - externalCustomerId
      deprecated: false
      x-readme: {}
      security: []
x-readme:
  headers:
    - key: x-api-key
      value: xxxxxxxxxxxxxxxxxx
  explorer-enabled: false
  proxy-enabled: false
x-readme-fauxas: true
