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

# Create Claim

POST https://ops.hugin.co/api/v1/devices/claims
Content-Type: application/json

# Claim Device Terminals - Terminal Claim Oluşturma

Ödeme kuruluşlarına özel oluşturulmus bir servistir. Claim işlemi ile bir terminal, ilgili firmanın ticari kapsamına alınır; bu işlem faturalamayı başlatır ve firmanın bu terminale ait operasyonel/raporlama verilerini alabilmesini sağlar.

## Endpoint

- `POST /api/v1/devices/claims`
    

## Request Body

| Parametre | Tip | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `devices` | array | Evet | Claim edilecek cihaz ve terminal grupları |
| `devices[].deviceId` | string | Evet | Cihaz mali numarası / Hugin ECR name. Örnek: `FT30000971` |
| `devices[].terminalIds` | array\[string\] | Evet | İlgili cihaz altında claim edilecek terminal ID listesi |

## Örnek Request

``` json
{
  "devices": [
    {
      "deviceId": "FT30000971",
      "terminalIds": [
        "B0000870010",
        "B0000870011",
        "B0000870012"
      ]
    },
    {
      "deviceId": "FT30001042",
      "terminalIds": [
        "B0000912345"
      ]
    }
  ]
}

 ```

## İş Kuralları

1. Claim işlemi ticari bir işlemdir; başarılı claim edilen her terminal için ödeme kuruluşu faturalama kapsamına alınır.
    
2. Ödeme kuruluşu sadece bildiği `deviceId` ve o cihaz altında yer alan `terminalId` değerleri için claim talebi gönderebilir.
    
3. `terminalId`, belirtilen `deviceId` altında bulunmalıdır.
    
4. Aynı ödeme kuruluşu tarafından daha önce claim edilmiş terminal tekrar gönderilirse işlem idempotent kabul edilir ve `ALREADY_CLAIMED` döner.
    
5. Başka ödeme kuruluşu tarafından claim edilmiş terminaller için ilgili terminal bazında hata statüsü döner.
    
6. Toplu işlemlerde request geçerli ise HTTP `200` döner; terminal bazlı sonuçlar `data.results` altında raporlanır.
    

## Response Fields

| Alan | Tip | Açıklama |
| --- | --- | --- |
| `data.requestedClaims` | int | Talep edilen toplam terminal claim adedi |
| `data.successfulClaims` | int | Başarılı veya aynı partner için zaten mevcut claim adedi |
| `data.failedClaims` | int | Başarısız terminal claim adedi |
| `data.results` | array | Terminal bazlı işlem sonuçları |
| `data.results[].deviceId` | string | Cihaz mali numarası |
| `data.results[].terminalId` | string | Terminal ID |
| `data.results[].status` | string | Terminal bazlı claim sonucu |
| `data.results[].message` | string | Opsiyonel açıklama |

## Terminal Claim Sonuç Kodları

| Kod | Açıklama |
| --- | --- |
| `CLAIMED` | Terminal başarıyla claim edildi |
| `ALREADY_CLAIMED` | Terminal daha önce kullanıcı tarafından claim edilmiş |
| `DEVICE_NOT_FOUND` | Belirtilen cihaz bulunamadı |
| `TERMINAL_NOT_FOUND_UNDER_DEVICE` | Terminal belirtilen cihaz altında bulunamadı |
| `NOT_ALLOWED` | Partner bu terminal için claim yetkisine sahip değil |

## Notlar

- Claim kelimesi burada mülkiyet devri anlamına gelmez; partner/reseller için ticari ve operasyonel ilişki başlatır.
    
- Claim edilen terminal için transaction kopyaları / operasyonel veri akışı partner hesabına açılır.
    
- Cihaz detaylarını ve terminal listesini görmek için `GET /api/v1/devices/{deviceId}` endpoint'i kullanılabilir.

Reference: https://ops-apidoc.hugin.co/hugin-ops-api/devices/create-claim

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: HuginOps API
  version: 1.0.0
