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

# Banka hesabı oluştur

> Yeni banka hesabı ekler.

* `BankName` zorunludur ve şirketteki [bankalardan](/tr/v1/finance/banks/list) biri olmalıdır.
* `Name` zorunludur.
* `CurrencyCode` zorunludur ve şirketteki [dövizlerden](/tr/v1/definitions/currencies/list) biri olmalıdır.
* `AccountType` 1 (Ticari hesap), 2 (Teminat hesabı), 3 (POS hesabı) ya da 4 (Kredi kartı hesabı — kendi kredi kartımız) olmalıdır.
* `BranchName`, `BranchCode`, `AccountNumber`, `Iban` isteğe bağlıdır; azami uzunlukları alan açıklamasındadır, aşan değerler `0003` ile reddedilir.
* `IsDisabled` gönderilmezse `false` kabul edilir.
* `SharingCode` isteğe bağlıdır; doluysa kullanıcının [paylaşım kodlarından](/tr/v1/guides/sharing-codes) biri olmalıdır.

## Hata kodları

Bu endpoint'in dönebileceği kodlar. Her endpoint için geçerli olan [genel hatalar](/tr/v1/guides/result-codes) (kimlik doğrulama, yetki, istek header'ları, günlük limit) burada tekrarlanmaz.

| Kod    | HTTP | Anlamı                                                                                                                                                       |
| ------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `0002` | 400  | İstek gövdesi okunamadı (bozuk JSON, alan tipi uyumsuz)                                                                                                      |
| `0003` | 400  | Alan azami uzunluğu aşıyor (mesajda alan adı ve sınır yazar)                                                                                                 |
| `0580` | 400  | Metinle verilen değer (kod ya da ad) birden fazla kayıtla eşleşiyor; hangisi olduğunu ayırt edecek bilgiyi ekleyin (ör. ilçe için `City`, il için `Country`) |
| `8011` | 400  | Banka hesabı `Name` zorunlu                                                                                                                                  |
| `8012` | 400  | `BankName` zorunlu                                                                                                                                           |
| `8013` | 400  | `BankName` bulunamadı                                                                                                                                        |
| `8014` | 400  | `CurrencyCode` zorunlu                                                                                                                                       |
| `8015` | 400  | `CurrencyCode` bulunamadı                                                                                                                                    |
| `8016` | 400  | `AccountType` 1-4 arasında olmalı                                                                                                                            |
| `8018` | 400  | `SharingCode` kullanıcının paylaşım kodlarından biri değil                                                                                                   |


## OpenAPI

````yaml api-reference/openapi.tr.json POST /api/v1/finance/bank-accounts
openapi: 3.1.1
info:
  title: Noyax API
  description: Server-to-server API for integrations to access Noyax data.
  version: '1.0'
servers:
  - url: https://dev.noyax.com/services/noyax_api
security:
  - Bearer: []
tags:
  - name: Sections
  - name: Warehouses
  - name: Quotes
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Orders
  - name: Bank Accounts
  - name: Bank Internal Transfers
  - name: Bank Openings
  - name: Banks
  - name: Bank Transfers
  - name: Credit Card Collections
  - name: Repayment Plans
  - name: Despatches
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Line Groups
  - name: Shipment Definitions
  - name: Units
  - name: VAT rates
  - name: Customer Addresses
  - name: Customer Bank Accounts
  - name: Customer Definitions
  - name: Customer Group Members
  - name: Customer Links
  - name: Customer Parameters
  - name: Customer Representatives
  - name: Customers
  - name: Customer Statement
  - name: Customer Telephones
paths:
  /api/v1/finance/bank-accounts:
    post:
      tags:
        - Bank Accounts
      summary: Banka hesabı oluştur
      description: Banka hesabı ekler.
      parameters:
        - name: X-UserID
          in: header
          description: >-
            İsteğin adına yapıldığı Noyax kullanıcısının ID'si. Oluşturulan,
            güncellenen ve silinen kayıtların denetim alanlarına yazılır.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-CompanyID
          in: header
          description: >-
            Şirketin ID'si. Kullanıcı bu şirkete tanımlı olmalıdır. Bütün okuma
            ve yazma işlemleri bu şirketle sınırlıdır.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-PeriodID
          in: header
          description: >-
            Muhasebe döneminin ID'si. Cari endpoint'lerinde isteğe bağlıdır;
            gönderilirse oluşturulan kayıtlara yazılır.
          schema:
            minimum: 1
            type: integer
            format: int32
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankAccountRequestDto'
          text/json:
            schema:
              $ref: '#/components/schemas/BankAccountRequestDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/BankAccountRequestDto'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfBankAccountDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '8016'
                Message: AccountType must be between 1 and 4.
                Errors:
                  - Code: '8016'
                    Message: AccountType must be between 1 and 4.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0102'
                Message: Token has expired. Obtain a new token using the refresh token.
                Errors:
                  - Code: '0102'
                    Message: >-
                      Token has expired. Obtain a new token using the refresh
                      token.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0110'
                Message: You do not have permission for this operation.
                Errors:
                  - Code: '0110'
                    Message: You do not have permission for this operation.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0120'
                Message: Daily request limit (10000) exceeded.
                Errors:
                  - Code: '0120'
                    Message: Daily request limit (10000) exceeded.
