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

# Create invoice



## OpenAPI

````yaml /openapi/adam-v1.json post /create/invoice
openapi: 3.0.3
info:
  title: Tyms Developer API
  version: 1.0.0
  description: >-
    REST API for Tyms — the AI-Native Accounting Platform for small and
    medium-sized businesses across service, consulting, retail, and
    manufacturing. Paths are appended to the server URL.


    **Business key** (`tyms_sk_...`): all routes except partner distributor
    routes and OAuth authorization steps that document their own auth. **Partner
    key** (`adam_partner_sk_...` or equivalent): `POST /register-business`, `GET
    /referred-businesses`, billing status, and seat/credit grants on referred
    businesses. **OAuth**: integration apps use `tyms_pk_...` / `tyms_sk_...`
    plus user Bearer tokens — see the OAuth guide.


    Financial reports match what you see in the Tyms app. AI create endpoints
    accept optional attachment objects (`name`, `file`, `type`) — see the
    Attachments page in this docs site.
servers:
  - url: https://staging-api.tyms.io/v1/adam
    description: Sandbox (pre-production). Request credentials at developer@tyms.io.
  - url: https://api.tyms.io/v1/adam
    description: Production
security:
  - apiKey: []
tags:
  - name: Partners
    description: >-
      Referral partner (distributor) flows — partner API key only. Register
      businesses, list referrals, read billing, and grant Plus seats or AI
      credits from partner holding.
  - name: Authentication
    description: Validate a business Developer API key.
  - name: OAuth
    description: >-
      Third-party integration authorization — connect Tyms users to your app
      without sharing their business secret keys.
  - name: Chart of accounts
    description: COA and bank-linked accounts.
  - name: Invoices
    description: Invoice CRUD and payments.
  - name: Bills
    description: Bill CRUD and payments.
  - name: Expenses
    description: Expense CRUD.
  - name: Income
    description: Income record CRUD.
  - name: Journals
    description: Journal entry CRUD.
  - name: Contacts
    description: Contact CRUD.
  - name: Banks
    description: Bank accounts.
  - name: Bank transactions
    description: Statement lines and AI-assisted upload.
  - name: Reports
    description: Financial statements (aligned with in-app reports).
  - name: Inventory
    description: Product and service catalog; stock tracking, sell, and restock.
  - name: Fixed Assets
    description: Capital asset acquisition and tracking.
  - name: Quotes
    description: >-
      Sales proposals that can be converted to invoices, income, or prepaid
      income.
  - name: Purchase Orders
    description: Vendor buying commitments that convert to inventory restocks.
  - name: Departments
    description: Reporting dimension for cost/profit allocation within a branch.
  - name: Projects
    description: Job costing and project tracking dimension attached to transactions.
  - name: Branches
    description: Multi-location dimension; reports and lists can filter by branch.
