openapi: 3.1.1
info:
  version: 2.0.0
  title: Crypto Ramp API
  description: |-
    Revolut’s Crypto Ramp API allows you to integrate with Revolut and redirect users directly to our checkout page, providing a smooth onramping experience for your users.
    The API endpoints are organised into thematic groups and let you leverage the following features:
    - [Partners](/docs/api/crypto-ramp#tag-partners) - poll different exchange rates, display them on your website and compare with other providers
    - [Webhooks](/docs/api/crypto-ramp#tag-webhooks) - track order and payment lifecycle with webhooks

    For more information, see the guides: [Leverage the Crypto Ramp API](/docs/guides/crypto-ramp/tutorials/use-the-api) and [Work with Webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks)
servers:
  - url: https://ramp-partners.revolut.com/partners/api/2.0
tags:
  - name: Partners
    description: >-
      The **Partners** endpoints let you poll different exchange rates, display
      them on your website and compare them with other providers.


      For more details, see the guides: [Leverage the Crypto Ramp
      API](/docs/guides/crypto-ramp/tutorials/use-the-api).
  - name: Webhooks
    description: |-
      A webhook (also called a web callback) allows your system to receive an event from Ramp immediately after it happens.
      With the **Webhooks** endpoints, you can create, update, delete, and retrieve webhooks, as well as retrieve webhooks that you have created.

      For more details, see the guides: [Work with Webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks) and [-> Verify the payload signature](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/verify-the-payload-signature).
paths:
  /config:
    get:
      operationId: retrieve-configuration
      tags:
        - Partners
      summary: Retrieve configuration
      description: |-
        Retrieve Revolut Ramp configuration, such as available fiat currencies and crypto tokens with corresponding limits and supported countries.

        For more information, see the guides: [Leverage the Crypto Ramp API -> Get your configuration details](/docs/guides/crypto-ramp/tutorials/use-the-api#get-your-configuration-details).
      parameters:
        - $ref: "#/components/parameters/XApiKey"
      security:
        - AccessToken: []
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Config"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Config/example"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /quote:
    get:
      operationId: retrieve-an-order-quote
      tags:
        - Partners
      summary: Retrieve an order quote
      description: |-
        Retrieve an order quote representing current exchange rate, total crypto amount and fees.
        Use it to display potential exchange rate to your customer.

        For more information, see the guides: [Leverage the Crypto Ramp API -> Get an order quote](/docs/guides/crypto-ramp/tutorials/use-the-api#get-an-order-quote).
      security:
        - AccessToken: []
      parameters:
        - in: query
          name: fiat
          description: The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the
            selected fiat currency to use for the purchase.
          required: true
          schema:
            $ref: "#/components/schemas/Currency"
        - in: query
          name: amount
          description: The fiat amount to exchange for crypto.
          required: true
          schema:
            type: number
            format: float
        - in: query
          name: crypto
          description: The ID of the crypto token to purchase, obtained from the
            [`/config`](/docs/api/crypto-ramp#retrieve-configuration) endpoint.
          required: true
          schema:
            type: string
        - in: query
          name: payment
          description: The selected [payment
            option](/docs/guides/crypto-ramp/introduction-to-revolut-ramp/coverage-and-other-details/payment-options).
          required: true
          schema:
            type: string
            enum:
              - card
              - revolut
              - apple-pay
              - google-pay
        - in: query
          name: region
          description: The [ISO 3166
            Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of
            the country of residence of the customer (end user) ordering the
            exchange.
          required: true
          schema:
            $ref: "#/components/schemas/CountryCode"
        - in: query
          name: feePercentage
          description: The fee percentage that will be applied for the order as partner fee.
          required: false
          schema:
            type: number
            format: float
        - in: query
          name: walletAddress
          description: The address of the crypto wallet into which the purchased token
            should be transferred.
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Quote"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Quote/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /buy:
    get:
      operationId: retrieve-a-redirect-url
      tags:
        - Partners
      summary: Retrieve a redirect URL
      description: |-
        Retrieve a redirect URL to the Ramp app widget for provided buy parameters. Use it to redirect the customer to Revolut Ramp to make the purchase.

        :::note
        The `amount` in the Redirect URL is provided in minor currency units.
        For example, GBP 12.00 is represented as `1200`.
        :::

        For more information, see the guides: [Leverage the Crypto Ramp API -> Get a Revolut Ramp Redirect URL](/docs/guides/crypto-ramp/tutorials/use-the-api#get-a-revolut-ramp-redirect-url).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: query
          name: fiat
          description: The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the
            selected fiat currency to use for the purchase.
          required: true
          schema:
            $ref: "#/components/schemas/Currency"
        - in: query
          name: amount
          description: The fiat amount to exchange for crypto.
          required: true
          schema:
            type: number
            format: float
        - in: query
          name: crypto
          description: The ID of the crypto token to purchase, obtained from the
            [`/config`](/docs/api/crypto-ramp#retrieve-configuration) endpoint.
          required: true
          schema:
            type: string
        - in: query
          name: payment
          description: The selected [payment
            option](/docs/guides/crypto-ramp/introduction-to-revolut-ramp/coverage-and-other-details/payment-options).
          required: true
          schema:
            type: string
            enum:
              - card
              - revolut
              - apple-pay
              - google-pay
        - in: query
          name: region
          description: The [ISO 3166
            Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of
            the country of residence of the customer (end user) ordering the
            exchange.
          required: true
          schema:
            $ref: "#/components/schemas/CountryCode"
        - in: query
          name: wallet
          description: The address of the crypto wallet into which to transfer the
            purchased token.
          required: true
          schema:
            type: string
        - in: query
          name: orderId
          description: |-
            The external identifier of the order to be made.
            Should be either UUID or ULID.
          schema:
            type: string
            format: uuid | ulid
        - in: query
          name: feePercentage
          description: The fee percentage that will be applied for the order as partner fee.
          required: false
          schema:
            type: number
            format: float
        - in: query
          name: partnerRedirectUrl
          description: The URL to which to redirect the customer after the purchase – for
            example, your website. If not provided, the customer is shown
            transaction result in Revolut Ramp.
          schema:
            type: string
        - in: query
          name: additionalProperties
          description: >-
            A prefix that allows passing arbitrary key-value pairs. 

            For each pair, the prefix and key should be separated by `.`.


            If such additional properties are provided, when you call the
            [`/orders`](/docs/api/crypto-ramp#retrieve-all-orders) endpoint,
            they are returned along with the order details.
          schema:
            type: string
            pattern: additionalProperties.[key]=[value]
      responses:
        "200":
          description: >-
            The requested redirect URL


            :::note

            The `amount` in the Redirect URL is provided in minor currency
            units.

            For example, GBP 12.00 is represented as `1200`.

            :::
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RampRedirectUrl"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/RampRedirectUrl/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /orders/{order_id}:
    get:
      operationId: retrieve-an-order
      tags:
        - Partners
      summary: Retrieve an order
      description: >-
        Retrieve an order by `order_id` provided in the path and the `wallet`
        address provided as a query parameter.


        For more information, see the guides: [Leverage the Crypto Ramp API ->
        Get an
        order](/docs/guides/crypto-ramp/tutorials/use-the-api#get-an-order).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: path
          name: order_id
          description: |-
            The external identifier of the order to retrieve.
            Should be either UUID or ULID.
          required: true
          schema:
            type: string
            format: uuid | ulid
        - in: query
          name: wallet
          description: The address of the crypto wallet into which the token transfer was
            ordered.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Order"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Order/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "404":
          $ref: "#/components/responses/NotFoundErrorResponse"
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /orders:
    get:
      operationId: retrieve-all-orders
      tags:
        - Partners
      summary: Retrieve all orders
      description: >-
        Retrieve all orders by date range.


        The results are sorted chronologically by the `created_at` date (i.e.
        oldest first).


        For more information, see the guides: [Leverage the Crypto Ramp API ->
        Get all
        orders](/docs/guides/crypto-ramp/tutorials/use-the-api#get-all-orders).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: query
          name: start
          description: >-
            The earliest date for the order creation date range (inclusive) in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.


            In other words, the "oldest" order creation date you are interested
            in.
          required: true
          schema:
            type: string
            format: date
        - in: query
          name: end
          required: true
          schema:
            type: string
            format: date
          description: >-
            The latest date for the order creation date range (inclusive) in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.


            In other words, the "most recent" order creation date you are
            interested in.
        - in: query
          name: skip
          schema:
            type: integer
            format: int32
            default: 0
          description: >-
            The number of orders to skip at the beginning of the range when
            fetching orders (sorted by creation date, oldest first).


            This means that if you set `skip=3`, the first three orders are
            skipped, and the list of orders that you get as a result will start
            with the order that would normally be 4th on the list.
        - in: query
          name: limit
          schema:
            type: integer
            format: int32
            default: 100
            minimum: 1
            maximum: 1000
          description: |-
            The maximum number of orders to fetch from the given range.
            Must be between `1` and `1000` (inclusive).
            Default value is `100`.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Orders"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Orders/example"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /webhooks/{webhook_id}:
    servers:
      - url: https://ramp-partners.revolut.com/partners/api/1.0
    get:
      operationId: retrieve-a-webhook
      tags:
        - Webhooks
      summary: Retrieve a webhook
      description: |-
        Get the details of a specific webhook.

        For more information, see the guides: [Work with webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: path
          name: webhook_id
          description: The ID of the webhook.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: The information about the webhook
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Webhook/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "404":
          $ref: "#/components/responses/NotFoundErrorResponse"
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
    patch:
      operationId: update-a-webhook
      tags:
        - Webhooks
      summary: Update a webhook
      description: |-
        Update the details of a specific webhook.

        For more information, see the guides: [Work with webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: path
          name: webhook_id
          description: The ID of the webhook.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookUpdateRequest"
      responses:
        "200":
          description: The successfully updated webhook
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Webhook/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "404":
          $ref: "#/components/responses/NotFoundErrorResponse"
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
    delete:
      operationId: delete-a-webhook
      tags:
        - Webhooks
      summary: Delete a webhook
      description: |-
        Delete a webhook so that events are not sent to the specified URL any more.

        For more information, see the guides: [Work with webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks).
      security:
        - AccessToken: []
      parameters:
        - $ref: "#/components/parameters/XApiKey"
        - in: path
          name: webhook_id
          description: The ID of the webhook.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "204":
          description: The webhook has been deleted
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "404":
          $ref: "#/components/responses/NotFoundErrorResponse"
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
  /webhooks:
    servers:
      - url: https://ramp-partners.revolut.com/partners/api/1.0
    get:
      operationId: retrieve-a-list-of-webhooks
      tags:
        - Webhooks
      summary: Retrieve a list of webhooks
      description: |-
        Get a list of webhooks that the partner is currently subscribed to.

        For more information, see the guides: [Work with webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks).
      parameters:
        - $ref: "#/components/parameters/XApiKey"
      security:
        - AccessToken: []
      responses:
        "200":
          description: The list of all your existing webhooks
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhooks"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Webhooks/example"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
    post:
      operationId: create-a-webhook
      tags:
        - Webhooks
      summary: Create a webhook
      description: |-
        Create a webhook so that Ramp can push event notifications to the specified URL.

        For more information, see the guides: [Work with webhooks -> Track order and payment lifecycle](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/use-webhooks).
      parameters:
        - $ref: "#/components/parameters/XApiKey"
      security:
        - AccessToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookCreateRequest"
      responses:
        "200":
          description: The successfully created webhook
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Webhook"
              examples:
                default:
                  value:
                    $ref: "#/components/schemas/Webhook/example"
        "400":
          $ref: "#/components/responses/BadRequestErrorResponse"
        "401":
          description: Unauthorized
        "429":
          description: Too Many Requests
        "500":
          $ref: "#/components/responses/ServerErrorResponse"
        "503":
          $ref: "#/components/responses/DisabledByKillSwitchErrorResponse"
components:
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: X-API-KEY
      description: |-
        Each Crypto Ramp API request must contain an authorization header in the following format to make a call: `X-API-KEY: {your_API_key}`. 

        Before you start, make sure that you have the correct API key. For more information, see the **Get started** guides: [Integrate with Revolut Ramp -> 2. Get Partner keys](/docs/guides/crypto-ramp/get-started/integrate-with-revolut-ramp#2-get-partner-keys).
  parameters:
    XApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: |-
        Your API key that you received during integration setup. 
        For more information, see the **Authorization** section.
      required: true
  schemas:
    Blockchain:
      type: string
      description: The cryptocurrency blockchain/network.
      enum:
        - BITCOIN
        - RIPPLE
        - BITCOINCASH
        - LITECOIN
        - ETHEREUM
        - DOGECOIN
        - CARDANO
        - STELLAR
        - POLKADOT
        - SOLANA
        - AVALANCHE
        - EOS
        - TEZOS
        - DASH
        - ALGORAND
        - CELO
        - SMARTCHAIN
        - POLYGON
        - FANTOM
        - OPTIMISM
        - COSMOS
        - KUSAMA
        - ETHEREUMCLASSIC
        - ETHEREUMPOW
        - HEDERAHASHGRAPH
        - TRON
        - KAVA
        - NEAR
        - SONGBIRD
        - FLARE
        - CELESTIA
        - BASE
    Config:
      type: object
      required:
        - version
        - countries
        - fiat
        - crypto
        - payment_methods
      properties:
        version:
          type: string
          description: The Revolut Ramp configuration version.
        countries:
          type: array
          description: The list of client countries supported by Ramp – for your customer
            to be able to use Revolut Ramp, they must be resident in one of
            those countries.
          items:
            $ref: "#/components/schemas/CountryCode"
        fiat:
          description: The supported fiat currencies and limits.
          type: array
          items:
            type: object
            description: The supported fiat currency and limits.
            required:
              - currency
              - min_limit
              - max_limit
            properties:
              currency:
                $ref: "#/components/schemas/CurrencyFiat"
                description: The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the
                  supported currency.
              min_limit:
                type: number
                format: float
                description: The minimum allowed amount.
              max_limit:
                type: number
                format: float
                description: The maximum allowed amount.
        crypto:
          type: array
          description: The list of cryptocurrencies supported by Revolut Ramp.
          items:
            type: object
            description: Supported crypto currency.
            required:
              - id
              - currency
              - blockchain
            properties:
              id:
                type: string
                description: >-
                  The unique identifier of the crypto currency-blockchain pair.

                  Should be used throughout the API to reference the specific
                  crypto.
                examples:
                  - USDT-ETH
              currency:
                $ref: "#/components/schemas/CurrencyCryptoCode"
              blockchain:
                $ref: "#/components/schemas/Blockchain"
              smartContractAddress:
                type: string
                description: The smart contract address. Returned only for tokens.
        feePercentages:
          description: The list of fee percentages that can be applied for the order as
            partner fee.
          type: array
          items:
            type: number
            format: float
        payment_methods:
          description: The list of available payment methods.
          type: array
          items:
            type: string
            enum:
              - card
              - revolut
              - apple-pay
              - google-pay
      examples:
        - version: 1.0.0
          countries:
            - GB
            - US
            - PT
            - FR
          fiat:
            - currency: GBP
              min_limit: 50
              max_limit: 500
            - currency: USD
              min_limit: 60
              max_limit: 600
            - currency: EUR
              min_limit: 60
              max_limit: 600
          crypto:
            - id: BTC
              currency: BTC
              blockchain: BITCOIN
            - id: ETH
              currency: ETH
              blockchain: ETHEREUM
            - id: USDT-ETH
              currency: USDT
              blockchain: ETHEREUM
              smartContractAddress: 1.2488751460129641e+48
            - id: USDT-OPTIMISM
              currency: USDT
              blockchain: OPTIMISM
              smartContractAddress: 8.488563199836144e+47
          feePercentages:
            - 0.8
            - 1
          payment_methods:
            - card
            - revolut
            - apple-pay
            - google-pay
    CountryCode:
      type: string
      description: The [ISO 3166
        Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of the
        country.
      examples:
        - GB
    Currency:
      type: string
      description: The fiat currency [ISO
        4217](https://en.wikipedia.org/wiki/ISO_4217) code or [cryptocurrency
        code](https://en.wikipedia.org/wiki/List_of_cryptocurrencies).
      examples:
        fiatCurrency:
          summary: Fiat currency
          value: GBP
        cryptoCurrency:
          summary: Cryptocurrency
          value: ETH
    CurrencyFiat:
      type: string
      format: ISO 4217
      description: The fiat currency [ISO
        4217](https://en.wikipedia.org/wiki/ISO_4217) code.
      examples:
        - GBP
    CurrencyCryptoCode:
      type: string
      description: The [cryptocurrency
        code](https://en.wikipedia.org/wiki/List_of_cryptocurrencies).
      examples:
        - ETH
    CurrencyCryptoId:
      type: string
      description: The ID of the currency, obtained from the
        [`/config`](/docs/api/crypto-ramp#retrieve-configuration) endpoint.
      examples:
        - USDT-ETH
    EventType:
      type: string
      description: Webhook event type
      enum:
        - ORDER_CREATED
        - ORDER_PROCESSING
        - ORDER_COMPLETED
        - ORDER_FAILED
    Money:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          format: float
          description: The amount.
        currency:
          $ref: "#/components/schemas/Currency"
      examples:
        - amount: 100
          currency: USD
    MoneyCryptoId:
      type: object
      required:
        - amount
        - currencyId
      properties:
        amount:
          type: number
          format: float
          description: The amount.
        currencyId:
          $ref: "#/components/schemas/CurrencyCryptoId"
      examples:
        - amount: 100
          currencyId: USDT-ETH
    MoneyCryptoCode:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          format: float
          description: The crypto amount.
        currency:
          $ref: "#/components/schemas/CurrencyCryptoCode"
      examples:
        - amount: 0.00889211
          currency: ETH
    MoneyFiat:
      type: object
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          format: float
          description: The amount.
        currency:
          $ref: "#/components/schemas/CurrencyFiat"
      examples:
        - amount: 100
          currency: USD
    Order:
      type: object
      description: Fiat to crypto exchange order
      required:
        - id
        - fiat
        - crypto
        - fees
        - exchange_rate
        - payment
        - created_at
        - updated_at
        - status
        - wallet
        - fees_partner_currency
      properties:
        id:
          type: string
          format: uuid
          description: The external UUID of the order.
        fiat:
          $ref: "#/components/schemas/MoneyFiat"
          description: The fiat amount that the customer paid for the crypto (excluding
            fees).
        crypto:
          $ref: "#/components/schemas/MoneyCryptoId"
          description: The crypto amount that the customer received.
        fees:
          type: object
          description: The fees for the order.
          required:
            - ramp_fee
            - partner_fee
            - network_fee
          properties:
            ramp_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Revolut Ramp fee.
            partner_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Partner fee.
            network_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Crypto network fee.
        exchange_rate:
          type: number
          format: float
          description: The exchange rate for the order.
        payment:
          type: string
          enum:
            - card
            - revolut
            - apple-pay
            - google-pay
          description: The [payment
            method](/docs/guides/crypto-ramp/introduction-to-revolut-ramp/coverage-and-other-details/payment-options)
            used for the purchase.
        created_at:
          type: string
          format: date-time
          description: The UTC date and time of order creation in [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        updated_at:
          type: string
          format: date-time
          description: The UTC date and time of order update in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        status:
          type: string
          enum:
            - AWAITING_PAYMENT
            - PROCESSING
            - COMPLETED
            - FAILED
          description: The state of order processing.
        fail_reason:
          type: string
          enum:
            - PAYMENT_NOT_RECEIVED
            - PAYMENT_DECLINED
            - CRYPTO_WITHDRAWAL_FAILED
            - OTHER
          description: The reason why the order failed.
        wallet:
          type: string
          description: The address of the crypto wallet into which the crypto transfer was
            ordered.
        transaction_hash:
          type: string
          description: |-
            The blockchain transaction hash.
            Absent if no crypto transaction has been created yet.
            Always present if order is in the `COMPLETED` state.
        additionalProperties:
          type: object
          description: The additional properties passed in the call to the
            [`/buy`](/docs/api/crypto-ramp#retrieve-a-redirect-url) endpoint
            under the `additionalProperties.*` query parameter(s), if such
            properties were provided.
          additionalProperties:
            type: string
        fees_partner_currency:
          type: object
          description: The fees converted to the partner's currency.
          required:
            - ramp_fee
            - partner_fee
            - network_fee
          properties:
            ramp_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Revolut Ramp fee.
            partner_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Partner fee.
            network_fee:
              $ref: "#/components/schemas/MoneyFiat"
              description: Crypto network fee.
      examples:
        - id: a01868cc-71ab-d2ed-a10b-0a32ac1c0b02
          fiat:
            amount: 101.22
            currency: USD
          crypto:
            amount: 0.10604352
            currencyId: ETH
          fees:
            ramp_fee:
              amount: 2.75
              currency: USD
            partner_fee:
              amount: 1.01
              currency: USD
            network_fee:
              amount: 0.91
              currency: USD
          exchange_rate: 0.00089088
          payment: card
          created_at: 2022-12-26T11:32:10Z
          updated_at: 2022-12-26T11:33:54Z
          status: COMPLETED
          wallet: "0x96e2B7Bf479f84e7A0a94f0620290B7D3E08f5EF"
          transaction_hash: 76cfb3b4f0acd595fa5b24036e86fd21d3c7b9887b2c8e3d4007598e4cbe6957
          fees_partner_currency:
            ramp_fee:
              amount: 2.35
              currency: EUR
            partner_fee:
              amount: 0.9
              currency: EUR
            network_fee:
              amount: 0.78
              currency: EUR
    Orders:
      type: array
      items:
        $ref: "#/components/schemas/Order"
      examples:
        - - $ref: "#/components/schemas/Order/example"
          - id: 3afb8396-1cee-4562-bd0f-5aea5e674da9
            fiat:
              amount: 11.55
              currency: GBP
            crypto:
              amount: 0.00889211
              currency: ETH
            fees:
              ramp_fee:
                amount: 2.4
                currency: GBP
              partner_fee:
                amount: 0.8
                currency: GBP
              network_fee:
                amount: 0.75
                currency: GBP
            exchange_rate: 0.00076988
            payment: card
            created_at: 2022-01-03T08:44:38Z
            updated_at: 2022-01-14T11:37:02Z
            status: COMPLETED
            wallet: 1PUyin99nPbdm3NTa2BViJ1JsEe8e8iAcs
            transaction_hash: d276938168a948e8eb5c99515baf9fb209c00b24c9521f0d4970c5e9f4dcc886
            fees_partner_currency:
              ramp_fee:
                amount: 2.89
                currency: EUR
              partner_fee:
                amount: 0.97
                currency: EUR
              network_fee:
                amount: 0.91
                currency: EUR
    Quote:
      type: object
      description: The exchange price between fiat and crypto currencies (including fees).
      required:
        - service_fee
        - network_fee
        - crypto
        - partner_fee
      properties:
        service_fee:
          $ref: "#/components/schemas/MoneyFiat"
          description: >-
            The sum of Revolut Ramp fee and Partner fee.


            :::note

            The Partner fee is also provided separately in the `partner_fee`
            parameter.

            :::
        network_fee:
          $ref: "#/components/schemas/MoneyFiat"
          description: Crypto network fee.
        crypto:
          $ref: "#/components/schemas/MoneyCryptoId"
          description: Crypto amount that the customer receives in the case of a
            successful exchange.
        partner_fee:
          $ref: "#/components/schemas/MoneyFiat"
          description: >-
            Partner fee.


            :::note

            This Partner fee is also included in the `service_fee` value, which
            represents the total sum of Partner fee and Revolut Ramp fee.

            :::
      examples:
        - service_fee:
            amount: 3.76
            currency: USD
          network_fee:
            amount: 0.91
            currency: USD
          crypto:
            amount: 0.10604352
            currencyId: ETH
          partner_fee:
            amount: 0.77
            currency: USD
    RampRedirectUrl:
      type: object
      description: Redirect URL to Ramp app widget
      required:
        - ramp_redirect_url
      properties:
        ramp_redirect_url:
          type: string
          format: uri
          description: The URL to Revolut Ramp to which to redirect the customer for the
            purchase.
      examples:
        - ramp_redirect_url: https://ramp.revolut.com?fiatCurrency=GBP&amount=12345&cryptoCurrency=ETH&walletAddress=0x96e2B7Bf479f84e7A0a94f0620290B7D3E08f5EF&countryCode=GB&partnerId=a01798bc-7f0b-14ed-a12b-0e3fac1209ad&externalOrderId=2d1769bc-7aab-92ed-a10b-0232ac12090d&disableFiatAmount=true&disableCryptoCurrency=true&disableWalletAddress=true&disableCountryCode=true&partnerRedirectUrl=https%3A%2F%2Fcrypto.partner.com%2Forder%3ForderId%3D2d1769bc-7aab-92ed-a10b-0232ac12090d
    Webhook:
      type: object
      description: Webhook
      required:
        - id
        - url
        - events
        - signing_secret
      properties:
        id:
          type: string
          format: uuid
          description: The UUID of the webhook.
        url:
          type: string
          format: uri
          description: >-
            The webhook's URL to which event notifications will be sent.

            Must be a valid HTTP or HTTPS URL, capable of receiving POST
            requests.
        events:
          type: array
          description: The list of event types that the webhook is configured to listen to.
          items:
            $ref: "#/components/schemas/EventType"
        signing_secret:
          type: string
          description: |-
            The [signing secret](/docs/guides/crypto-ramp/tutorials/work-with-webhooks/verify-the-payload-signature#webhook-signing-secret) for the webhook.
            Use it to verify the signature for the webhook's request payload.
      examples:
        - id: c518d8cc-114b-d2ed-a10b-0a32ac1c0e4f
          url: https://crypto.partner.com/revolut
          events:
            - ORDER_PROCESSING
            - ORDER_COMPLETED
          signing_secret: wsk_h1ETWMz2g1bB7gCONjNp84t2KSSIt7rs
    Webhooks:
      type: array
      items:
        $ref: "#/components/schemas/Webhook"
      examples:
        - - $ref: "#/components/schemas/Webhook/example"
          - id: fb39d967-4a73-4483-8e52-5842e1cad7ef
            url: https://crypto.partner.com/revolut
            events:
              - ORDER_PROCESSING
              - ORDER_COMPLETED
            signing_secret: wsk_8fT55z3C5hCr41l6B0b057D85s2043x4
          - id: 894b00c1-da1f-44bb-b887-62af2e0d3bad
            url: https://example.com
            events:
              - ORDER_PROCESSING
              - ORDER_COMPLETED
              - ORDER_CREATED
              - ORDER_FAILED
            signing_secret: wsk_7gH67v2D8jEt52n9M1c068F96t3152y7
    WebhookCreateRequest:
      type: object
      description: Webhook create parameters
      required:
        - url
        - events
      properties:
        url:
          type: string
          format: uri
          description: >-
            The webhook's URL to which event notifications will be sent.

            Must be a valid HTTP or HTTPS URL, capable of receiving POST
            requests.
        events:
          type: array
          description: The list of event types that the webhook is configured to listen to.
          items:
            $ref: "#/components/schemas/EventType"
      examples:
        - url: https://crypto.partner.com/revolut
          events:
            - ORDER_PROCESSING
            - ORDER_COMPLETED
    WebhookUpdateRequest:
      type: object
      description: Webhook update parameters
      properties:
        url:
          type: string
          format: uri
          description: >-
            The webhook's URL to which event notifications will be sent.

            Must be a valid HTTP or HTTPS URL, capable of receiving POST
            requests.
        events:
          type: array
          description: The list of event types that the webhook is configured to listen to.
          items:
            $ref: "#/components/schemas/EventType"
      examples:
        - url: https://crypto.partner.com/revolut
          events:
            - ORDER_PROCESSING
            - ORDER_COMPLETED
    BadRequestError:
      type: object
      description: Thrown when request parameter field is invalid
      required:
        - message
      properties:
        message:
          type: string
          description: Specifies the invalid parameter that was provided by the user.
      examples:
        - message: Invalid field 'FieldName'
    NotFoundError:
      type: object
      description: Thrown when resource can't be found
      required:
        - message
      properties:
        message:
          type: string
          description: The message displayed to the user when resource cannot be found.
      examples:
        - message: Not found
    DisabledByKillSwitchError:
      type: object
      description: Thrown when endpoint is disabled by Kill Switch.
      required:
        - message
      properties:
        message:
          type: string
          description: The message displayed to the user when endpoint is disabled by Kill
            Switch.
      examples:
        - message: Service is not available
    UnexpectedError:
      type: object
      description: Thrown when an unexpected error happens.
      required:
        - errorId
        - timestamp
      properties:
        errorId:
          type: string
          format: uuid
          description: The UUID of the unexpected error that has occurred.
        timestamp:
          type: integer
          format: int64
          description: The timestamp of when the error happened.
      examples:
        - errorId: 201768bc-7fab-12ed-a1bb-0232ac120902
          timestamp: 1671481582960
  responses:
    BadRequestErrorResponse:
      description: |-
        Bad request

        A request parameter is invalid.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
          examples:
            default:
              value:
                message: Invalid field 'FieldName'
    DisabledByKillSwitchErrorResponse:
      description: The endpoint is disabled by Kill Switch
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DisabledByKillSwitchError"
          examples:
            default:
              value:
                message: Service is not available
    ErrorResponse:
      description: An unexpected error occurred
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UnexpectedError"
          examples:
            default:
              value:
                errorId: 201768bc-7fab-12ed-a1bb-0232ac120902
                timestamp: 1671481582960
    NotFoundErrorResponse:
      description: Resource cannot be found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            default:
              value:
                message: Not found
    ServerErrorResponse:
      description: |-
        Server error

        An unexpected error occurred.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UnexpectedError"
          examples:
            default:
              value:
                errorId: 201768bc-7fab-12ed-a1bb-0232ac120902
                timestamp: 1671481582960
x-ext-urls: {}
