Skip to content

Welcome to Aiwyn API

The Aiwyn API provides programmatic access to our comprehensive suite of financial automation tools. Build powerful integrations and automate your accounting workflows with our RESTful APIs.

Key Features

  • ๐Ÿ” Secure Authentication - Industry-standard OAuth 2.0 and API key authentication
  • ๐Ÿ“Š Real-time Data - Access up-to-date financial information
  • ๐Ÿš€ High Performance - Low latency, high throughput API infrastructure
  • ๐Ÿ“š Comprehensive Coverage - Full access to clients, engagements, expenses, and more
  • ๐Ÿ› ๏ธ Developer-Friendly - Extensive documentation, SDKs, and code examples

API Versioning

We use URL versioning for our APIs. The current version is v1. All endpoints are prefixed with the version number.

Testing Enviornments

  • Sandbox runs the latest development branch.
  • Staging mirrors production behavior and stability.
Download OpenAPI description
Overview
Languages
Servers
Mock server
https://api.doc.aiwyn.ai/_mock/bundle
Sandbox
https://demo.api.aiwyn.ai
Staging
https://staging.api.aiwyn.app

๐Ÿ” Authentication

Authentication endpoints for obtaining access tokens and managing API keys.

Operations

๐Ÿ‘ค Client

Manage client records, profiles, and related operations.

Operations

๐Ÿ“‡ Contact

Manage contact information and relationships for clients.

Operations

๐Ÿงฉ Client Business Entity

Manage client business entities used for client categorization and structure.

Operations

๐Ÿ”— Contact Client

Manage contact โ†” client relationship records.

Operations

๐Ÿชช Contact Info

Manage contact information records (address, email, phone, etc.).

Operations

๐Ÿข Department

Manage departments and organizational units.

Operations

๐Ÿญ Industry

Manage industry classifications.

Operations

๐Ÿงพ Job

Manage jobs/projects.

Operations

๐Ÿงฉ Job Template

Manage job templates.

Operations

๐Ÿฌ Office

Manage office locations.

Operations

๐Ÿ› Org

Manage organizations.

Operations

๐Ÿงท Service Line

Manage service line classifications.

Operations

๐Ÿง‘โ€๐Ÿ’ผ Staff

Manage staff accounts, roles, and permissions.

Operations

๐Ÿ’ณ Payments

Handle incoming and outgoing payments.

Operations

๐Ÿงพ Billing

Manage billing cycles, statements, and billing configurations.

Operations

Request

Retrieve draft invoice histories with basic pagination support

Provides paginated access to draft invoice history records.

Real Example:

curl --location 'https://{{host}}/v1/draft_invoice_histories' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
  "pageSize": 25,
  "page": 0
}'
Security
BearerAuth
Bodyapplication/json
pageSizeinteger[ 1 .. 1000 ]

Maximum number of records to return

Default 50
pageinteger>= 0

Number of records to skip for pagination

Default 0
curl -i -X POST \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice_histories \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 25,
    "page": 0
  }'

Responses

Successfully retrieved draft invoice histories

Bodyapplication/json
draftInvoicesArray of objects(DraftInvoiceHistory)
totalobject
Response
application/json
{ "draftInvoices": [ { โ€ฆ } ], "total": { "aggregate": { โ€ฆ } } }

Request

Advanced draft invoice history filtering with custom GraphQL where clauses and dynamic ordering

Supports client, invoice, job filtering and draftInvoice approvedAt date range.

Real Example:

curl --location 'https://{{host}}/v1/draft_invoice_histories/search' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
  "pageSize": 1,
  "where": {
    "_and": [
      {
        "_or": [
          {
            "clientId": {
              "_in": [1001, 1002]
            }
          },
          {
            "jobId": {
              "_in": [2001, 2002]
            }
          }
        ]
      },
      {
        "active": {
          "_eq": true
        }
      },
      {
        "createdAt": {
          "_gte": "1900-01-01T00:00:00Z"
        }
      },
      {
        "activityType": {
          "_in": [
            "DRAFT_INVOICE_CREATED",
            "DRAFT_INVOICE_RECONCILED"
          ]
        }
      }
    ]
  },
  "orderBy": [
    {
      "clientId": "asc"
    },
    {
      "createdAt": "desc"
    }
  ]
}'
Security
BearerAuth
Bodyapplication/json
pageSizeinteger[ 1 .. 1000 ]
Default 1
whereobject

