> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.greenlane.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.greenlane.ai/_mcp/server.

# Update price

POST https://pos.fuel.greenlane.ai/gfp/update_price
Content-Type: application/json

The `update_price` API allows for scheduling price updates for a particular site. By specifying an `effective_date`, future updates to prices can occur.
If price updates are made in real-time, the `effective_date` can be the current time. 
The API takes both a debit/cash price (retail price) and a credit price for each product.  If only a single price is available, use the `retail_price_per_unit` field. The API may be called as many times as prices change during the day, or in a set interval. Additional pricing data such as tax information and contract details between merchants will be provided separately (via email, ftp, etc). 
**Update Behavior:** The `effective_date` parameter governs whether this API will do an insert or a replacement. If there is an existing update with the same `effective_date`, the API will discard the original data and replace it with this request's data.
Updates with `effective_date` in the past will be rejected with a 400 Bad Request. There is a small tolerance allowing for clock skew. Real-time updates should use the current time to ensure they are  effective.

Reference: https://docs.greenlane.ai/greenlane-fuel-platform/update-price

## Authentication

- `Authorization` header (bearer token, required)

## Request

### Body (application/json)

- `merchant_id` (string, required)
- `site_id` (string, required)
- `pricing_update` (object, required)
  - `effective_date` (datetime, required)
  - `fuel_products` (list of object, required)
    - `product_code` (string, required)
    - `retail_price_per_unit` (double, required)
    - `unit_of_measure` (string, required)
    - `credit_price_per_unit` (double, required)

## Response

### 200

OK

- `merchant_id` (string, required)
- `site_id` (string, required)
- `next_pricing_updates` (list of object, required)
  - `effective_date` (datetime, required)
  - `fuel_products` (list of object, required)
    - `product_code` (string, required)
    - `retail_price_per_unit` (double, required)
    - `cost_price_per_unit` (double, required)
    - `credit_price_per_unit` (double, required)
    - `unit_of_measure` (string, required)

## Examples

**Request**

```json
{
  "merchant_id": "merchant-id",
  "site_id": "331",
  "pricing_update": {
    "effective_date": "2026-09-01T06:00:00Z",
    "fuel_products": [
      {
        "product_code": "DIESEL_ULSD",
        "retail_price_per_unit": 3.999,
        "unit_of_measure": "GALLON",
        "credit_price_per_unit": 4.099
      }
    ]
  }
}
```

**Response**

```json
{
  "merchant_id": "merchant-123",
  "site_id": "331",
  "next_pricing_updates": [
    {
      "effective_date": "2026-09-01T06:00:00Z",
      "fuel_products": [
        {
          "product_code": "DEF",
          "retail_price_per_unit": 4.866,
          "cost_price_per_unit": 4.803,
          "credit_price_per_unit": 4.871,
          "unit_of_measure": "GALLON"
        }
      ]
    },
    {
      "effective_date": "2026-09-02T06:00:00Z",
      "fuel_products": [
        {
          "product_code": "REEFER",
          "retail_price_per_unit": 5.059,
          "cost_price_per_unit": 5,
          "credit_price_per_unit": 5.109,
          "unit_of_measure": "GALLON"
        }
      ]
    }
  ]
}
```

**SDK Code**

```python Update price_example
import requests

url = "https://pos.fuel.greenlane.ai/gfp/update_price"

payload = {
    "merchant_id": "merchant-id",
    "site_id": "331",
    "pricing_update": {
        "effective_date": "2026-09-01T06:00:00Z",
        "fuel_products": [
            {
                "product_code": "DIESEL_ULSD",
                "retail_price_per_unit": 3.999,
                "unit_of_measure": "GALLON",
                "credit_price_per_unit": 4.099
            }
        ]
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update price_example
const url = 'https://pos.fuel.greenlane.ai/gfp/update_price';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"merchant_id":"merchant-id","site_id":"331","pricing_update":{"effective_date":"2026-09-01T06:00:00Z","fuel_products":[{"product_code":"DIESEL_ULSD","retail_price_per_unit":3.999,"unit_of_measure":"GALLON","credit_price_per_unit":4.099}]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update price_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://pos.fuel.greenlane.ai/gfp/update_price"

	payload := strings.NewReader("{\n  \"merchant_id\": \"merchant-id\",\n  \"site_id\": \"331\",\n  \"pricing_update\": {\n    \"effective_date\": \"2026-09-01T06:00:00Z\",\n    \"fuel_products\": [\n      {\n        \"product_code\": \"DIESEL_ULSD\",\n        \"retail_price_per_unit\": 3.999,\n        \"unit_of_measure\": \"GALLON\",\n        \"credit_price_per_unit\": 4.099\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update price_example
require 'uri'
require 'net/http'

url = URI("https://pos.fuel.greenlane.ai/gfp/update_price")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"merchant_id\": \"merchant-id\",\n  \"site_id\": \"331\",\n  \"pricing_update\": {\n    \"effective_date\": \"2026-09-01T06:00:00Z\",\n    \"fuel_products\": [\n      {\n        \"product_code\": \"DIESEL_ULSD\",\n        \"retail_price_per_unit\": 3.999,\n        \"unit_of_measure\": \"GALLON\",\n        \"credit_price_per_unit\": 4.099\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Update price_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://pos.fuel.greenlane.ai/gfp/update_price")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"merchant_id\": \"merchant-id\",\n  \"site_id\": \"331\",\n  \"pricing_update\": {\n    \"effective_date\": \"2026-09-01T06:00:00Z\",\n    \"fuel_products\": [\n      {\n        \"product_code\": \"DIESEL_ULSD\",\n        \"retail_price_per_unit\": 3.999,\n        \"unit_of_measure\": \"GALLON\",\n        \"credit_price_per_unit\": 4.099\n      }\n    ]\n  }\n}")
  .asString();
```

```php Update price_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://pos.fuel.greenlane.ai/gfp/update_price', [
  'body' => '{
  "merchant_id": "merchant-id",
  "site_id": "331",
  "pricing_update": {
    "effective_date": "2026-09-01T06:00:00Z",
    "fuel_products": [
      {
        "product_code": "DIESEL_ULSD",
        "retail_price_per_unit": 3.999,
        "unit_of_measure": "GALLON",
        "credit_price_per_unit": 4.099
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update price_example
using RestSharp;

var client = new RestClient("https://pos.fuel.greenlane.ai/gfp/update_price");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"merchant_id\": \"merchant-id\",\n  \"site_id\": \"331\",\n  \"pricing_update\": {\n    \"effective_date\": \"2026-09-01T06:00:00Z\",\n    \"fuel_products\": [\n      {\n        \"product_code\": \"DIESEL_ULSD\",\n        \"retail_price_per_unit\": 3.999,\n        \"unit_of_measure\": \"GALLON\",\n        \"credit_price_per_unit\": 4.099\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update price_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "merchant_id": "merchant-id",
  "site_id": "331",
  "pricing_update": [
    "effective_date": "2026-09-01T06:00:00Z",
    "fuel_products": [
      [
        "product_code": "DIESEL_ULSD",
        "retail_price_per_unit": 3.999,
        "unit_of_measure": "GALLON",
        "credit_price_per_unit": 4.099
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://pos.fuel.greenlane.ai/gfp/update_price")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```