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

# Create bill



## OpenAPI

````yaml /openapi/adam-v1.json post /create/bill
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.usetyms.com/v1/adam
    description: Sandbox (pre-production). Request credentials at developer@usetyms.com.
  - url: https://api.usetyms.com/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).
paths:
  /create/bill:
    post:
      tags:
        - Bills
      summary: Create bill
      operationId: createBillManual
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManualBillCreate'
            examples:
              default:
                value:
                  date: '2026-03-02'
                  document_due: '2026-03-16'
                  currency: NGN
                  document_number: BILL-550
                  narration: Office supplies — Q1 restock
                  customer: v8e7d6c5b4a3418290f0e9d8c7b6a5947
                  payment_category: Petty Cash
                  amount_paid: 42000
                  items:
                    - item_name: Printer paper A4
                      quantity: 10
                      selling_price: 3200
                      category: Office Supplies
                      tax: 0
                    - item_name: Toner cartridge
                      quantity: 1
                      selling_price: 10000
                      category: Office Supplies
      responses:
        '200':
          description: Bill created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdamSuccessResponse'
              example:
                status: success
                message: Bill imported successfully.
                data:
                  - uuid: b5c6d7e8f9a0418290a1b2c3d4e5f6b7
                    transaction_type: bills
                    status: pending
                    document_number: BILL-550
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ManualBillCreate:
      type: object
      required:
        - date
        - document_due
        - currency
        - items
      example:
        date: '2026-03-02'
        document_due: '2026-03-16'
        currency: NGN
        document_number: BILL-550
        narration: Office supplies — Q1 restock
        customer: v8e7d6c5b4a3418290f0e9d8c7b6a5947
        payment_category: Petty Cash
        amount_paid: 42000
        items:
          - item_name: Printer paper A4
            quantity: 10
            selling_price: 3200
            category: Office Supplies
            tax: 0
          - item_name: Toner cartridge
            quantity: 1
            selling_price: 10000
            category: Office Supplies
      properties:
        date:
          type: string
          format: date
          description: Bill date.
        document_due:
          type: string
          format: date
          description: 'Payment due date. Alias: `due_date`.'
        currency:
          type: string
          description: Currency code.
        items:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ManualDocumentLineItem'
        customer:
          type: string
          description: 'Vendor uuid, name, or email. Alias: `vendor`.'
        document_number:
          type: string
          description: 'Bill reference. Alias: `bill_no`.'
        narration:
          type: string
          description: Document title.
        memo:
          type: string
          description: Internal note.
        payable_account:
          type: string
          description: Optional accounts payable control account.
        amount_paid:
          type: number
          description: Amount paid now. Omit for an open bill.
        payment_category:
          type: string
          description: Cash or bank account **name** payment came from.
        exchange_rate:
          type: number
          description: Default `1`.
        status:
          type: string
          description: Default `pending`. Use `draft` to save without posting.
    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
      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: >-
            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

````