> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/order-session-contents/retrieve-price-based-on-geolocation.md).

# Retrieve price based on geolocation

Use the **getPrice** method to retrieve product prices based on geolocation.&#x20;

To display product prices on your website without having the geolocation feature, you can use the getPrice API method, as described below.

### Request sample <a href="#request-example" id="request-example"></a>

```javascript
var data = {
    PRODS: ' 12345678', // product ID
    OPTIONS 12345678: '', // product pricing options if any
    QTY: 1, //product quantity
    CURRENCY: 'EUR', //product currency
    COUPON: null, //discount to be applied
    RESPONSE_TYPE: 'JSON'
};
$.ajax({
    type: 'GET',
    url: 'https://' + window.location.host + '/action/get_price.php',
    data: data,
    success: function (data) {
        // your code here
    },
    error: function (error) {
        console.error(error);
    },
});
```

A built URL that displays prices based on the customer's geolocation would look like this:

```apache
https://secure.2checkout.com/action/get_price.php?PRODS=12345678&OPTIONS12345678&QTY=1&CURRENCY=EUR&COUPON=null&RESPONSE_TYPE=JSON
```

{% hint style="info" %}
The quantity parameter is used **only** to retrieve the unit price with volume discounts if this was applied to the product. Setting quantity=2 in the request will not return the price for quantity 2, but it will return the unit price corresponding to the quantity interval specified.

For example if the unit price is:

Quantity =1 to 10 = 100USD

Quantity= 10+ = 90USD

A request with quantity 11 will not return 1100USD, it will return 90USD. While a call with quantity= 5, will return 100USD, not 500USD.&#x20;
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.2checkout.com/json-rpc-api-reference/json-rpc-api-6.0/api-requests/order-session-contents/retrieve-price-based-on-geolocation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
