Books by finzkoDevelopers

Contacts

Customers and vendors. Each contact carries optional nested billing + shipping addresses and a list of contact persons.

Resource shape

{
  "contact_id":   "ct_acme",
  "contact_type": "CUSTOMER",         // CUSTOMER | VENDOR | BOTH
  "contact_name": "Acme Corp",
  "display_name": "Acme Corp",
  "legal_name":   "Acme Industries Pvt Ltd",
  "company_name": null,
  "gst_no":       "27AABCC1234D1Z5",
  "gst_treatment": "REGISTERED",
  "pan":          "AABCC1234D",
  "place_of_contact": "IN-MH",
  "email":        "ap@acme.in",
  "phone":        "+91 22 1234 5678",
  "website":      "https://acme.in",
  "billing_address":  { "address": "5 MG Rd", "city": "Mumbai", "state_code": "IN-MH", "zip": "400001", "country": "India" },
  "shipping_address": { … },
  "contact_persons": [ { "first_name": "Asha", "email": "asha@acme.in", "is_primary": true } ],
  "payment_terms": 30,
  "opening_balance": 0,
  "credit_limit": null,
  "currency_code": "INR",
  "status": "ACTIVE",
  "created_time": "2026-05-12T08:30:00",
  "last_modified_time": "2026-05-12T08:30:00"
}
GET/contactsList contactsAIBooks.contacts.READ

Cursor-paginated. Filters by query string.

Query params

ParamTypeNotes
per_pageint1 – 200. Default 50.
cursorstringOpaque cursor from page_context.next_cursor.
contact_typestringCUSTOMER / VENDOR / BOTH
statusstringACTIVE / INACTIVE
searchstringSubstring match on name, GSTIN, email.
curl -X GET 'https://api.aibooks.in/api/public/v1/contacts?per_page=50&contact_type=CUSTOMER' \
  -H 'Authorization: Bearer aibk_pat_…'
GET/contacts/{contact_id}Get one contactAIBooks.contacts.READ
GET /contacts/ct_acme
Authorization: Bearer aibk_pat_…

200 OK
{ "code": 0, "message": "success", "contact": { … } }
POST/contactsCreate a contactAIBooks.contacts.CREATE

Only contact_name is required. Nested addresses and contact_persons[] are optional — pass them inline.

POST /contacts
Authorization: Bearer aibk_pat_…
Content-Type: application/json
Idempotency-Key: bf3e1b08-9a4d-…

{
  "contact_name": "Acme Corp",
  "contact_type": "CUSTOMER",
  "gst_treatment": "REGISTERED",
  "gst_no": "27AABCC1234D1Z5",
  "place_of_contact": "IN-MH",
  "billing_address": {
    "address": "5 MG Rd",
    "city": "Mumbai",
    "state_code": "IN-MH",
    "zip": "400001"
  },
  "contact_persons": [
    { "first_name": "Asha", "email": "asha@acme.in", "is_primary": true }
  ]
}
PUT/contacts/{contact_id}Update a contactAIBooks.contacts.UPDATE

Partial merge — only the fields you send are touched. Nested objects also partial-merge: { "billing_address": { "zip": "560050" } } only updates the ZIP and leaves city + address line 1 alone. Pass null explicitly to clear a field.

For contact_persons[]: passing the array REPLACES it in full. Each item is matched by contact_person_id if present (update); items without an id are inserted as new rows.

POST/contacts/{contact_id}/archiveArchive (soft-delete)AIBooks.contacts.UPDATE
DELETE/contacts/{contact_id}Hard deleteAIBooks.contacts.DELETE

Hard delete only works for contacts with no posted documents. Use archive otherwise — keeps the contact for history but hides it from autocomplete.

POST/contacts/{contact_id}/emailEmail a contact a custom messageAIBooks.contacts.UPDATE

Sends a plain-text email: a statement note, an outstanding summary, a reminder. It is not tied to a document and attaches nothing (use Email send for an invoice or estimate with its PDF).

FieldTypeNotes
subjectstringRequired, 1 – 300 characters.
bodystringRequired. Plain text.
tostring?Recipient. Defaults to the contact's email.
ccstring[]?Optional cc addresses.
POST /contacts/ct_acme/email
Authorization: Bearer aibk_pat_…
Content-Type: application/json

{ "subject": "Payment reminder", "body": "Invoice INV-2026-0042 is due on 11 June." }

200 OK
{
  "code": 0,
  "message": "The email has been sent.",
  "email": { "to": "ap@acme.in", "subject": "Payment reminder", "sent": true }
}

This route has no Idempotency-Key requirement and sending is not deduplicated, so retrying after a timeout can send the email twice. Notable errors:

  • 400 validation.required_field with field: "to" — the contact has no email and you did not pass to.
  • 400 email.send_failed — the mail service refused it; the message carries the reason.
  • 404 not_found.resource — unknown contact.

Contact field packs

A field pack is a ready-made set of custom contact fields for an industry (for example patient fields for a clinic). List the packs, then apply one to create its fields in the organization before you push contacts.

GET/contact-field-packsList field packsAIBooks.contacts.READ
200 OK
{
  "code": 0,
  "message": "success",
  "contact_field_packs": [
    {
      "key": "clinic",
      "name": "Clinic / Patient",
      "industry": "healthcare",
      "description": "…",
      "fieldCount": 8,
      "fields": [ { "label": "Patient ID", "fieldType": "TEXT" }, … ]
    }
  ],
  "page_context": { "per_page": 4, "has_more_page": false }
}

The packs today are automotive, clinic, education and real_estate. Not paginated. The field names inside a pack are camelCase.

POST/contact-field-packs/{key}/applyApply a pack to this organizationAIBooks.contacts.CREATE

No body. Creates the pack's field definitions. Safe to call on every integration start: a field whose API name already exists (including one created by hand with the same label) is skipped.

POST /contact-field-packs/clinic/apply

200 OK
{
  "code": 0,
  "message": "success",
  "contact_field_pack": {
    "pack": "clinic",
    "name": "Clinic / Patient",
    "created": 8,
    "skipped": 0,
    "fields": [
      { "label": "Patient ID", "apiName": "patient_id", "fieldType": "TEXT", "status": "created" },
      …
    ]
  }
}

Unknown key: 404 not_found.resource. Applying a pack twice returns created: 0 and every field with status: "exists".