# Leverage the Crypto Ramp API

In addition to the [Revolut Ramp web app](https://ramp.revolut.com/), we provide our [Crypto Ramp API](/docs/api/crypto-ramp).
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) - use webhooks to [track order and payment lifecycle](work-with-webhooks/use-webhooks.md)

This tutorial shows you how to use the **Partner** endpoints and what you can do with them.

## Prerequisites

Before you begin, ensure that you have:

- Production [API Key (Access Token)](../get-started/integrate-with-revolut-ramp.md#2-get-partner-keys)
- (Optional) Access to the [Revolut Ramp testing environment](https://ramp.revolut.codes), if you just want to test the API

## Get your configuration details

When setting up your [integration with Revolut Ramp](../get-started/integrate-with-revolut-ramp.md#3-development-and-testing), you [configure](../introduction-to-revolut-ramp/configuration-options.md) it according to your needs.

To later fetch this configuration, make a `GET` call to the `/config` endpoint.

For more details and example requests and responses:

[See the API reference: Retrieve configuration](/docs/api/crypto-ramp#retrieve-configuration)

## Get an order quote

You can use this endpoint, for instance, to display up-to-date quotes to your customers on your website/in your application, or to compare our quotes with quotes offered by different providers.

To fetch a current order quote, make a `GET` call to the `/quote` endpoint providing the order's details as query parameters.
For instance, your request URL might look like this:

```shell
GET https://ramp-partners.revolut.com/partners/api/2.0/quote? \
fiat=GBP&amount=12&crypto=ETH&payment=revolut&region=GB
```

For more details and example requests and responses:

[See the API reference: Retrieve an order quote](/docs/api/crypto-ramp#retrieve-an-order-quote)

## Get a Revolut Ramp redirect URL

The Revolut Ramp redirect URL redirects your customers to the Revolut Ramp widget with the provided [purchase parameters already pre-filled](../introduction-to-revolut-ramp/configuration-options.md#pass-the-information-for-the-user).
You can use it to save the customer time or prevent the customer from modifying these values.

To obtain the redirect URL for given purchase parameters, make a `GET` call to the `/buy` endpoint providing the details for the order as query parameters.
For instance, your request URL might look like this:

```shell
GET https://ramp-partners.revolut.com/partners/api/2.0/buy? \
fiat=GBP&amount=12&crypto=ETH&payment=revolut&region=GB \
&wallet=1PUyin99nPbdm3NTa2BViJ1JsEe8e8iAcs \
&orderId=3afb8396-1cee-4562-bd0f-5aea5e674da9&partnerRedirectUrl=https://example.com
```

For more details and example requests and responses:

[See the API reference: Retrieve a redirect URL](/docs/api/crypto-ramp#retrieve-a-redirect-url)

## Get an order

To fetch details of a specific order, make a `GET` call to the `/orders/{orderId}` endpoint and provide the `wallet` query parameter – this is the address of the crypto wallet into which the token transfer was ordered.

Replace `{orderId}` with the actual ID of the order in question.

For instance, your request URL might look like this:

```shell
GET https://ramp-partners.revolut.com/partners/api/2.0/orders/a01868cc-71ab-d2ed-a10b-0a32ac1c0b02? \
wallet=1PUyin99nPbdm3NTa2BViJ1JsEe8e8iAcs
```

For more details and example requests and responses:

[See the API reference: Retrieve an order](/docs/api/crypto-ramp#retrieve-an-order)

## Get all orders

You can get a detailed list of all the orders made within a specified time span.
The results are sorted chronologically by the `created_at` date (i.e. oldest first).

To get these orders' details, make a `GET` call to the `/orders` endpoint.
Specify the time span by providing the `start` and `end` query parameters.

You can also limit the number of orders to fetch in the response, or skip a given number of orders by adding the optional query parameter to the URL.

:::details [Optional details]

- **Skip**: 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.
- **Limit**: The maximum number of orders to fetch from the given range. Must be between `1` and `1000` (inclusive). Default value is `100`.

:::

For instance, your request URL might look like this:

```shell
GET https://ramp-partners.revolut.com/partners/api/2.0/orders? \
start=2012-04-23&end=2022-01-15&skip=0&limit=100
```

For more details and example requests and responses:

[See the API reference: Retrieve all orders](/docs/api/crypto-ramp#retrieve-all-orders)

## What's next

Use the Crypto Ramp API to [track order and payment lifecycle with webhooks](work-with-webhooks/use-webhooks.md).