ApiDocs
Developer Documentation

AiDevX QuotePro API

Push quotes, customers, and inventory into your QuotePro account via a single POST endpoint.

POST/functions/receiveData

All three resource types (quote, customer, inventory) use this same endpoint — the type field in the body determines what gets created.

Authentication

Include your API key in the X-API-Key header on every request. Find your key in Settings → API Key.

bash
curl -X POST https://quotesandinvoices.aidevx.com/functions/receiveData \
  -H "X-API-Key: sk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "type": "quote", "data": { ... } }'
⚠️ Keep your API key secret. Find your App ID in the browser URL when viewing your dashboard.

Create a Quote

Send "type": "quote" to create a new quote. Taxes are automatically calculated based on country and state_province matching your configured tax rules. The quote counter in your business settings is automatically incremented with each API quote created.

bash
curl -X POST https://quotesandinvoices.aidevx.com/functions/receiveData \
  -H "X-API-Key: sk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "quote",
    "data": {
      "title": "Garden Renovation",
      "customer_email": "jessica@example.com",
      "customer_name": [
        { "value": "Jessica Brown" },
        { "label": "Company", "value": "Sunrise Properties" },
        { "label": "Phone", "value": "(487) 707-8851" }
      ],
      "country": "CA",
      "state_province": "BC",
      "customer_po": "PO-12345",
      "direct_to_invoice": true,
      "invoice_date": "2026-07-20",
      "net_terms": 30,
      "line_items": [
        {
          "name": "Labor",
          "description": "On-site work",
          "quantity": 7,
          "unit_price": 88,
          "taxable": true
        },
        {
          "name": "Materials",
          "description": "Supplies and equipment",
          "quantity": 1,
          "unit_price": 129,
          "taxable": true
        },
        {
          "name": "Disposal Fee",
          "description": "Debris removal",
          "quantity": 1,
          "unit_price": 44,
          "taxable": false
        }
      ],
      "notes": "Thank you for choosing our services.",
      "terms": "Payment due within 30 days of invoice date.",
      "valid_until": "2026-03-26"
    }
  }'

Response

json
{
  "success": true,
  "action": "created",
  "id": "abc123",
  "quote_number": "Q-2026-0001",
  "access_token": "qt_...",
  "public_url": "https://quotesandinvoices.aidevx.com/QuotePublicView?token=qt_..."
}

// When "direct_to_invoice": true, the response also includes:
{
  "success": true,
  "action": "converted",
  "quote_id": "abc123",
  "quote_number": "Q-2026-0001",
  "invoice_id": "inv123",
  "invoice_number": "INV-2026-0001",
  "invoice_access_token": "inv_...",
  "invoice_public_url": "https://quotesandinvoices.aidevx.com/InvoicePublicView?token=inv_..."
}

Quote Fields

typestringrequiredMust be "quote"
data.customer_emailstringrequiredCustomer email address
data.customer_namearrayoptionalArray of {value} or {label, value} objects
data.titlestringoptionalJob or project title
data.line_itemsarrayrequiredArray of line items (name, quantity, unit_price, taxable)
data.countrystringoptionalISO country code e.g. "CA", "US" — used for tax matching
data.state_provincestringoptionalState or province — used for tax matching
data.customer_postringoptionalCustomer PO number — shown on quote & carried to invoice
data.direct_to_invoicebooleanoptionalIf true, converts the quote to an invoice immediately and returns invoice links
data.invoice_datestringoptionalInvoice date in YYYY-MM-DD — overrides the creation date on the invoice (use with direct_to_invoice)
data.net_termsnumberoptionalNet terms in days (e.g. 30 = Net 30) — stored on quote; invoice due date is calculated as invoice date + net terms. Defaults to 30
data.notesstringoptionalNotes shown on the quote
data.termsstringoptionalTerms & conditions
data.valid_untilstringoptionalExpiry date in YYYY-MM-DD format

Create / Update a Customer

Send "type": "customer" to upsert a customer by email.

bash
curl -X POST https://quotesandinvoices.aidevx.com/functions/receiveData \
  -H "X-API-Key: sk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "customer",
    "data": {
      "name": "Jessica Brown",
      "email": "jessica@example.com",
      "phone": "(487) 707-8851",
      "company": "Sunrise Properties",
      "address_line1": "123 Oak Street",
      "city": "Vancouver",
      "state_province": "BC",
      "postal_code": "V5K 0A1",
      "country": "CA"
    }
  }'

Response

json
{
  "success": true,
  "action": "created",
  "id": "xyz789"
}

Retrieve Quotes & Invoices

Fetch all quotes and invoices for a specific business using a GET request. Quotes will include any associated invoices.

bash
curl -X GET "https://quotesandinvoices.aidevx.com/functions/getQuotesAndInvoices?business_id=YOUR_BUSINESS_ID" \
          -H "X-API-Key: sk_your_api_key_here"

Response

json
{
          "success": true,
          "business_id": "abc123",
          "quotes": [
          {
          "id": "q123",
          "quote_number": "Q-2026-0001",
          "customer_name": "Jessica Brown",
          "customer_email": "jessica@example.com",
          "status": "Approved",
          "total": 1261,
          "created_date": "2026-02-15T10:30:00Z",
          "invoices": [
          {
          "id": "inv123",
          "invoice_number": "INV-2026-0001",
          "status": "Paid",
          "total": 1261,
          "created_date": "2026-02-16T14:22:00Z"
          }
          ]
          }
          ],
          "invoices": [
          {
          "id": "inv123",
          "invoice_number": "INV-2026-0001",
          "quote_id": "q123",
          "customer_name": "Jessica Brown",
          "status": "Paid",
          "total": 1261,
          "created_date": "2026-02-16T14:22:00Z"
          }
          ]
          }

Query Parameters

business_idstringrequiredThe business ID to retrieve quotes and invoices for

Sync Inventory

Send "type": "inventory" to upsert a product or service item by name.

bash
curl -X POST https://quotesandinvoices.aidevx.com/functions/receiveData \
  -H "X-API-Key: sk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "inventory",
    "data": {
      "name": "Labor",
      "description": "On-site work",
      "unit_price": 88,
      "cost_price": 55,
      "category": "Services",
      "unit": "hour",
      "taxable": true,
      "is_active": true
    }
  }'

Response

json
{
  "success": true,
  "action": "updated",
  "id": "inv_abc"
}

Responses & Errors

All responses are JSON. Successful requests return 200. Errors include a descriptive message.

200

Success

Request processed successfully.

400

Bad Request

Missing required fields or invalid JSON body.

401

Unauthorized

Missing X-API-Key header.

403

Forbidden

Invalid API key — no matching business found.