components:
  schemas:
    BankAccountRequestDto:
      type: object
      properties:
        BankName:
          type:
            - 'null'
            - string
          description: Zorunlu. GET /api/v1/finance/banks'ten banka adı.
          example: İŞ BANKASI
        Name:
          type:
            - 'null'
            - string
          description: Zorunlu. Şirket içinde benzersiz hesap adı. En fazla 255 karakter.
          example: İş Bankası TRY Hesabı
        BranchName:
          type:
            - 'null'
            - string
          description: Şube adı. En fazla 50 karakter.
        BranchCode:
          type:
            - 'null'
            - string
          description: Şube kodu. En fazla 10 karakter.
        AccountNumber:
          type:
            - 'null'
            - string
          description: Hesap numarası. En fazla 20 karakter.
        Iban:
          type:
            - 'null'
            - string
          description: IBAN. En fazla 50 karakter.
        AccountType:
          type: integer
          description: >-
            Zorunlu. 1: Ticari hesap, 2: Teminat hesabı, 3: POS hesabı, 4: Kredi
            kartı hesabı (şirketin kendi kredi kartı).
          format: int32
          example: 1
        CurrencyCode:
          type:
            - 'null'
            - string
          description: Zorunlu. GET /api/v1/definitions/currencies'ten döviz kodu.
          example: TRY
        IsDisabled:
          type: boolean
          description: Hesabın kullanım dışı olup olmadığı (yeni işlemlerde kullanılmaz).
          example: false
        SharingCode:
          type:
            - 'null'
            - string
          description: >-
            Hesabı kimlerin görebileceğini sınırlayan paylaşım kodu. Boşsa
            herkes görür; doluysa kullanıcının paylaşım kodlarından biri
            olmalıdır.
    DataResultOfBankAccountDto:
      required:
        - Success
        - ResultCode
        - Data
      type: object
      properties:
        Success:
          type: boolean
          description: İşlemin başarılı olup olmadığı.
          example: true
        ResultCode:
          type: string
          description: >-
            Başarıda "0000". Hatada ilk hatanın kodu; hataların tamamı Errors
            içinde listelenir.
          example: '0000'
        Message:
          type:
            - 'null'
            - string
          description: >-
            Success false olduğunda hata mesajı. Bütün hataların mesajları tek
            metinde birleştirilir.
        Data:
          $ref: '#/components/schemas/BankAccountDto'
    ErrorResult:
      type: object
      properties:
        Success:
          type: boolean
          description: İşlemin başarılı olup olmadığı.
          example: false
        ResultCode:
          type:
            - 'null'
            - string
          description: >-
            Başarıda "0000". Hatada ilk hatanın kodu; hataların tamamı Errors
            içinde listelenir.
        Message:
          type:
            - 'null'
            - string
          description: >-
            Success false olduğunda hata mesajı. Bütün hataların mesajları tek
            metinde birleştirilir.
        Errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ResultError'
          description: >-
            Kodlarıyla birlikte bütün hatalar. Yalnızca Success false olduğunda
            bulunur.
    BankAccountDto:
      type: object
      properties:
        Id:
          type: string
          description: Banka hesabı ID'si.
          format: uuid
        BankId:
          type:
            - 'null'
            - string
          description: Banka ID'si.
          format: uuid
        CurrencyId:
          type:
            - 'null'
            - string
          description: Döviz ID'si.
          format: uuid
        BankName:
          type:
            - 'null'
            - string
          description: Zorunlu. GET /api/v1/finance/banks'ten banka adı.
          example: İŞ BANKASI
        Name:
          type:
            - 'null'
            - string
          description: Zorunlu. Şirket içinde benzersiz hesap adı. En fazla 255 karakter.
          example: İş Bankası TRY Hesabı
        BranchName:
          type:
            - 'null'
            - string
          description: Şube adı. En fazla 50 karakter.
        BranchCode:
          type:
            - 'null'
            - string
          description: Şube kodu. En fazla 10 karakter.
        AccountNumber:
          type:
            - 'null'
            - string
          description: Hesap numarası. En fazla 20 karakter.
        Iban:
          type:
            - 'null'
            - string
          description: IBAN. En fazla 50 karakter.
        AccountType:
          type: integer
          description: >-
            Zorunlu. 1: Ticari hesap, 2: Teminat hesabı, 3: POS hesabı, 4: Kredi
            kartı hesabı (şirketin kendi kredi kartı).
          format: int32
          example: 1
        CurrencyCode:
          type:
            - 'null'
            - string
          description: Zorunlu. GET /api/v1/definitions/currencies'ten döviz kodu.
          example: TRY
        IsDisabled:
          type: boolean
          description: Hesabın kullanım dışı olup olmadığı (yeni işlemlerde kullanılmaz).
          example: false
        SharingCode:
          type:
            - 'null'
            - string
          description: >-
            Hesabı kimlerin görebileceğini sınırlayan paylaşım kodu. Boşsa
            herkes görür; doluysa kullanıcının paylaşım kodlarından biri
            olmalıdır.
    ResultError:
      required:
        - Code
        - Message
      type: object
      properties:
        Code:
          type: string
          description: Hata kodu. Tam liste için sonuç kodları sayfasına bakın.
        Message:
          type: string
          description: Hata açıklaması.
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````