---
api: 'Crypto Ramp API'
---

# Retrieve a redirect URL

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).

## Endpoint

GET `/buy`

## Parameters

### header parameters

- `X-API-KEY` (any, optional)
  Your API key that you received during integration setup. 
  For more information, see the **Authorization** section.

### query parameters

- `fiat` (string, required)
  The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the selected fiat currency to use for the purchase.

- `amount` (number, required)
  The fiat amount to exchange for crypto.

- `crypto` (string, required)
  The ID of the crypto token to purchase, obtained from the [`/config`](/docs/api/crypto-ramp#retrieve-configuration) endpoint.

- `payment` (enum, required)
  The selected [payment option](/docs/guides/crypto-ramp/introduction-to-revolut-ramp/coverage-and-other-details/payment-options).
  Possible enum values:

  - `card`
  - `revolut`
  - `apple-pay`
  - `google-pay`

- `region` (string, required)
  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.

- `wallet` (string, required)
  The address of the crypto wallet into which to transfer the purchased token.

- `orderId` (string, optional)
  The external identifier of the order to be made.
  Should be either UUID or ULID.

- `feePercentage` (number, optional)
  The fee percentage that will be applied for the order as partner fee.

- `partnerRedirectUrl` (string, optional)
  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.

- `additionalProperties` (string, optional)
  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.

## Returns

### 200

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`.
:::

#### Response attributes

- `ramp_redirect_url` (string)
    The URL to Revolut Ramp to which to redirect the customer for the purchase.

## Error responses

| HTTP status code | Description |
| --- | --- |
| 400 | Bad request  A request parameter is invalid. |
| 401 | Unauthorized |
| 429 | Too Many Requests |
| 500 | Server error  An unexpected error occurred. |
| 503 | The endpoint is disabled by Kill Switch |
