> 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 full documentation content, see https://ops-apidoc.hugin.co/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ops-apidoc.hugin.co/_mcp/server.

# Create Case

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

# Create Case - Talep Ekleme

Versiyon güncellemesi, cihaz arıza bildirimi veya cihazdaki terminal ile ilgili işlemler için talep oluşturur.

## Request Body

### Zorunlu Alanlar

| Parametre | Tip | Max Uzunluk | Açıklama |
|-----------|-----|-------------|----------|
| `defectCode` | enum | - | Arıza kodu (Bkz: Arıza Kodları tablosu) |
| `deviceId` | string | 12 | Cihaz mali numarası (F ile başlamalı: F, 00, HN) |
| `caseType` | enum | - | Talep tipi: `install`, `upgrade`, `uninstall`, `training`, `maintenance`, `defect` |
| `detail` | string | 2000 | Talep ayrıntı ve ek bilgileri (örnek: kontak kişi adı, telefonu) |

### Opsiyonel Alanlar

| Parametre | Tip | Max Uzunluk | Açıklama |
|-----------|-----|-------------|----------|
| `terminalId` | string | 25 | Terminal numarası (install/uninstall için zorunlu) |
| `merchantId` | string | 50 | Üye işyeri numarası (install/uninstall için zorunlu) |
| `priority` | enum | - | Öncelik: `P1`, `P2`, `P3` (varsayılan: `none`) |
| `deviceBrand` | string | 50 | Yazarkasa markası (GMP3 için) |
| `deviceModel` | string | 50 | Yazarkasa modeli (GMP3 için) |
| `isGmp3` | boolean | - | GMP3 cihazı mı? (GMP3 için) |

## İş Kuralları

1. **Install/Uninstall için**: Terminal ID ve Merchant ID zorunludur
2. **Fiscal ID Validasyonu**: 
   - F, 00 veya HN ile başlamalıdır
   - FT ile başlayanlar BKM Techpos sistemi üzerinden giriş yapmalıdır
3. **Terminal Kontrolü**: 
   - Cihaz üzerinde çalışan terminal varsa, başka terminal numarası ile iş emri açılamaz
   - Ancak mevcut terminal için versiyon güncelleme, banka silme, eğitim, arıza, bakım talepleri açılabilir
4. **Merchant ID Kontrolü**: Önceden gönderilen değerin aynısı gönderilmeli
5. **GMP3 Alanları**: DeviceBrand, DeviceModel ve IsGMP3 alanları GMP3 cihazlar için kullanılır

## Response

Başarılı durumda dönen `caseId` değeri, talep takip numarasıdır.


Reference: https://ops-apidoc.hugin.co/hugin-ops-api/cases/create-case

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: HuginOps API
  version: 1.0.0