paths:
  /api/v1/devices/claims:
    post:
      operationId: create-claim
      summary: Create Claim
      description: >-
        # Claim Device Terminals - Terminal Claim Oluşturma


        Ödeme kuruluşlarına özel oluşturulmus bir servistir. Claim işlemi ile
        bir terminal, ilgili firmanın ticari kapsamına alınır; bu işlem
        faturalamayı başlatır ve firmanın bu terminale ait operasyonel/raporlama
        verilerini alabilmesini sağlar.


        ## Endpoint


        - `POST /api/v1/devices/claims`
            

        ## Request Body


        | Parametre | Tip | Zorunlu | Açıklama |

        | --- | --- | --- | --- |

        | `devices` | array | Evet | Claim edilecek cihaz ve terminal grupları |

        | `devices[].deviceId` | string | Evet | Cihaz mali numarası / Hugin ECR
        name. Örnek: `FT30000971` |

        | `devices[].terminalIds` | array\[string\] | Evet | İlgili cihaz
        altında claim edilecek terminal ID listesi |


        ## Örnek Request


        ``` json

        {
          "devices": [
            {
              "deviceId": "FT30000971",
              "terminalIds": [
                "B0000870010",
                "B0000870011",
                "B0000870012"
              ]
            },
            {
              "deviceId": "FT30001042",
              "terminalIds": [
                "B0000912345"
              ]
            }
          ]
        }

         ```

        ## İş Kuralları


        1. Claim işlemi ticari bir işlemdir; başarılı claim edilen her terminal
        için ödeme kuruluşu faturalama kapsamına alınır.
            
        2. Ödeme kuruluşu sadece bildiği `deviceId` ve o cihaz altında yer alan
        `terminalId` değerleri için claim talebi gönderebilir.
            
        3. `terminalId`, belirtilen `deviceId` altında bulunmalıdır.
            
        4. Aynı ödeme kuruluşu tarafından daha önce claim edilmiş terminal
        tekrar gönderilirse işlem idempotent kabul edilir ve `ALREADY_CLAIMED`
        döner.
            
        5. Başka ödeme kuruluşu tarafından claim edilmiş terminaller için ilgili
        terminal bazında hata statüsü döner.
            
        6. Toplu işlemlerde request geçerli ise HTTP `200` döner; terminal bazlı
        sonuçlar `data.results` altında raporlanır.
            

        ## Response Fields


        | Alan | Tip | Açıklama |

        | --- | --- | --- |

        | `data.requestedClaims` | int | Talep edilen toplam terminal claim
        adedi |

        | `data.successfulClaims` | int | Başarılı veya aynı partner için zaten
        mevcut claim adedi |

        | `data.failedClaims` | int | Başarısız terminal claim adedi |

        | `data.results` | array | Terminal bazlı işlem sonuçları |

        | `data.results[].deviceId` | string | Cihaz mali numarası |

        | `data.results[].terminalId` | string | Terminal ID |

        | `data.results[].status` | string | Terminal bazlı claim sonucu |

        | `data.results[].message` | string | Opsiyonel açıklama |


        ## Terminal Claim Sonuç Kodları


        | Kod | Açıklama |

        | --- | --- |

        | `CLAIMED` | Terminal başarıyla claim edildi |

        | `ALREADY_CLAIMED` | Terminal daha önce kullanıcı tarafından claim
        edilmiş |

        | `DEVICE_NOT_FOUND` | Belirtilen cihaz bulunamadı |

        | `TERMINAL_NOT_FOUND_UNDER_DEVICE` | Terminal belirtilen cihaz altında
        bulunamadı |

        | `NOT_ALLOWED` | Partner bu terminal için claim yetkisine sahip değil |


        ## Notlar


        - Claim kelimesi burada mülkiyet devri anlamına gelmez; partner/reseller
        için ticari ve operasyonel ilişki başlatır.
            
        - Claim edilen terminal için transaction kopyaları / operasyonel veri
        akışı partner hesabına açılır.
            
        - Cihaz detaylarını ve terminal listesini görmek için `GET
        /api/v1/devices/{deviceId}` endpoint'i kullanılabilir.
      tags:
        - devices
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Devices_Create Claim_Response_200'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1DevicesClaimsRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostApiV1DevicesClaimsRequestUnauthorizedError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                devices:
                  type: array
                  items:
                    $ref: >-
                      #/components/schemas/ApiV1DevicesClaimsPostRequestBodyContentApplicationJsonSchemaDevicesItems
              required:
                - devices
servers:
  - url: https://ops.hugin.co
    description: https://ops.hugin.co
