> ## Documentation Index
> Fetch the complete documentation index at: https://docs.robotpos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# get data

> Belirtilen rapor tipine göre veri çeker

# Satış Verileri API

Bu API, robotPOS sisteminden satış ve rapor verilerini çekmek için kullanılır. Çeşitli rapor tipleri için tek bir endpoint üzerinden veri alabilirsiniz.

## Rapor Tipleri

| Tip Kodu | Açıklama            |
| -------- | ------------------- |
| 101      | Şube Listesi        |
| 102      | Grup Satışları      |
| 103      | Ürün Satışları      |
| 104      | Kategori Satışları  |
| 105      | Ödeme Tipi Dağılımı |

## Örnek İstekler

### Şube Listesi Alma

```json theme={null}
{
  "Type": 101
}
```

### Grup Satışları Raporu

```json theme={null}
{
  "Type": 102,
  "BranchCode": "222,111,555",
  "StartDate": "2025-05-04 00:00:00",
  "EndDate": "2025-05-04 23:59:59"
}
```

## Parametreler Hakkında Notlar

* **Type**: Zorunlu parametre, hangi rapor tipinin çekileceğini belirler
* **BranchCode**: Şube kodu belirtmek için kullanılır
  * "0" değeri tüm şubeleri kapsar
  * Tek şube için "12" gibi bir değer kullanılabilir
  * Çoklu şubeler için "222,111,555" gibi virgülle ayrılmış değerler kullanılabilir
* **StartDate** ve **EndDate**: Tarih aralığı belirtmek için kullanılır (YYYY-MM-DD HH:MM:SS formatında)
* **All**: 1 değeri tüm verileri, 0 değeri sadece belirtilen şubelerin verilerini getirir


## OpenAPI

````yaml post /api/salesdata
openapi: 3.0.0
info:
  title: SQL Query API
  description: API for executing SQL queries
  version: 1.0.0
servers:
  - url: https://pos-integration.robotpos.com/realtimeapi
    description: Production API server
security: []
paths:
  /api/salesdata:
    post:
      summary: get data
      description: Belirtilen rapor tipine göre veri çeker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SalesDataRequest'
            examples:
              branchList:
                summary: Şube Listesi
                value:
                  Type: 101
              groupSales:
                summary: Grup Satışları
                value:
                  Type: 102
                  BranchCode: 222,111,555
                  StartDate: '2025-05-04 00:00:00'
                  EndDate: '2025-05-04 23:59:59'
      responses:
        '200':
          description: Başarılı yanıt
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesDataResponse'
        '400':
          description: Geçersiz istek
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Geçersiz API anahtarı
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Rapor sorgusu bulunamadı
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: İstek limiti aşıldı
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Sunucu hatası
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    SalesDataRequest:
      type: object
      required:
        - Type
      properties:
        Type:
          type: integer
          description: Rapor tipi kodu
          example: 101
        StartDate:
          type: string
          description: Başlangıç tarihi (YYYY-MM-DD HH:MM:SS)
          example: '2025-05-04 00:00:00'
        EndDate:
          type: string
          description: Bitiş tarihi (YYYY-MM-DD HH:MM:SS)
          example: '2025-05-04 23:59:59'
        BranchCode:
          type: string
          description: >-
            Şube kodu: Tümü için "0", çoklu şubeler için "222,111", tek şube
            için "12"
          example: '0'
        All:
          type: integer
          description: Tüm veriler (1) veya belirtilen şubeler (0)
          enum:
            - 0
            - 1
          example: 1
        BranchCodeString:
          type: string
          description: Bazı raporlar için şube kodları
          example: 222,111
        WarehouseCodeString:
          type: string
          description: Stok sayım için depo kodları
          example: 100,200,300
    SalesDataResponse:
      type: object
      properties:
        data:
          type: array
          description: Rapor verileri
          items:
            type: object
        totalRows:
          type: integer
          description: Toplam satır sayısı
          example: 123
        affectedRows:
          type: integer
          description: Etkilenen satır sayısı
          example: 0
        timestamp:
          type: string
          format: date-time
          description: Yanıt zamanı
          example: '2025-05-04T14:30:45.123Z'
        execution_time:
          type: number
          description: Sorgu yürütme süresi (saniye)
          example: 0.235
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````