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

# Ülke oluştur

> Yeni ülke ekler.

* `Name` zorunludur ve şirket içinde benzersiz olmalıdır.
* `IsDefault: true` gönderilirse önceki varsayılan ülkenin işareti kaldırılır; şirkette en fazla bir varsayılan ülke olur.


## OpenAPI

````yaml api-reference/openapi.tr.json POST /api/v1/definitions/countries
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://api.noyax.com
security:
  - Bearer: []
tags:
  - name: Sections
  - name: Warehouses
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - 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/definitions/countries:
    post:
      tags:
        - Countries
      summary: Ülke oluştur
      description: >-
        Ülke ekler. Name, şirket içinde benzersiz olmalıdır. IsDefault true ise
        önceki varsayılan ülkenin işareti kaldırılır.
      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/CountryRequestDto'
          text/json:
            schema:
              $ref: '#/components/schemas/CountryRequestDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CountryRequestDto'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfCountryDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0501'
                Message: Country Name is required.
                Errors:
                  - Code: '0501'
                    Message: Country Name is required.
        '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:
    CountryRequestDto:
      type: object
      properties:
        Name:
          type:
            - 'null'
            - string
          description: >-
            Zorunlu. Ülke adı, şirket içinde benzersiz olmalıdır. En fazla 50
            karakter.
          example: TÜRKİYE
        Code:
          type:
            - 'null'
            - string
          description: Ülke kodu. En fazla 10 karakter.
          example: TR
        Nationality:
          type:
            - 'null'
            - string
          description: Uyruk adı. En fazla 30 karakter.
          example: TÜRK
        IsDefault:
          type: boolean
          description: >-
            Şirketin varsayılan ülkesi olup olmadığı. true gönderilirse önceki
            varsayılan ülkenin işareti kaldırılır.
          example: true
    DataResultOfCountryDto:
      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/CountryDto'
    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.
    CountryDto:
      type: object
      properties:
        Id:
          type: string
          description: Ülke ID'si.
          format: uuid
        Name:
          type:
            - 'null'
            - string
          description: >-
            Zorunlu. Ülke adı, şirket içinde benzersiz olmalıdır. En fazla 50
            karakter.
          example: TÜRKİYE
        Code:
          type:
            - 'null'
            - string
          description: Ülke kodu. En fazla 10 karakter.
          example: TR
        Nationality:
          type:
            - 'null'
            - string
          description: Uyruk adı. En fazla 30 karakter.
          example: TÜRK
        IsDefault:
          type: boolean
          description: >-
            Şirketin varsayılan ülkesi olup olmadığı. true gönderilirse önceki
            varsayılan ülkenin işareti kaldırılır.
          example: true
    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

````