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

# Register a given batch by BIC

PATCH https://iot.telia.lt/api/v1/sim_batch/bic/{bic}
Content-Type: application/json

Registers the given SIM batch, assigns all SIMs to the organisation,
and sets the status of all contained SIMs to the given value.

If the `factory_test_mode_allowed` flag is set to true on the tariff plan assignment
or it is enabled in the tariff plan, the SIM batch can be also registered with an initial
status of `4 = Factory Test`, thus setting all of the contained SIMs to factory test
status. In turn, the `activation_date` of these SIMs will not be set yet, but when the factory
test volume is consumed, the auto activation date is reached or they are patched to `Activated`
state afterwards.


Reference: https://docs.iot.telia.lt/developers/api/sim/register-sim-batch-by-bic

## 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

- `bic` (string, required) — The BIC of the SIM batch. Leading hash symbols must be URL encoded (`%23`).

### Body (application/json)

This endpoint expects an object.

- `sim_status` (ApiV1SimBatchBicBicPatchRequestBodyContentApplicationJsonSchemaSimStatus, optional)

## Response

### 200

Batch successfully registered and assigned all SIMS

- `sim` (list of ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItems, optional)

## Errors

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

### 422 Unprocessable Entity Error

Could not register the given batch. Reasons may be: * Could find no batch with that BIC * Batch already registered * Batch contains SIMs registered to other organisations * Attempted to register to `Factory Test` status when it is disabled in tariff plan

- `any`

## Types

### ApiV1SimBatchBicBicPatchRequestBodyContentApplicationJsonSchemaSimStatus

- `id` (integer, required)
- `description` (string, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItems

- `id` (integer, optional)
- `iccid` (string, optional)
- `eid` (string, optional)
- `production_date` (string, optional)
- `activation_date` (string, optional)
- `status` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsStatus, optional)
- `customer_org` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsCustomerOrg, optional)
- `issuer_org` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsIssuerOrg, optional)
- `reseller_org` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsResellerOrg, optional)
- `endpoint` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsEndpoint, optional)
- `imsi` (string, optional)
- `msisdn` (string, optional)
- `model` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModel, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsStatus

- `id` (integer, required)
- `description` (string, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsCustomerOrg

- `id` (integer, optional)
- `name` (string, optional)
- `country` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsCustomerOrgCountry, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsIssuerOrg

- `id` (integer, optional)
- `name` (string, optional)
- `country` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsIssuerOrgCountry, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsResellerOrg

- `id` (integer, optional)
- `name` (string, optional)
- `country` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsResellerOrgCountry, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsEndpoint

- `id` (integer, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModel

- `id` (integer, optional)
- `description` (string, optional)
- `memory_size` (integer, optional)
- `formfactor` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModelFormfactor, optional)
- `manufacturer` (ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModelManufacturer, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsCustomerOrgCountry

- `id` (integer, optional)
- `name` (string, optional)
- `country_code` (integer, optional)
- `mcc` (integer, optional)
- `iso_code` (string, optional)
- `latitude` (float, optional)
- `longitude` (float, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsIssuerOrgCountry

- `id` (integer, optional)
- `name` (string, optional)
- `country_code` (integer, optional)
- `mcc` (integer, optional)
- `iso_code` (string, optional)
- `latitude` (float, optional)
- `longitude` (float, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsResellerOrgCountry

- `id` (integer, optional)
- `name` (string, optional)
- `country_code` (integer, optional)
- `mcc` (integer, optional)
- `iso_code` (string, optional)
- `latitude` (float, optional)
- `longitude` (float, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModelFormfactor

- `id` (integer, optional)
- `name` (string, optional)

### ApiV1SimBatchBicBicPatchResponsesContentApplicationJsonSchemaSimItemsModelManufacturer

- `id` (integer, optional)
- `name` (string, optional)

## Examples

**Request**

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

**Response**

```json
{
  "sim": [
    {
      "id": 1599276,
      "iccid": "8988303000000583545"
    },
    {
      "id": 1599277,
      "iccid": "8988303000000583546"
    },
    {
      "id": 1599278,
      "iccid": "8988303000000583547"
    },
    {
      "id": 1599279,
      "iccid": "8988303000000583548"
    },
    {
      "id": 1599280,
      "iccid": "8988303000000583549"
    }
  ]
}
```

**SDK Code**

```python Successful Batch Activation
import requests

url = "https://iot.telia.lt/api/v1/sim_batch/bic/12345678ABCDEFGH"

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

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

print(response.json())
```

```javascript Successful Batch Activation
const url = 'https://iot.telia.lt/api/v1/sim_batch/bic/12345678ABCDEFGH';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"sim_status":{"id":1}}'
};

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

```go Successful Batch Activation
package main

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

func main() {

	url := "https://iot.telia.lt/api/v1/sim_batch/bic/12345678ABCDEFGH"

	payload := strings.NewReader("{\n  \"sim_status\": {\n    \"id\": 1\n  }\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 Successful Batch Activation
require 'uri'
require 'net/http'

url = URI("https://iot.telia.lt/api/v1/sim_batch/bic/12345678ABCDEFGH")

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  \"sim_status\": {\n    \"id\": 1\n  }\n}"

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

```java Successful Batch Activation
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Successful Batch Activation
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Successful Batch Activation
using RestSharp;

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

```swift Successful Batch Activation
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v1/sim_batch/bic/12345678ABCDEFGH")! 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()
```