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

# Create journal entry

> Create and post a balanced manual journal entry attributed to the current user or API credential.



## OpenAPI

````yaml post /v1/accounting/journal-entries
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/accounting/journal-entries:
    post:
      tags:
        - Accounting > Journal entries
      summary: Create journal entry
      description: >-
        Create and post a balanced manual journal entry attributed to the
        current user or API credential.
      operationId: createManualJournalEntry
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ledger_id:
                  type: string
                  description: Ledger identifier.
                description:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: Description recorded on the manual journal entry.
                entry_date_at:
                  type:
                    - string
                    - 'null'
                  format: date
                  description: Timestamp when the journal entry takes effect.
                lines:
                  type: array
                  items:
                    type: object
                    properties:
                      ledger_account_id:
                        type: string
                        description: Ledger account identifier.
                      type:
                        type: string
                        enum:
                          - debit
                          - credit
                        description: Debit or credit line type.
                      amount:
                        type: string
                        pattern: ^\d+(\.\d+)?$
                        description: Positive amount in minor ledger-currency units.
                    required:
                      - ledger_account_id
                      - type
                      - amount
                  minItems: 2
                  description: Balanced debit and credit lines.
                recognition_schedule:
                  type:
                    - object
                    - 'null'
                  properties:
                    method:
                      type: string
                      enum:
                        - point_in_time
                        - over_time
                      description: Recognition method applied to deferred revenue.
                    recognition_date:
                      type:
                        - string
                        - 'null'
                      format: date
                      description: Recognition date for point-in-time recognition.
                    window:
                      type:
                        - object
                        - 'null'
                      properties:
                        start_date:
                          type: string
                          format: date
                          description: Inclusive service window start date.
                        end_date:
                          type: string
                          format: date
                          description: Inclusive service window end date.
                      required:
                        - start_date
                        - end_date
                      description: Service window for over-time recognition.
                    granularity:
                      type:
                        - string
                        - 'null'
                      enum:
                        - day
                        - month
                        - quarter
                        - year
                      description: Slice granularity for over-time recognition.
                    revenue_ledger_account_id:
                      type: string
                      description: Revenue account credited as revenue is recognized.
                  required:
                    - method
                    - revenue_ledger_account_id
                  description: Optional recognition schedule for a deferred-revenue credit.
              required:
                - ledger_id
                - description
                - entry_date_at
                - lines
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountingJournalEntry'
        '403':
          description: ''
      security:
        - bearer: []
components:
  schemas:
    AccountingJournalEntry:
      type: object
      properties:
        id:
          type: string
          description: Unique journal-entry identifier.
        entry_number:
          type: string
          description: Human-readable journal-entry number.
        posted_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the entry was posted.
        entry_date_at:
          type:
            - string
            - 'null'
          format: date
          description: Accounting timestamp of the entry.
        original_currency:
          type: string
          description: ISO 4217 original currency.
        original_currency_exchange_rate:
          type: string
          description: Exchange rate into ledger currency.
        original_currency_exchange_rate_date:
          type:
            - string
            - 'null'
          format: date
          description: Date of the exchange rate.
        amount:
          type: string
          description: Total amount in ledger currency.
        amount_in_original_currency:
          type: string
          description: Total amount in the original currency.
        description:
          type:
            - string
            - 'null'
          description: Optional journal-entry description.
        status:
          type: string
          enum:
            - draft
            - posted
          description: Journal-entry status.
        origin:
          type: string
          enum:
            - auto
            - manual
          description: Automatic or manual entry origin.
        invoicing_entity_id:
          type: string
          description: Owning invoicing entity identifier.
        ledger_id:
          type: string
          description: Owning ledger identifier.
        invoice_id:
          type:
            - string
            - 'null'
          description: Related invoice identifier.
        customer_id:
          type:
            - string
            - 'null'
          description: Related customer identifier.
        invoice_line_item_id:
          type:
            - string
            - 'null'
          description: Related invoice line-item identifier.
        subscription_id:
          type:
            - string
            - 'null'
          description: Related subscription identifier.
        transaction_id:
          type:
            - string
            - 'null'
          description: Related payment transaction identifier.
        reversal_for_entry_id:
          type:
            - string
            - 'null'
          description: Original entry identifier when this is a reversal.
        schedule_id:
          type:
            - string
            - 'null'
          description: Revenue-recognition schedule created with a manual entry.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/AccountingJournalEntryLine'
          description: Debit and credit lines in the entry.
        created_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the entry was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the entry was last updated.
      required:
        - id
        - entry_number
        - posted_at
        - entry_date_at
        - original_currency
        - original_currency_exchange_rate
        - original_currency_exchange_rate_date
        - amount
        - amount_in_original_currency
        - description
        - status
        - origin
        - invoicing_entity_id
        - ledger_id
        - invoice_id
        - customer_id
        - invoice_line_item_id
        - subscription_id
        - transaction_id
        - reversal_for_entry_id
        - lines
        - created_at
        - updated_at
    AccountingJournalEntryLine:
      type: object
      properties:
        id:
          type: string
          description: Unique journal-entry line identifier.
        line_number:
          type: number
          description: Sequential line number in the ledger.
        date:
          type:
            - string
            - 'null'
          format: date
          description: Accounting date of the line.
        description:
          type:
            - string
            - 'null'
          description: Optional line description.
        type:
          type: string
          enum:
            - debit
            - credit
          description: Debit or credit line type.
        amount:
          type: string
          description: Amount in ledger currency.
        amount_in_original_currency:
          type: string
          description: Amount in the original currency.
        original_currency:
          type: string
          description: ISO 4217 original currency.
        original_currency_exchange_rate:
          type: string
          description: Exchange rate into ledger currency.
        original_currency_exchange_rate_date:
          type:
            - string
            - 'null'
          format: date
          description: Date of the exchange rate.
        entry_id:
          type: string
          description: Parent journal-entry identifier.
        entry_status:
          type: string
          enum:
            - draft
            - posted
          description: Status of the parent entry when included.
        entry_posted_at:
          type:
            - string
            - 'null'
          format: date
          description: Posting timestamp of the parent entry when included.
        entry_number:
          type:
            - string
            - 'null'
          description: Number of the parent entry when included.
        ledger_account_id:
          type: string
          description: Ledger account identifier.
        account_code_snapshot:
          type:
            - string
            - 'null'
          description: Account code captured when the entry was posted.
        account_name_snapshot:
          type:
            - string
            - 'null'
          description: Account name captured when the entry was posted.
        invoice_line_item_id:
          type:
            - string
            - 'null'
          description: Related invoice line-item identifier.
        rule_id:
          type:
            - string
            - 'null'
          description: Applied accounting-rule identifier.
        rule_code:
          type:
            - string
            - 'null'
          description: Applied accounting-rule code.
        rule_name:
          type:
            - string
            - 'null'
          description: Applied accounting-rule name.
        product_id:
          type:
            - string
            - 'null'
          description: Related product identifier.
        invoicing_entity_id:
          type: string
          description: Owning invoicing entity identifier.
        created_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the line was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date
          description: Timestamp when the line was last updated.
      required:
        - id
        - line_number
        - date
        - description
        - type
        - amount
        - amount_in_original_currency
        - original_currency
        - original_currency_exchange_rate
        - original_currency_exchange_rate_date
        - entry_id
        - ledger_account_id
        - invoice_line_item_id
        - rule_id
        - rule_code
        - rule_name
        - product_id
        - invoicing_entity_id
        - created_at
        - updated_at
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````