paths:
  /api/v1/cases:
    post:
      operationId: create-case
      summary: Create Case
      description: >
        # Create Case - Talep Ekleme


        Versiyon güncellemesi, cihaz arıza bildirimi veya cihazdaki terminal ile
        ilgili işlemler için talep oluşturur.


        ## Request Body


        ### Zorunlu Alanlar


        | Parametre | Tip | Max Uzunluk | Açıklama |

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

        | `defectCode` | enum | - | Arıza kodu (Bkz: Arıza Kodları tablosu) |

        | `deviceId` | string | 12 | Cihaz mali numarası (F ile başlamalı: F,
        00, HN) |

        | `caseType` | enum | - | Talep tipi: `install`, `upgrade`, `uninstall`,
        `training`, `maintenance`, `defect` |

        | `detail` | string | 2000 | Talep ayrıntı ve ek bilgileri (örnek:
        kontak kişi adı, telefonu) |


        ### Opsiyonel Alanlar


        | Parametre | Tip | Max Uzunluk | Açıklama |

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

        | `terminalId` | string | 25 | Terminal numarası (install/uninstall için
        zorunlu) |

        | `merchantId` | string | 50 | Üye işyeri numarası (install/uninstall
        için zorunlu) |

        | `priority` | enum | - | Öncelik: `P1`, `P2`, `P3` (varsayılan: `none`)
        |

        | `deviceBrand` | string | 50 | Yazarkasa markası (GMP3 için) |

        | `deviceModel` | string | 50 | Yazarkasa modeli (GMP3 için) |

        | `isGmp3` | boolean | - | GMP3 cihazı mı? (GMP3 için) |


        ## İş Kuralları


        1. **Install/Uninstall için**: Terminal ID ve Merchant ID zorunludur

        2. **Fiscal ID Validasyonu**: 
           - F, 00 veya HN ile başlamalıdır
           - FT ile başlayanlar BKM Techpos sistemi üzerinden giriş yapmalıdır
        3. **Terminal Kontrolü**: 
           - Cihaz üzerinde çalışan terminal varsa, başka terminal numarası ile iş emri açılamaz
           - Ancak mevcut terminal için versiyon güncelleme, banka silme, eğitim, arıza, bakım talepleri açılabilir
        4. **Merchant ID Kontrolü**: Önceden gönderilen değerin aynısı
        gönderilmeli

        5. **GMP3 Alanları**: DeviceBrand, DeviceModel ve IsGMP3 alanları GMP3
        cihazlar için kullanılır


        ## Response


        Başarılı durumda dönen `caseId` değeri, talep takip numarasıdır.
      tags:
        - subpackage_cases
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cases_Create Case_Response_200'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApiV1CasesRequestBadRequestError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caseType:
                  type: string
                defectCode:
                  type: string
                deviceId:
                  type: string
                terminalId:
                  type: string
                merchantId:
                  type: string
                detail:
                  type: string
                priority:
                  type: string
                deviceBrand:
                  type: string
                deviceModel:
                  type: string
                isGmp3:
                  type: boolean
              required:
                - caseType
                - defectCode
                - deviceId
                - terminalId
                - merchantId
                - detail
                - priority
                - deviceBrand
                - deviceModel
                - isGmp3
servers:
  - url: https://ops.hugin.co
    description: https://ops.hugin.co
components:
  schemas:
    ApiV1CasesPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        caseId:
          type: integer
      required:
        - caseId
      title: ApiV1CasesPostResponsesContentApplicationJsonSchemaData
    ApiV1CasesPostResponsesContentApplicationJsonSchemaMetadata:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
      required:
        - timestamp
      title: ApiV1CasesPostResponsesContentApplicationJsonSchemaMetadata
    Cases_Create Case_Response_200:
      type: object
      properties:
        status:
          type: string
        data:
          $ref: >-
            #/components/schemas/ApiV1CasesPostResponsesContentApplicationJsonSchemaData
        metadata:
          $ref: >-
            #/components/schemas/ApiV1CasesPostResponsesContentApplicationJsonSchemaMetadata
      required:
        - status
        - data
        - metadata
      title: Cases_Create Case_Response_200
    ApiV1CasesPostResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        description:
          type: string
      required:
        - code
        - title
        - description
      title: ApiV1CasesPostResponsesContentApplicationJsonSchemaError
    PostApiV1CasesRequestBadRequestError:
      type: object
      properties:
        status:
          type: string
        error:
          $ref: >-
            #/components/schemas/ApiV1CasesPostResponsesContentApplicationJsonSchemaError
        metadata:
          $ref: >-
            #/components/schemas/ApiV1CasesPostResponsesContentApplicationJsonSchemaMetadata
      required:
        - status
        - error
        - metadata
      title: PostApiV1CasesRequestBadRequestError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples

### Success - Case Created



**Request**

```json
undefined
```

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "caseId": 456
  },
  "metadata": {
    "timestamp": "2025-07-02T14:40:10+03:00"
  }
}
```

**SDK Code**

```python Success - Case Created
import requests

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

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

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

print(response.json())
```

```javascript Success - Case Created
const url = 'https://ops.hugin.co/api/v1/cases';
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 - Case Created
package main

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

