Skip to content

Aiwyn API (1.0.0)

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.

Download OpenAPI description
Overview
Languages
Servers
Mock server
https://api.doc.aiwyn.ai/_mock/bundle/
Staging Environment (Test Data)
https://demo.api.aiwyn.ai/

🔐 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

🧑‍💼 Staff

Manage staff accounts, roles, and permissions.

Operations

💳 Payments

Handle incoming and outgoing payments.

Operations

List payments

Request

Retrieve payment records with transaction details and security compliance

This endpoint provides secure payment data access with:

  • PCI-compliant payment information (masked card data)
  • Payment method categorization and tracking
  • Integration with AR transactions for complete context
  • Payment processor integration (PayPal, Stripe, etc.)
  • Date-based filtering for reconciliation periods
  • Client relationship data for payment attribution

Security & Compliance:

  • PCI DSS compliant data handling (last 4 digits only)
  • Secure payment processor ID tracking
  • Payment confirmation date logging
  • Audit trail for payment processing

Payment Method Support:

  • Credit/debit card payments with masked PAN
  • ACH/bank transfer processing
  • Check and wire transfer tracking
  • Digital wallet integration (PayPal, Apple Pay, etc.)

Reconciliation Features:

  • Payment-to-invoice matching via AR transactions
  • Payment confirmation status tracking
  • Processor reference ID management
  • Multi-currency payment support

Business Applications:

  • Payment reconciliation and matching
  • Revenue recognition and cash flow analysis
  • Client payment history and patterns
  • Payment method performance analysis
  • Compliance reporting and audit trails

Real Example:

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

Maximum number of payment records to return

Default 25
Example: 25
pageinteger>= 0

Page number for pagination (0-based)

Default 0
Example: 0
clientIdinteger

Filter payments by specific client ID

Example: 789
paymentMethodstring

Filter by payment method type

Enum"CREDIT_CARD""DEBIT_CARD""ACH""BANK_TRANSFER""CHECK""WIRE""PAYPAL""APPLE_PAY""GOOGLE_PAY"
Example: "CREDIT_CARD"
startDatestring(date-time)

Start date for payment date range filter

Example: "2024-01-01T00:00:00"
endDatestring(date-time)

End date for payment date range filter

Example: "2024-12-31T23:59:59"
statusstring

Filter by payment status

Enum"PENDING""CONFIRMED""FAILED""CANCELLED""REFUNDED"
Example: "CONFIRMED"
sortOrderstring

Sort order for payment date

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

Responses

Successfully retrieved payment records

Bodyapplication/json
deid_paymentArray of objects
deid_payment_aggregateobject
Response
application/json
{ "deid_payment": [ {}, {}, {} ], "deid_payment_aggregate": { "aggregate": {} } }

Search payments

Request

Advanced payment filtering with custom GraphQL where clauses and dynamic ordering

Backed by view vw_payment_history_firm_table. Supports text matching, date ranges, and flags.

Real Example:

curl --location 'https://{{host}}/v1/payments/search' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
  "pageSize": 1,
  "where": {
    "_and": [
      {
        "_or": [
          {
            "paymentMethod": {
              "_ilike": "%CREDIT%"
            }
          },
          {
            "cardType": {
              "_ilike": "%VISA%"
            }
          }
        ]
      },
      {
        "isAutomatic": {
          "_eq": false
        }
      },
      {
        "createdAt": {
          "_gte": "1900-01-01T00:00:00Z"
        }
      },
      {
        "paymentConfirmationDate": {
          "_is_null": false
        }
      }
    ]
  },
  "orderBy": [
    {
      "paymentConfirmationDate": "desc"
    },
    {
      "createdAt": "desc"
    }
  ]
}'
Security
BearerAuth
Bodyapplication/json
pageSizeinteger[ 1 .. 1000 ]
Default 1
whereobject

GraphQL-style where clause for complex payment filtering

Example: {"_and":[{"_or":[{"paymentMethod":{"_ilike":"%CREDIT%"}},{"cardType":{"_ilike":"%VISA%"}}]},{"isAutomatic":{"_eq":false}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"paymentConfirmationDate":{"_is_null":false}}]}
orderByArray of objects

Dynamic ordering specifications