components:
  schemas:
    ApiV1DevicesClaimsPostRequestBodyContentApplicationJsonSchemaDevicesItems:
      type: object
      properties:
        deviceId:
          type: string
        terminalIds:
          type: array
          items:
            type: string
      required:
        - deviceId
        - terminalIds
      title: >-
        ApiV1DevicesClaimsPostRequestBodyContentApplicationJsonSchemaDevicesItems
    ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaDataResultsItems:
      type: object
      properties:
        deviceId:
          type: string
        terminalId:
          type: string
        status:
          type: string
      required:
        - deviceId
        - terminalId
        - status
      title: >-
        ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaDataResultsItems
    ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        requestedClaims:
          type: integer
        successfulClaims:
          type: integer
        failedClaims:
          type: integer
        results:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaDataResultsItems
      required:
        - requestedClaims
        - successfulClaims
        - failedClaims
        - results
      title: ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaData
    ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaMetadata:
      type: object
      properties:
        instance:
          type: string
        timestamp:
          type: string
          format: date-time
      required:
        - instance
        - timestamp
      title: ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaMetadata
    Devices_Create Claim_Response_200:
      type: object
      properties:
        status:
          type: string
        data:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaData
        metadata:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaMetadata
      required:
        - status
        - data
        - metadata
      title: Devices_Create Claim_Response_200
    ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        description:
          type: string
      required:
        - code
        - title
        - description
      title: ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaError
    PostApiV1DevicesClaimsRequestBadRequestError:
      type: object
      properties:
        status:
          type: string
        error:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaError
        metadata:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaMetadata
      required:
        - status
        - error
        - metadata
      title: PostApiV1DevicesClaimsRequestBadRequestError
    PostApiV1DevicesClaimsRequestUnauthorizedError:
      type: object
      properties:
        status:
          type: string
        error:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaError
        metadata:
          $ref: >-
            #/components/schemas/ApiV1DevicesClaimsPostResponsesContentApplicationJsonSchemaMetadata
      required:
        - status
        - error
        - metadata
      title: PostApiV1DevicesClaimsRequestUnauthorizedError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples

### Success - All Terminals Claimed



**Request**

```json
undefined
```

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "requestedClaims": 4,
    "successfulClaims": 4,
    "failedClaims": 0,
    "results": [
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870010",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870011",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870012",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30001042",
        "terminalId": "B0000912345",
        "status": "CLAIMED"
      }
    ]
  },
  "metadata": {
    "instance": "/api/v1/devices/claims",
    "timestamp": "2026-06-18T16:49:21Z"
  }
}
```

**SDK Code**

```python Success - All Terminals Claimed
import requests

url = "https://ops.hugin.co/api/v1/devices/claims"

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

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

print(response.json())
```

```javascript Success - All Terminals Claimed
const url = 'https://ops.hugin.co/api/v1/devices/claims';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Success - All Terminals Claimed
package main

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

func main() {

	url := "https://ops.hugin.co/api/v1/devices/claims"

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

	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 Success - All Terminals Claimed
require 'uri'
require 'net/http'

url = URI("https://ops.hugin.co/api/v1/devices/claims")

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'

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

```java Success - All Terminals Claimed
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ops.hugin.co/api/v1/devices/claims")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Success - All Terminals Claimed
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ops.hugin.co/api/v1/devices/claims', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Success - All Terminals Claimed
using RestSharp;

var client = new RestClient("https://ops.hugin.co/api/v1/devices/claims");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Success - All Terminals Claimed
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://ops.hugin.co/api/v1/devices/claims")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Success - Partial Claim Result



**Request**

```json
undefined
```

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "requestedClaims": 4,
    "successfulClaims": 2,
    "failedClaims": 2,
    "results": [
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870010",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870011",
        "status": "ALREADY_CLAIMED_BY_YOU"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870012",
        "status": "CLAIMED_BY_ANOTHER_PARTNER"
      },
      {
        "deviceId": "FT30001042",
        "terminalId": "B0000912345",
        "status": "TERMINAL_NOT_FOUND_UNDER_DEVICE"
      }
    ]
  },
  "metadata": {
    "instance": "/api/v1/devices/claims",
    "timestamp": "2026-06-18T16:49:21Z"
  }
}
```

**SDK Code**

```python Success - Partial Claim Result
import requests

url = "https://ops.hugin.co/api/v1/devices/claims"

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

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

print(response.json())
```

```javascript Success - Partial Claim Result
const url = 'https://ops.hugin.co/api/v1/devices/claims';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Success - Partial Claim Result
package main

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

func main() {

	url := "https://ops.hugin.co/api/v1/devices/claims"

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

	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 Success - Partial Claim Result
require 'uri'
require 'net/http'

url = URI("https://ops.hugin.co/api/v1/devices/claims")

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'

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

```java Success - Partial Claim Result
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ops.hugin.co/api/v1/devices/claims")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Success - Partial Claim Result
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ops.hugin.co/api/v1/devices/claims', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Success - Partial Claim Result
using RestSharp;

var client = new RestClient("https://ops.hugin.co/api/v1/devices/claims");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Success - Partial Claim Result
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://ops.hugin.co/api/v1/devices/claims")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Devices_Create Claim_example



**Request**

```json
{
  "devices": [
    {
      "deviceId": "FT30000971",
      "terminalIds": [
        "B0000870010",
        "B0000870011",
        "B0000870012"
      ]
    },
    {
      "deviceId": "FT30001042",
      "terminalIds": [
        "B0000912345"
      ]
    }
  ]
}
```

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "requestedClaims": 4,
    "successfulClaims": 4,
    "failedClaims": 0,
    "results": [
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870010",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870011",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30000971",
        "terminalId": "B0000870012",
        "status": "CLAIMED"
      },
      {
        "deviceId": "FT30001042",
        "terminalId": "B0000912345",
        "status": "CLAIMED"
      }
    ]
  },
  "metadata": {
    "instance": "/api/v1/devices/claims",
    "timestamp": "2026-06-18T16:49:21Z"
  }
}
```

**SDK Code**

```python Devices_Create Claim_example
import requests