paths:
  /create/invoice:
    post:
      tags:
        - Invoices
      summary: Create invoice
      operationId: createInvoiceManual
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManualInvoiceCreate'
            examples:
              default:
                value:
                  date: '2026-03-01'
                  document_due: '2026-03-15'
                  currency: NGN
                  document_number: INV-1042
                  narration: Website design services — March
                  customer: a1b2c3d4e5f6478990a1b2c3d4e5f678
                  status: pending
                  amount_paid: 0
                  items:
                    - item_name: UI/UX design
                      quantity: 1
                      selling_price: 100000
                      category: Design Income
                      tax: 7.5
                    - item_name: Implementation support
                      quantity: 1
                      selling_price: 50000
                      category: Service Income
                      tax: 7.5
                      discount: 5
                      discount_type: percent
              paid:
                value:
                  date: '2026-03-01'
                  document_due: '2026-03-15'
                  currency: NGN
                  customer: a1b2c3d4e5f6478990a1b2c3d4e5f678
                  payment_category: Main Operating Account
                  amount_paid: 161250
                  items:
                    - item_name: UI/UX design
                      quantity: 1
                      selling_price: 100000
                      category: Design Income
                      tax: 7.5
                    - item_name: Implementation support
                      quantity: 1
                      selling_price: 50000
                      category: Service Income
                      tax: 7.5
      responses:
        '200':
          description: Invoice created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdamSuccessResponse'
              example:
                status: success
                message: Invoice imported successfully.
                data:
                  - uuid: c4d5e6f7a8b9401a9c2d3e4f5a6b7c8d
                    transaction_type: invoice
                    status: pending
                    document_number: INV-1042
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ManualInvoiceCreate:
      type: object
      required:
        - date
        - document_due
        - currency
        - items
      example:
        date: '2026-03-01'
        document_due: '2026-03-15'
        currency: NGN
        document_number: INV-1042
        narration: Website design services — March
        customer: a1b2c3d4e5f6478990a1b2c3d4e5f678
        status: pending
        amount_paid: 0
        items:
          - item_name: UI/UX design
            quantity: 1
            selling_price: 100000
            category: Design Income
            tax: 7.5
          - item_name: Implementation support
            quantity: 1
            selling_price: 50000
            category: Service Income
            tax: 7.5
            discount: 5
            discount_type: percent
      properties:
        date:
          type: string
          format: date
          description: Invoice date.
        document_due:
          type: string
          format: date
          description: 'Due date. Alias: `due_date`.'
        currency:
          type: string
          description: Currency code, e.g. `NGN`.
        items:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ManualDocumentLineItem'
          description: Line items. Document total is computed from here.
        customer:
          type: string
          description: >-
            Contact uuid, name, or email. Aliases: `contact`, `contact_uuid`,
            `vendor`.
        document_number:
          type: string
          description: Invoice number. Auto-suggested if omitted.
        narration:
          type: string
          description: 'Document title. Alias: `title`.'
        memo:
          type: string
          description: 'Internal note. Alias: `note`.'
        document_note:
          type: string
          description: Note printed on the invoice.
        status:
          type: string
          description: Default `pending`. Use `draft` to save without posting.
        exchange_rate:
          type: number
          description: Default `1`.
        shipping_fee:
          type: number
          description: Shipping amount added to the invoice.
        receivable_account:
          type: string
          description: Accounts receivable control account — name, uuid, or code.
        amount_paid:
          type: number
          description: Payment collected on create. `0` or omit for unpaid.
        payment_category:
          type: string
          description: >-
            Cash or bank account **name** when recording payment on create.
            Aliases: `paid_through`, `payment_account`.
        branch:
          type: string
          description: >-
            Branch id. Same as `branch_uuid`. Leave both off to use the business
            default branch. A name is not accepted, and a new branch is not
            created. An id that is not one of your branches is still saved, but
            it will not show under a location in reports.
        branch_uuid:
          type: string
          description: 'Branch id from `GET /branches`. Alias: `branch`.'
        department:
          type: string
          description: >-
            Department id. Same as `department_uuid`. An unknown id is saved as
            sent and does not create a department. To add one from a name, send
            `department_name` and leave this off.
        department_uuid:
          type: string
          description: 'Department id from `GET /departments`. Alias: `department`.'
        department_name:
          type: string
          description: >-
            Department name. Capitalization does not matter. If no department
            has that name, Tyms adds one and tags this document with it. Ignored
            when `department` or `department_uuid` is set.
        project_uuid:
          type: string
          description: >-
            Project id from `GET /projects`. An unknown id is saved as sent and
            does not create a project. To add one from a name, send
            `project_name` and leave this off.
        project_name:
          type: string
          description: >-
            Project name, matched exactly, including capital letters. If no
            project has that name, Tyms adds an active project that starts today
            and ends in one month, then tags this document with it. Ignored when
            `project_uuid` is set.
        employee:
          type: string
          description: >-
            Team member id. Same as `employee_uuid`. An unknown id is saved as
            sent and does not add a person. To add one from a name, send
            `employee_name` and leave this off.
        employee_uuid:
          type: string
          description: 'Team member id. Alias: `employee`.'
        employee_name:
          type: string
          description: >-
            Full name of the team member. If nobody matches, Tyms adds them.
            Ignored when `employee` or `employee_uuid` is set.
    AdamSuccessResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          example: success
        message:
          type: string
        data:
          description: >-
            Single resource, array of resources, statement sections, or async
            job metadata — see each operation's example.
        meta:
          type: object
          additionalProperties: true
          description: >-
            Pagination (`page`, `limit`, `total`) and/or report range (`from`,
            `to`). Cash flow may include `previous_period_end`.
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: failed
        message:
          type: string
    ManualDocumentLineItem:
      type: object
      required:
        - item_name
        - quantity
        - selling_price
        - category
      properties:
        item_name:
          type: string
          description: 'Line label. Alias: `name`.'
        quantity:
          type: number
          description: Quantity sold or purchased.
        selling_price:
          type: number
          description: 'Unit price. On bills this is unit cost. Alias: `price`.'
        category:
          type: string
          description: >-
            Required. Revenue, expense, or inventory account — name, uuid, or
            account code.
        description:
          type: string
          description: Optional line description.
        tax:
          type: number
          description: >-
            Tax rate as a percentage (e.g. `7.5` = 7.5%). Preferred over
            `tax_uuid`.
        tax_uuid:
          type: string
          description: Optional tax record uuid instead of `tax` percentage.
        withholding_tax:
          type: number
          description: Withholding tax (WHT) rate as a percentage.
        withholding_tax_uuid:
          type: string
          description: Optional WHT uuid instead of `withholding_tax` percentage.
        discount:
          type: number
          description: Line discount value.
        discount_type:
          type: string
          enum:
            - percent
            - amount
            - fixed
          description: '`percent` or `amount` / `fixed`.'
        is_inventory:
          type: boolean
          description: '`true` if the line affects stock.'
        uuid:
          type: string
          description: Existing inventory item uuid when linking stock.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Business secret `tyms_sk_...` for business-scoped routes. Partner secret
        for register-business and referred-business distributor routes.
      x-default: your_tyms_sk_or_partner_key

````

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