API Documentation

Complete guide to integrating with MYB.ai

🔍

Getting Started

Welcome to MYB.ai! This documentation will help you integrate our AI-powered billing and accounting platform into your application.

Base URL

All API requests should be made to:

https://api.manageyourbusiness.ai/api
Note: For development, use http://localhost:5137/api

API Version

Current API version: v1

All endpoints are versioned and backward compatible.

Authentication

MYB.ai uses token-based authentication. Include your API token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN

Getting Your API Token

  1. Log in to your MYB.ai account
  2. Navigate to Settings > API Keys
  3. Generate a new API token
  4. Copy and store it securely (it won't be shown again)
Security: Never expose your API token in client-side code or public repositories.

API Endpoints

MYB.ai provides RESTful endpoints for all operations:

Resource Endpoints

  • GET /customers - List all customers
  • POST /customers - Create a new customer
  • GET /Bills - List all bills
  • POST /Bills - Create a new bill
  • GET /payments - List all payments
  • POST /payments - Record a payment
  • GET /Reports - Generate reports

Customers API

List Customers

GET /api/customers?page=1&pageSize=20&action=tblData

Create Customer

POST /api/customers
Content-Type: application/json

{
  "name": "ABC Traders",
  "email": "contact@abctraders.com",
  "phone": "+91 9876543210",
  "address": "123 Main Street, Mumbai"
}

Bills API

List Bills

GET /api/Bills?page=1&pageSize=20

Create Bill

POST /api/Bills
Content-Type: application/json

{
  "customerId": "CUST-001",
  "items": [
    {
      "description": "Product A",
      "quantity": 10,
      "rate": 100,
      "amount": 1000
    }
  ],
  "totalAmount": 1000
}

Payments API

Record Payment

POST /api/payments
Content-Type: application/json

{
  "customerId": "CUST-001",
  "billId": "BILL-001",
  "amount": 1000,
  "mode": "UPI",
  "date": "2025-01-19"
}

Reports API

Generate Report

POST /api/Reports/generate
Content-Type: application/json

{
  "type": "customer-statement",
  "fromDate": "2025-01-01",
  "toDate": "2025-01-31",
  "format": "pdf"
}

Webhooks

MYB.ai supports webhooks for real-time event notifications. Configure webhooks in your account settings.

Supported Events

  • bill.created - When a bill is created
  • payment.received - When a payment is recorded
  • customer.created - When a customer is added

Error Handling

API errors follow a consistent format:

{
  "status": false,
  "message": "Error description",
  "errors": ["Detailed error messages"]
}

HTTP Status Codes

  • 200 - Success
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 500 - Server Error