url = "https://ops.hugin.co/api/v1/devices/claims"

payload = { "devices": [
        {
            "deviceId": "FT30000971",
            "terminalIds": ["B0000870010", "B0000870011", "B0000870012"]
        },
        {
            "deviceId": "FT30001042",
            "terminalIds": ["B0000912345"]
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Devices_Create Claim_example
const url = 'https://ops.hugin.co/api/v1/devices/claims';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"devices":[{"deviceId":"FT30000971","terminalIds":["B0000870010","B0000870011","B0000870012"]},{"deviceId":"FT30001042","terminalIds":["B0000912345"]}]}'
};

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

```go Devices_Create Claim_example
package main

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

func main() {

	url := "https://ops.hugin.co/api/v1/devices/claims"

	payload := strings.NewReader("{\n  \"devices\": [\n    {\n      \"deviceId\": \"FT30000971\",\n      \"terminalIds\": [\n        \"B0000870010\",\n        \"B0000870011\",\n        \"B0000870012\"\n      ]\n    },\n    {\n      \"deviceId\": \"FT30001042\",\n      \"terminalIds\": [\n        \"B0000912345\"\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 Devices_Create Claim_example
require 'uri'
require 'net/http'

url = URI("https://ops.hugin.co/api/v1/devices/claims")

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  \"devices\": [\n    {\n      \"deviceId\": \"FT30000971\",\n      \"terminalIds\": [\n        \"B0000870010\",\n        \"B0000870011\",\n        \"B0000870012\"\n      ]\n    },\n    {\n      \"deviceId\": \"FT30001042\",\n      \"terminalIds\": [\n        \"B0000912345\"\n      ]\n    }\n  ]\n}"

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

```java Devices_Create Claim_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ops.hugin.co/api/v1/devices/claims")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"devices\": [\n    {\n      \"deviceId\": \"FT30000971\",\n      \"terminalIds\": [\n        \"B0000870010\",\n        \"B0000870011\",\n        \"B0000870012\"\n      ]\n    },\n    {\n      \"deviceId\": \"FT30001042\",\n      \"terminalIds\": [\n        \"B0000912345\"\n      ]\n    }\n  ]\n}")
  .asString();
```

```php Devices_Create Claim_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ops.hugin.co/api/v1/devices/claims', [
  'body' => '{
  "devices": [
    {
      "deviceId": "FT30000971",
      "terminalIds": [
        "B0000870010",
        "B0000870011",
        "B0000870012"
      ]
    },
    {
      "deviceId": "FT30001042",
      "terminalIds": [
        "B0000912345"
      ]
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Devices_Create Claim_example
using RestSharp;

var client = new RestClient("https://ops.hugin.co/api/v1/devices/claims");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"devices\": [\n    {\n      \"deviceId\": \"FT30000971\",\n      \"terminalIds\": [\n        \"B0000870010\",\n        \"B0000870011\",\n        \"B0000870012\"\n      ]\n    },\n    {\n      \"deviceId\": \"FT30001042\",\n      \"terminalIds\": [\n        \"B0000912345\"\n      ]\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Devices_Create Claim_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["devices": [
    [
      "deviceId": "FT30000971",
      "terminalIds": ["B0000870010", "B0000870011", "B0000870012"]
    ],
    [
      "deviceId": "FT30001042",
      "terminalIds": ["B0000912345"]
    ]
  ]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://ops.hugin.co/api/v1/devices/claims")! 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()
```