Authentication endpoints for obtaining access tokens and managing API keys.
- List draft invoice histories
Aiwyn API (1.0.0)
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.
- 🔐 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
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
}'- Mock serverhttps://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice_histories
- Staging Environment (Test Data)https://demo.api.aiwyn.ai/gql/v1/draft_invoice_histories
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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
}'{ "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"
}
]
}'GraphQL-style where clause for complex filtering
- Mock serverhttps://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice_histories/search
- Staging Environment (Test Data)https://demo.api.aiwyn.ai/gql/v1/draft_invoice_histories/search
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
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"
}
]
}'{ "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"
}- Mock serverhttps://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice/{id}
- Staging Environment (Test Data)https://demo.api.aiwyn.ai/gql/v1/draft_invoice/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/draft_invoice/56789 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Draft invoice details retrieved successfully
Draft invoice status
Review status
Additional notes or terms
{ "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" }