func main() {

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

	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 - Case Created
require 'uri'
require 'net/http'

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

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 - Case Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Success - Case Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Success - Case Created
using RestSharp;

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

```swift Success - Case Created
import Foundation

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

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

### Cases_Create Case_example



**Request**

```json
{
  "caseType": "defect",
  "defectCode": "psu",
  "deviceId": "FU00000359",
  "terminalId": "TERM001",
  "merchantId": "MERCH001",
  "detail": "Cihaz düzgün çalışmıyor",
  "priority": "P1",
  "deviceBrand": "Hugin",
  "deviceModel": "S1",
  "isGmp3": false
}
```

**Response**

```json
{
  "status": "SUCCESS",
  "data": {
    "caseId": 456
  },
  "metadata": {
    "timestamp": "2025-07-02T14:40:10+03:00"
  }
}
```

**SDK Code**

```python Cases_Create Case_example
import requests

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

payload = {
    "caseType": "defect",
    "defectCode": "psu",
    "deviceId": "FU00000359",
    "terminalId": "TERM001",
    "merchantId": "MERCH001",
    "detail": "Cihaz düzgün çalışmıyor",
    "priority": "P1",
    "deviceBrand": "Hugin",
    "deviceModel": "S1",
    "isGmp3": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Cases_Create Case_example
const url = 'https://ops.hugin.co/api/v1/cases';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"caseType":"defect","defectCode":"psu","deviceId":"FU00000359","terminalId":"TERM001","merchantId":"MERCH001","detail":"Cihaz düzgün çalışmıyor","priority":"P1","deviceBrand":"Hugin","deviceModel":"S1","isGmp3":false}'
};

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

```go Cases_Create Case_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"caseType\": \"defect\",\n  \"defectCode\": \"psu\",\n  \"deviceId\": \"FU00000359\",\n  \"terminalId\": \"TERM001\",\n  \"merchantId\": \"MERCH001\",\n  \"detail\": \"Cihaz düzgün çalışmıyor\",\n  \"priority\": \"P1\",\n  \"deviceBrand\": \"Hugin\",\n  \"deviceModel\": \"S1\",\n  \"isGmp3\": false\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 Cases_Create Case_example
require 'uri'
require 'net/http'

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

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  \"caseType\": \"defect\",\n  \"defectCode\": \"psu\",\n  \"deviceId\": \"FU00000359\",\n  \"terminalId\": \"TERM001\",\n  \"merchantId\": \"MERCH001\",\n  \"detail\": \"Cihaz düzgün çalışmıyor\",\n  \"priority\": \"P1\",\n  \"deviceBrand\": \"Hugin\",\n  \"deviceModel\": \"S1\",\n  \"isGmp3\": false\n}"

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

```java Cases_Create Case_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ops.hugin.co/api/v1/cases")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"caseType\": \"defect\",\n  \"defectCode\": \"psu\",\n  \"deviceId\": \"FU00000359\",\n  \"terminalId\": \"TERM001\",\n  \"merchantId\": \"MERCH001\",\n  \"detail\": \"Cihaz düzgün çalışmıyor\",\n  \"priority\": \"P1\",\n  \"deviceBrand\": \"Hugin\",\n  \"deviceModel\": \"S1\",\n  \"isGmp3\": false\n}")
  .asString();
```

```php Cases_Create Case_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ops.hugin.co/api/v1/cases', [
  'body' => '{
  "caseType": "defect",
  "defectCode": "psu",
  "deviceId": "FU00000359",
  "terminalId": "TERM001",
  "merchantId": "MERCH001",
  "detail": "Cihaz düzgün çalışmıyor",
  "priority": "P1",
  "deviceBrand": "Hugin",
  "deviceModel": "S1",
  "isGmp3": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Cases_Create Case_example
using RestSharp;

var client = new RestClient("https://ops.hugin.co/api/v1/cases");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"caseType\": \"defect\",\n  \"defectCode\": \"psu\",\n  \"deviceId\": \"FU00000359\",\n  \"terminalId\": \"TERM001\",\n  \"merchantId\": \"MERCH001\",\n  \"detail\": \"Cihaz düzgün çalışmıyor\",\n  \"priority\": \"P1\",\n  \"deviceBrand\": \"Hugin\",\n  \"deviceModel\": \"S1\",\n  \"isGmp3\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Cases_Create Case_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "caseType": "defect",
  "defectCode": "psu",
  "deviceId": "FU00000359",
  "terminalId": "TERM001",
  "merchantId": "MERCH001",
  "detail": "Cihaz düzgün çalışmıyor",
  "priority": "P1",
  "deviceBrand": "Hugin",
  "deviceModel": "S1",
  "isGmp3": false
] as [String : Any]

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

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