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

# Create an invoice account



## OpenAPI

````yaml /api-referansi/openapi.json post /v1/invoices/accounts
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/invoices/accounts:
    post:
      tags:
        - Invoice
        - InvoiceAccount
      summary: Create an invoice account
      operationId: invoiceAccount.store
      parameters:
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceAccountStoreRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/InvoiceAccountResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    InvoiceAccountStoreRequest:
      type: object
      properties:
        integration_id:
          type: integer
          description: >-
            The active e-invoice integrator (`type` = `invoice`) the account is
            opened on.
        party_type:
          $ref: '#/components/schemas/InvoiceAccountPartyType'
          description: Whether the account belongs to an individual or a company.
        name:
          type:
            - string
            - 'null'
          description: First name, required for an individual.
          maxLength: 255
        surname:
          type:
            - string
            - 'null'
          description: Last name, required for an individual.
          maxLength: 255
        title:
          type:
            - string
            - 'null'
          description: Company title, required for a company.
          maxLength: 255
        tax_number:
          type: string
          description: Tax number (VKN) or Turkish identity number (TCKN).
          maxLength: 11
        tax_office:
          type:
            - string
            - 'null'
          description: Tax office name.
          maxLength: 255
        country_id:
          type:
            - integer
            - 'null'
          description: The country identifier.
        city_id:
          type:
            - integer
            - 'null'
          description: The city identifier; must belong to `country_id`.
        district_id:
          type:
            - integer
            - 'null'
          description: The district identifier; must belong to `city_id`.
        address:
          type:
            - string
            - 'null'
          description: Street address.
          maxLength: 1000
        phone:
          type:
            - string
            - 'null'
          description: Phone number.
          maxLength: 255
        email:
          type:
            - string
            - 'null'
          format: email
          description: Email address.
          maxLength: 255
        document_type:
          $ref: '#/components/schemas/InvoiceAccountDocumentType'
          description: Whether the account issues e-invoices or e-vouchers (e-SMM).
        use_vat_exemption:
          type:
            - boolean
            - 'null'
          description: Whether invoices of this account apply the VAT exemption by default.
        withholding_rate_percent:
          type:
            - number
            - 'null'
          description: Default withholding rate in percent (0-100).
          minimum: 0
          maximum: 100
        default_apply_withholding:
          type:
            - boolean
            - 'null'
          description: Whether new invoices of this account apply withholding by default.
        extra_fields:
          type:
            - object
            - 'null'
          description: >-
            Integrator credentials keyed by the integration's
            `required_fields[].key` (e.g. `{"API_KEY": "..."}`). Every declared
            key is required; values are stored encrypted and never returned.
          additionalProperties:
            type: string
      required:
        - integration_id
        - party_type
        - tax_number
        - document_type
      title: InvoiceAccountStoreRequest
    InvoiceAccountResource:
      type: object
      properties:
        id:
          type: integer
        integration_id:
          type: integer
        integration:
          $ref: '#/components/schemas/RelatedIntegrationResource'
        party_type:
          type: string
        party_type_label:
          type: string
          enum:
            - Bireysel
            - Kurumsal
        document_type:
          type: string
        document_type_label:
          type: string
          enum:
            - E-Fatura
            - E-SMM
        name:
          type:
            - string
            - 'null'
        surname:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
        tax_number:
          type: string
        default_series:
          type:
            - string
            - 'null'
        tax_office:
          type:
            - string
            - 'null'
        country_id:
          type:
            - integer
            - 'null'
        city_id:
          type:
            - integer
            - 'null'
        district_id:
          type:
            - integer
            - 'null'
        address:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        use_vat_exemption:
          type: boolean
        withholding_rate_percent:
          type: number
        default_apply_withholding:
          type: boolean
        configured_extra_fields:
          type: array
          description: >-
            Keys of the integrator credentials (`extra_fields`) that are set;
            the values are never returned.
          items:
            type: string
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - integration_id
        - party_type
        - party_type_label
        - document_type
        - document_type_label
        - name
        - surname
        - title
        - tax_number
        - default_series
        - tax_office
        - country_id
        - city_id
        - district_id
        - address
        - phone
        - email
        - use_vat_exemption
        - withholding_rate_percent
        - default_apply_withholding
        - configured_extra_fields
        - created_at
        - updated_at
      title: InvoiceAccountResource
    InvoiceAccountPartyType:
      type: string
      enum:
        - individual
        - company
      title: InvoiceAccountPartyType
    InvoiceAccountDocumentType:
      type: string
      enum:
        - einvoice
        - evoucher
      title: InvoiceAccountDocumentType
    RelatedIntegrationResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        system_name:
          type:
            - string
            - 'null'
        company_logo:
          type: 'null'
          description: >-
            Short-lived (5 minute) signed URL of the integrator logo; `null`
            when none is set.
      required:
        - id
        - name
        - system_name
        - company_logo
      title: RelatedIntegrationResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.