Example: [{"paymentConfirmationDate":"desc"},{"createdAt":"desc"}]
curl -i -X POST \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/payments/search \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 1,
    "where": {
      "_and": [
        {
          "_or": [
            {
              "paymentMethod": {
                "_ilike": "%CREDIT%"
              }
            },
            {
              "cardType": {
                "_ilike": "%VISA%"
              }
            }
          ]
        },
        {
          "isAutomatic": {
            "_eq": false
          }
        },
        {
          "createdAt": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "paymentConfirmationDate": {
            "_is_null": false
          }
        }
      ]
    },
    "orderBy": [
      {
        "paymentConfirmationDate": "desc"
      },
      {
        "createdAt": "desc"
      }
    ]
  }'

Responses

Successfully retrieved filtered payments

Get payment by ID

Request

Retrieve a specific payment by its unique identifier

This endpoint provides detailed payment information including:

  • Complete payment transaction details
  • PCI-compliant payment method information (masked)
  • Payment status and confirmation data
  • Associated invoice and client relationships
  • Payment processor integration details
  • Audit trail and security compliance data

Security & Compliance:

  • PCI DSS compliant data handling
  • Secure payment processor ID tracking
  • Payment confirmation date logging
  • Audit trail for payment processing

Payment Details Include:

  • Payment amount and currency
  • Payment method (masked for security)
  • Payment status and confirmation
  • Associated invoice references
  • Client relationship data
  • Payment processor details

Business Applications:

  • Payment verification and reconciliation
  • Client payment history lookup
  • Payment dispute resolution
  • Audit and compliance reporting
  • Payment method analysis

Real Example:

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

Response Example:

{
  "id": 12345,
  "amount": 1500.00,
  "currency": "USD",
  "paymentMethod": "CREDIT_CARD",
  "cardLastFour": "1234",
  "cardType": "VISA",
  "status": "CONFIRMED",
  "confirmationDate": "2024-01-15T10:30:00Z",
  "processorReference": "stripe_pi_1234567890",
  "clientId": 789,
  "clientName": "Acme Corporation",
  "invoiceId": 456,
  "invoiceNumber": "INV-2024-001",
  "createdAt": "2024-01-15T10:25:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
Security
BearerAuth
Path
idinteger>= 1required

Unique identifier of the payment

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

Responses

Payment details retrieved successfully

Bodyapplication/json
idinteger

Unique payment identifier

Example: 12345
amountnumber(decimal)

Payment amount

Example: 1500
currencystring

Payment currency code

Example: "USD"
paymentMethodstring

Method used for payment

Enum"CREDIT_CARD""DEBIT_CARD""ACH""BANK_TRANSFER""CHECK""WIRE""PAYPAL""APPLE_PAY""GOOGLE_PAY"
Example: "CREDIT_CARD"
cardLastFourstring

Last four digits of payment card (PCI compliant)

Example: "1234"
cardTypestring

Type of payment card

Example: "VISA"
statusstring

Current payment status

Enum"PENDING""CONFIRMED""FAILED""CANCELLED""REFUNDED"
Example: "CONFIRMED"
confirmationDatestring(date-time)

Date and time when payment was confirmed

Example: "2024-01-15T10:30:00Z"
processorReferencestring

Payment processor reference ID

Example: "stripe_pi_1234567890"
clientIdinteger

Associated client identifier

Example: 789
clientNamestring

Name of the client who made the payment

Example: "Acme Corporation"
invoiceIdinteger

Associated invoice identifier

Example: 456
invoiceNumberstring

Invoice number for the payment

Example: "INV-2024-001"
createdAtstring(date-time)

Payment creation timestamp

Example: "2024-01-15T10:25:00Z"
updatedAtstring(date-time)

Last update timestamp

Example: "2024-01-15T10:30:00Z"
Response
application/json
{ "id": 12345, "amount": 1500, "currency": "USD", "paymentMethod": "CREDIT_CARD", "cardLastFour": "1234", "cardType": "VISA", "status": "CONFIRMED", "confirmationDate": "2024-01-15T10:30:00Z", "processorReference": "stripe_pi_1234567890", "clientId": 789, "clientName": "Acme Corporation", "invoiceId": 456, "invoiceNumber": "INV-2024-001", "createdAt": "2024-01-15T10:25:00Z", "updatedAt": "2024-01-15T10:30:00Z" }

🧾 Billing

Manage billing cycles, statements, and billing configurations.

Operations

📄 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.