> For the complete documentation index, see [llms.txt](https://docs.swapped.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swapped.com/swapped-ramp/endpoints/onramp-endpoints/get-current-price.md).

# Get Current Price

This endpoint breaks down cryptocurrency purchase pricing, including fees, markups, and conversions, so that you can display accurate costs to your users before order creation.

**All pricing information can be retrieved with a POST request.**

URL: <https://widget.swapped.com/api/v1/merchant/pricing>

#### Request Data:

```json
{
    "api_key": "",
    "payment_method": "creditcard",
    "fiat_currency": "USD",
    "fiat_amount": 500,
    "crypto_currency": "ETH",
    "crypto_amount": 1,
    "region": "BE"
}
```

**Note:** The <mark style="color:red;">`crypto_amount`</mark> and <mark style="color:red;">`fiat_amount`</mark> fields are optional. If only one is provided, the other is calculated based on the current exchange rate.

**Note:** <mark style="color:red;">`payment_method`</mark> value must be a valid [payment group](https://widget.swapped.com/api/v1/merchant/get_payment_methods), and <mark style="color:red;">`region`</mark> is required, or the request will fail.

#### Markup Parameter

Optionally, the <mark style="color:red;">`markup`</mark> parameter can be used to apply a different markup on a per-request basis without modifying your merchant default.

#### Request Data with Markup:

```json
{
    "api_key": "",
    "payment_method": "creditcard",
    "fiat_currency": "USD",
    "fiat_amount": 500,
    "crypto_currency": "ETH",
    "crypto_amount": 1,
    "markup": 3,
    "region": "BE"
}
```

### Request Definition:

* `api_key`: The merchant's public key. Identifies the requesting merchant.
* `payment_method`: Payment method to use (e.g., `creditcard`).
  * [Get valid methods via the payment methods endpoint.](/swapped-ramp/endpoints/onramp-endpoints/get-payment-methods.md)
* `fiat_currency`: The fiat currency you want to query. For the full list of supported currencies, see [here](/swapped-ramp/readme-1/supported-fiat-currencies.md).
* `fiat_amount`: The fiat amount you want to convert.
* `crypto_currency`: The cryptocurrency you want to convert to. For the full list of supported currencies, see [here](/swapped-ramp/readme-1/supported-cryptocurrencies.md).
* `crypto_amount`: The cryptocurrency amount you want to convert to.
* `region`: The 2-letter ISO-3166 code of the country the method is available in.
* `markup`: An additional fee applied to the cryptocurrency purchase price. Value must be between 0 and 5.

## Response data:

```json
{
    "success": true,
    "data": {
        "crypto_amount": 0.12284,
        "crypto_currency": "ETH",
        "crypto_unit_price": 4070.34,
        "network_fee": 0.2,
        "network_fee_local": 0.24,
        "fiat_amount_incl_fees": 440.85,
        "fiat_amount_excl_fees": 424.61,
        "fiat_amount_incl_fees_local": 519.12,
        "fiat_amount_excl_fees_local": 500,
        "fiat_currency": "USD",
        "markup_fiat_value": 20,
        "processing_fee": 19.11,
        "payment_method": "creditcard-extra",
        "payment_group": "creditcard"
    }
}
```

### Response Definition:

* `crypto_amount`: Amount of crypto the user will receive (e.g., 0.14137 ETH).
* `crypto_currency`: The crypto token used (e.g., "ETH").
* `crypto_unit_price`: Price per 1 unit of crypto in the given fiat (e.g., 3536.82 EUR per ETH).
* `network_fee`: Network fee in EUR.
* `network_fee_local`: Provides the network fee amount converted to the user's local fiat currency.
* `fiat_amount_incl_fees`: Fiat value the user is paying, including fees, in EUR.
* `fiat_amount_excl_fees`: Fiat value the user is paying, excluding fees, in EUR.
* `fiat_amount_incl_fees_local`: Total fiat paid, including fees, in user’s fiat currency (e.g., USD).
* `fiat_amount_excl_fees_local`: Total fiat paid, excluding fees, in user’s fiat currency (e.g., USD).
* `fiat_currency`: The local fiat currency (e.g., "USD").
* `markup_fiat_value`: Additional markup displayed in fiat.
* `processing_fee`: Total processing fee in local fiat (e.g., 19.21 EUR).
* `payment_method`: The payment method used for the order.
* `payment_group`: The payment group the method belongs to.

{% hint style="danger" %}
All <kbd><mark style="color:red;">/merchant/<mark style="color:red;"></kbd> endpoints are subject to a global rate limit of **100 requests per second**. Exceeding this limit may result in throttling.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.swapped.com/swapped-ramp/endpoints/onramp-endpoints/get-current-price.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