GraphQL-style where clause for complex filtering

Example: {"_and":[{"_or":[{"clientId":{"_in":[1001,1002]}},{"jobId":{"_in":[2001,2002]}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"activityType":{"_in":["DRAFT_INVOICE_CREATED","DRAFT_INVOICE_RECONCILED"]}}]}
orderByArray of objects

Dynamic ordering specifications

Example: [{"clientId":"asc"},{"createdAt":"desc"}]
curl -i -X POST \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice_histories/search \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 1,
    "where": {
      "_and": [
        {
          "_or": [
            {
              "clientId": {
                "_in": [
                  1001,
                  1002
                ]
              }
            },
            {
              "jobId": {
                "_in": [
                  2001,
                  2002
                ]
              }
            }
          ]
        },
        {
          "active": {
            "_eq": true
          }
        },
        {
          "createdAt": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "activityType": {
            "_in": [
              "DRAFT_INVOICE_CREATED",
              "DRAFT_INVOICE_RECONCILED"
            ]
          }
        }
      ]
    },
    "orderBy": [
      {
        "clientId": "asc"
      },
      {
        "createdAt": "desc"
      }
    ]
  }'

Responses

Successfully retrieved filtered draft invoice histories

Bodyapplication/json
draftInvoicesArray of objects(DraftInvoiceHistory)
totalobject
Response
application/json
{ "draftInvoices": [ { โ€ฆ } ], "total": { "aggregate": { โ€ฆ } } }

Request

Retrieve a specific draft invoice by its unique identifier

This endpoint provides detailed draft invoice information including:

  • Complete draft invoice details and line items
  • Draft status and review information
  • Client and project relationships
  • Tax calculations and compliance data
  • Review history and approval workflow
  • Document generation and delivery preparation

Draft Invoice Management Features:

  • Draft invoice lifecycle tracking
  • Review and approval workflow
  • Tax calculation and compliance
  • Client relationship integration
  • Document preparation and delivery setup

Draft Invoice Details Include:

  • Draft invoice number and reference
  • Draft status and review status
  • Client and project information
  • Line items and amounts
  • Tax calculations
  • Review history

Business Applications:

  • Draft invoice review and approval
  • Tax compliance verification
  • Client billing preparation
  • Revenue recognition planning
  • Document generation preparation

Real Example:

curl --location 'https://{{host}}/v1/draft_invoice/56789' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json'

Response Example:

{
  "id": 56789,
  "draftNumber": "DRAFT-2024-001",
  "reference": "Q4-AUDIT-DRAFT-2024",
  "status": "UNDER_REVIEW",
  "reviewStatus": "PENDING_APPROVAL",
  "clientId": 789,
  "clientName": "Acme Corporation",
  "clientEmail": "billing@acme.com",
  "projectId": 67890,
  "projectName": "Q4 Financial Audit",
  "preparedDate": "2024-12-01T00:00:00Z",
  "proposedIssueDate": "2024-12-15T00:00:00Z",
  "proposedDueDate": "2025-01-15T23:59:59Z",
  "subtotal": 20000.00,
  "taxAmount": 2000.00,
  "totalAmount": 22000.00,
  "currency": "USD",
  "lineItems": [
    {
      "id": 1,
      "description": "Financial Statement Audit",
      "quantity": 80,
      "unitPrice": 250.00,
      "amount": 20000.00,
      "taxRate": 0.10,
      "notes": "Includes fieldwork and report preparation"
    }
  ],
  "reviewHistory": [
    {
      "id": 1,
      "reviewerId": 123,
      "reviewerName": "John Smith",
      "reviewDate": "2024-12-05T10:30:00Z",
      "status": "APPROVED",
      "comments": "All calculations verified and approved"
    },
    {
      "id": 2,
      "reviewerId": 124,
      "reviewerName": "Jane Doe",
      "reviewDate": "2024-12-06T14:15:00Z",
      "status": "PENDING_APPROVAL",
      "comments": "Pending final review"
    }
  ],
  "notes": "Draft invoice for Q4 audit services - pending final review",
  "createdAt": "2024-12-01T09:00:00Z",
  "updatedAt": "2024-12-06T14:15:00Z"
}
Security
BearerAuth
Path
idinteger>= 1required

Unique identifier of the draft invoice

Example: 56789
curl -i -X GET \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice/56789 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Draft invoice details retrieved successfully

Bodyapplication/json
idinteger

Unique draft invoice identifier

Example: 56789
draftNumberstring

Draft invoice number

Example: "DRAFT-2024-001"
referencestring

Draft invoice reference or description

Example: "Q4-AUDIT-DRAFT-2024"
statusstring

Draft invoice status

Enum"DRAFT""UNDER_REVIEW""APPROVED""REJECTED""CONVERTED"
Example: "UNDER_REVIEW"
reviewStatusstring

Review status

Enum"NOT_STARTED""IN_REVIEW""PENDING_APPROVAL""APPROVED""REJECTED"
Example: "PENDING_APPROVAL"
clientIdinteger

Associated client identifier

Example: 789
clientNamestring

Client name

Example: "Acme Corporation"
clientEmailstring

Client billing email

Example: "billing@acme.com"
projectIdinteger

Associated project identifier

Example: 67890
projectNamestring

Project name

Example: "Q4 Financial Audit"
preparedDatestring(date-time)

Date when draft was prepared

Example: "2024-12-01T00:00:00Z"
proposedIssueDatestring(date-time)

Proposed invoice issue date

Example: "2024-12-15T00:00:00Z"
proposedDueDatestring(date-time)

Proposed invoice due date

Example: "2025-01-15T23:59:59Z"
subtotalnumber(decimal)

Draft subtotal before tax

Example: 20000
taxAmountnumber(decimal)

Total tax amount

Example: 2000
totalAmountnumber(decimal)

Total draft amount including tax

Example: 22000
currencystring

Draft currency code

Example: "USD"
lineItemsArray of objects

Draft invoice line items

reviewHistoryArray of objects

Review history for this draft invoice

notesstring

Additional notes or terms

Example: "Draft invoice for Q4 audit services - pending final review"
createdAtstring(date-time)

Draft invoice creation timestamp

Example: "2024-12-01T09:00:00Z"
updatedAtstring(date-time)

Last update timestamp

Example: "2024-12-06T14:15:00Z"
Response
application/json
{ "id": 56789, "draftNumber": "DRAFT-2024-001", "reference": "Q4-AUDIT-DRAFT-2024", "status": "UNDER_REVIEW", "reviewStatus": "PENDING_APPROVAL", "clientId": 789, "clientName": "Acme Corporation", "clientEmail": "billing@acme.com", "projectId": 67890, "projectName": "Q4 Financial Audit", "preparedDate": "2024-12-01T00:00:00Z", "proposedIssueDate": "2024-12-15T00:00:00Z", "proposedDueDate": "2025-01-15T23:59:59Z", "subtotal": 20000, "taxAmount": 2000, "totalAmount": 22000, "currency": "USD", "lineItems": [ { โ€ฆ } ], "reviewHistory": [ { โ€ฆ } ], "notes": "Draft invoice for Q4 audit services - pending final review", "createdAt": "2024-12-01T09:00:00Z", "updatedAt": "2024-12-06T14:15:00Z" }

๐Ÿ“„ Invoices

Create, send, and manage invoices.

Operations

๐Ÿ“‹ Projects

Handle engagements, projects, and workflow tracking.

Operations

โฑ Time

Track and manage billable and non-billable time entries.

Operations

โœ‰๏ธ Engagement

Create, send, and track engagement.

Operations

๐Ÿ›ค Last Mile

Handle the final delivery stage and client closing processes.

๐Ÿ—ƒ๏ธ Records

Create, update, and manage entity records across standard and custom record types.

The Records API provides:

  • Record Operations - Create, update, and delete records for any entity type
  • Schema Discovery - Query available entity types and their field definitions
  • Custom Record Types - Define and manage custom record type schemas
Operations

๐Ÿ”” Event Subscriptions

Create and manage webhook subscriptions for entity events.

The Event Subscriptions API provides:

  • Webhook Management - Create, update, and deactivate webhook subscriptions
  • Event Filtering - Subscribe to specific entity types and operations (CREATE, UPDATE, DELETE)
  • Security - Retrieve webhook signing secrets for payload verification
Operations

๐Ÿ“ File

Download and access files associated with records and documents.

Operations