> This page is for Developers.

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

# Update assigned tariff

PATCH https://iot.telia.lt/api/v1/organisation/{org_id}/tariff
Content-Type: application/json

Allows an organisation to change their assigned tariff.

The following restrictions apply:
* The organisation must not have more than one tariff assigned.
* The tariff can be changed only for the own organisation and direct child organisations. The organisation status must be "ACTIVE".
* If performing the change in self-service, the organisation needs to be in evaluation. Parent organisations are allowed to change the tariffs of production organisations.
* The selected tariff must be active, visible to the requested organisation and must have the same currency. Parent organisations are allowed to assign private tariffs to their child organisations.

In addition to updating the assigned tariff, the system will also:
* Update all of the organisations tariff profiles to use the new tariff.
* Activate all ratezones in the tariff in order to ensure that the endpoints do not lose connection.
* Expire all currently active inclusive volumes and custom rates and delete future ones.


Reference: https://docs.iot.telia.lt/developers/api/organization/update-organisation-tariff

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Path parameters

- `org_id` (integer, required) — Numerical ID of an organization

### Body (application/json)

This endpoint expects an object.

- `id` (double, required) — ID of the new tariff

## Response

### 200

Response to a successful GET, also used for a POST if it does not result in a creation

## Errors

### 400 Bad Request Error

The request is malformed, e.g. the body cannot be parsed

- `any`

### 403 Forbidden Error

Your role doesn't include the permission this endpoint requires. Most endpoints return `error_code`, `error_token`, and `message`. Some return only `status_code` and `message`.

- `error_code` (integer, optional)
- `error_token` (string, optional)
- `status_code` (integer, optional)
- `message` (string, optional)

### 404 Not Found Error

A non-existent resource is requested

- `any`

### 422 Unprocessable Entity Error

Body will return list of validation errors

- `any`

## Examples

**Request**

```json
{
  "id": 1
}
```

**Response**

```json
{}
```

**SDK Code**

```python Change assigned tariff
import requests

url = "https://iot.telia.lt/api/v1/organisation/1/tariff"

payload = { "id": 1 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Change assigned tariff
const url = 'https://iot.telia.lt/api/v1/organisation/1/tariff';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"id":1}'
};

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

```go Change assigned tariff
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/organisation/1/tariff"

	payload := strings.NewReader("{\n  \"id\": 1\n}")

	req, _ := http.NewRequest("PATCH", 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 Change assigned tariff
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/organisation/1/tariff")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": 1\n}"

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

```java Change assigned tariff
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://iot.telia.lt/api/v1/organisation/1/tariff")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": 1\n}")
  .asString();
```

```php Change assigned tariff
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://iot.telia.lt/api/v1/organisation/1/tariff', [
  'body' => '{
  "id": 1
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Change assigned tariff
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v1/organisation/1/tariff");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change assigned tariff
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["id": 1] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/organisation/1/tariff")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```