Skip to content

Get invoice by ID

Request

🔐 Required role: API_ADMIN

📖 Data dictionary: Invoice

Retrieve a specific invoice by its unique identifier

This endpoint provides detailed invoice information including:

  • Complete invoice details and line items
  • Invoice status and payment tracking
  • Client and project relationships
  • Tax calculations and compliance data
  • Payment history and outstanding balances
  • Document generation and delivery status

Invoice Management Features:

  • Invoice lifecycle tracking
  • Payment status monitoring
  • Tax calculation and compliance
  • Client relationship integration
  • Document generation and delivery

Invoice Details Include:

  • Invoice number and reference
  • Invoice status and payment status
  • Client and project information
  • Line items and amounts
  • Tax calculations
  • Payment history

Business Applications:

  • Invoice status monitoring
  • Payment tracking and reconciliation
  • Client billing history
  • Revenue recognition analysis
  • Tax compliance reporting

The invoice is wrapped in an invoice property. An id that matches no invoice returns 200 with "invoice": null; the endpoint never returns 404.

Response Example:

{
  "invoice": {
    "arTranId": 45678,
    "invoiceNumber": "INV-2024-001",
    "dueDate": "2024-12-31T23:59:59Z",
    "status": "POSTED",
    "tax": 2000.00,
    "interest": 0.00,
    "description": "Q4 Financial Audit",
    "createdAt": "2024-12-01T09:00:00Z",
    "updatedAt": "2024-12-15T10:30:00Z",
    "ar_tran": {
      "id": 45678,
      "pmsRef": "AR-2024-045678",
      "transactionDate": "2024-12-01T00:00:00Z",
      "amount": 22000.00,
      "allocated": 15000.00,
      "clientId": 789
    }
  }
}
Security
(BearerAuth and CfAccessClientId and CfAccessClientSecret) or BearerAuth
Path
idinteger, >= 1required

Unique identifier of the invoice

Example:45678
curl -i -X GET \
  https://api.sandbox.aiwyn.app/gql/v1/invoice/45678 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'CF-Access-Client-Id: YOUR_API_KEY_HERE' \
  -H 'CF-Access-Client-Secret: YOUR_API_KEY_HERE'

Responses

Invoice lookup completed. invoice is the invoice, or null when no invoice has this id.

Bodyapplication/json
invoiceobject or nullrequired

The invoice, or null when the id matches no invoice

Response
{ "invoice": { "arTranId": 45678, "invoiceNumber": "INV-2024-001", "dueDate": "2024-12-31T23:59:59", "status": "POSTED", "tax": 2000, "interest": 0, "description": "Q4 Financial Audit", "createdAt": "2024-12-01T09:00:00Z", "updatedAt": "2024-12-15T10:30:00Z", "postedAt": "2024-05-12T22:50:20.595961+00:00", "deliveryMethod": "EMAIL", "emailRecipients": "ap@techflow.example", "invoiceFileId": 88231, "reversalReason": null, "reversedAt": null, "reversedByStaffId": null, "ar_tran": { … } } }