Skip to content

Developers

The MyBizMate API

Read and record your company's transactions from your own systems. Every transaction tab of the Sheets but Payroll answers at one address, in JSON, held to the same rules as the screen: the same permissions, period locks, approvals and tax.

POST https://mybizmate.io/api/v1/<resource>/<action>

On this page

Quick start

  1. 1. Turn developer mode on. In MyBizMate, an owner or admin of the company opens Developers and turns it on. It comes with the ERP plans.
  2. 2. Create an API key. Name it for the system that will use it and choose what it may do. You are shown a key ID (mbk_…) and a secret (mbs_…). The secret is shown once.
  3. 3. Ask for your company. This needs only the Read permission, so it is the quickest way to see that the key works.
A first request
curl -X POST "https://mybizmate.io/api/v1/company/get" \
  -u "mbk_YOUR_KEY_ID:mbs_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d "{}"
Its answer
{
  "company": {
    "id": "6f1c2d3e-8a4b-4c5d-9e6f-0a1b2c3d4e5f",
    "name": "Sample Trading",
    "legal_name": "Sample Trading Corporation",
    "trade_name": null,
    "tin": "123-456-789-00000",
    "branch_code": "00000",
    "vat_registered": true,
    "currency": "PHP"
  }
}

The same call from code, as a helper the rest of this guide uses:

Node.js
// Node.js 18 or later. Keep the two values in your server's environment.
const KEY_ID = process.env.MYBIZMATE_KEY_ID;
const SECRET = process.env.MYBIZMATE_SECRET;

export async function mybizmate(resource, action, body = {}, idempotencyKey) {
  const res = await fetch(`https://mybizmate.io/api/v1/${resource}/${action}`, {
    method: "POST",
    headers: {
      Authorization: "Basic " + Buffer.from(`${KEY_ID}:${SECRET}`).toString("base64"),
      "Content-Type": "application/json",
      ...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
    },
    body: JSON.stringify(body),
  });
  const answer = await res.json();
  if (!res.ok) {
    throw Object.assign(new Error(answer.error), { status: res.status, reason: answer.reason });
  }
  return answer;
}

const { company } = await mybizmate("company", "get");
Python
import os
import requests

def mybizmate(resource, action, body=None, idempotency_key=None):
    res = requests.post(
        f"https://mybizmate.io/api/v1/{resource}/{action}",
        json=body or {},
        auth=(os.environ["MYBIZMATE_KEY_ID"], os.environ["MYBIZMATE_SECRET"]),
        headers={"Idempotency-Key": idempotency_key} if idempotency_key else {},
        timeout=30,
    )
    answer = res.json()
    if not res.ok:
        raise RuntimeError(f"{res.status_code} {answer.get('reason')}: {answer.get('error')}")
    return answer

company = mybizmate("company", "get")["company"]

Authentication

Every request carries the key as HTTP Basic: the key ID as the user name and the secret as the password. That is the -u option of curl, and the Authorization: Basic … header in code.

  • A key belongs to one company and reaches only its books. A request never has to name the company.
  • A key acts as the person who created it. It can do what that owner or admin can do in the company, within the key's own permissions, and the audit trail names them. It stops working if they are no longer an owner or admin there.
  • The secret is shown once. MyBizMate keeps a one-way hash of it and cannot show it again. If it is lost or exposed, the person the key acts as replaces it, and the old secret stops working at once. Any owner or admin can revoke a key.
  • Call the API from a server. It does not answer browsers on other sites, so a secret never has a reason to be in a web page or a mobile app.

Permissions

A key holds one or more of three permissions. Each stands on its own: a key that creates drafts and also looks records up needs both.

The three permissions
PermissionWhat it allows
ReadList and open the documents of every transaction tab but Payroll, and customers, suppliers, items and other lists.
Create and change draftsCreate, change and discard drafts, and turn an order into a draft invoice or bill.
Post, void and cancelPost drafts to the books and void what was posted; move an order along its steps (confirm it, release a purchase order) or cancel it. Give this only to an integration that should act without a person's review.

Requests and answers

Every call is a POST with a JSON object as its body, and the action's fields in that object. An action that takes none is sent {}. The body may be up to 1 MB.

A call that worked answers 200 with the action's own answer. A list answers data (an array), has_more and next; a get answers data (one record). A call that did not work answers its status with two fields:

A refusal
HTTP/1.1 403 Forbidden
Content-Type: application/json

{
  "error": "This API key does not have the \"post\" permission this action needs.",
  "reason": "missing_scope"
}

error is a sentence for a person. Where a rule of the books refuses the call, it is the sentence shown on screen for the same thing. reason is a stable code for your program to branch on.

Amounts are numbers in the company's currency. Dates are YYYY-MM-DD; instants are ISO 8601 with an offset. Ids are UUIDs.

Safe retries

Networks fail between a request and its answer. Send every request that writes with an Idempotency-Key header: text of your own that names this one piece of work, such as your order number. It is 1 to 255 visible ASCII characters, with no spaces.

  • The same key with the same body answers what the first call answered, and does the work once. Retry as often as you need, even while the first is still running: a retry waits for it, and once it has landed is answered what it was.
  • The same key with a different body is refused with 409, reason idempotency_key_reused: a key names one request.
  • A key is remembered for one action under one API key. order-1001 on quotation/create and on sales_order/create are two requests.
  • After a 500 or a 503, send the same request again with the same key. Nothing is written twice.
  • A request that was refused left nothing behind. Once its cause is fixed, the same key can be sent again.
  • A retry is answered from the key's record for 7 days. After that the same key is refused with 409, reason idempotency_key_expired, and nothing is made again: look up what the first request made.

Lists and keeping a copy in step

A list answers a page: 50 documents or 100 records unless you send a limit, and never more than 200. While has_more is true, send the fields of next back as they are to get the page after it.

Documents come oldest change first, so a system that keeps a copy asks only for what changed since it last looked. A document that changes while you page is listed again, under its new time. A change is listed once it is 5 minutes old, so a run that follows next passes no save that finishes within that time: start each run where the last one stopped, and keep each document by its id. A document read by its id, and the webhooks, are not held back. The document resource lists every sheet document in one feed, each with its type:

Keeping a copy in step
// Every sheet document that changed, oldest change first, a page at a time. A change is listed
// once it is 5 minutes old, so each run starts exactly where the last one stopped.
let cursor = lastRun.cursor ?? {}; // none on a first run: the whole feed is read
for (;;) {
  const page = await mybizmate("document", "list", { limit: 200, ...cursor });
  for (const doc of page.data) {
    await save(doc); // by doc.id: a document seen again replaces your copy; doc.type is its tab
    cursor = { updated_since: doc.updated_at, after_id: doc.id }; // the last one read
  }
  if (!page.has_more) break;
  cursor = page.next; // { updated_since, after_id }: send both back as they are
}
lastRun.cursor = cursor; // where the next run starts

To show a list to a person instead, send sort: "date_desc": newest document first, paged with offset.

Errors and limits

A key may send 120 requests a minute. Past that it is answered 429 with a Retry-After header, in seconds. Give each system its own key: each has its own count, and one can be revoked without stopping the others. A key id sent more than 30 times in a minute from one address with the same secret, which is not valid, is answered 429 too with that secret, from that address, for the rest of that minute; the key's right secret, and other keys, are not affected.

Refusals and what to do
StatusReasonWhat it means
413body_too_largeThe body is larger than 1,000,000 bytes. Send fewer lines in one request.
400body_invalidThe body is not a JSON object.
401invalid_credentialsThe key id or the secret is not valid. A request with no Authorization: Basic header at all is the token API's: answered 401 with {"error": "unauthenticated"} and no reason, or 400 first when its body is not a JSON object.
401key_revokedThe key was revoked. Create a new one.
401key_expiredThe key is past its expiry. Create a new one.
403developer_mode_offDeveloper mode is off for the company. An owner or admin turns it on.
403plan_requiredThe company's plan no longer includes developer mode.
403key_owner_not_adminThe person the key acts as is no longer an owner or admin of the company.
429rate_limitedToo many requests for this key in one minute. Wait the seconds in Retry-After.
429too_many_failed_attemptsThis key id was sent more than 30 times in one minute from your address with this same secret, which is not valid (or the key id is none at all), so that key id with that secret is answered this from your address until the minute ends. The key's right secret, and other keys, are not affected. Check the secret your system sends, or wait the seconds in Retry-After.
404unknown_actionNo such resource or action.
403missing_scopeThe key lacks the permission this action needs.
422field_not_allowedThe body holds a field this action does not take: an id on a create, for one. A sale's or a bill's create names each such field in problems, with what to do about it.
403company_mismatchThe body's company_id names another company than the key's. Leave it out.
422validation_failedA required field is missing, or a field is not the kind the action takes. error lists each.
422idempotency_key_invalidThe Idempotency-Key is not 1 to 255 visible ASCII characters with no spaces.
409idempotency_key_expiredThe Idempotency-Key was used for a request more than 7 days ago, and a retry is answered from its record for 7 days only. It is not made again: look up what it made, or send new work under a new key.
409idempotency_key_reusedThe Idempotency-Key was already used for a different request. Send the first one again unchanged, or use a new key.
404not_foundThe id names no record of this resource.
403permission_deniedThe person the key acts as may not do this in the company. error is the sentence they would read on screen.
422refusedA rule of the books refuses it: a locked period, an approval still waiting, an entry out of balance. error is the sentence shown on screen.
422document_invalidA sale or bill could not be built from the request's cells. problems names each cell (field, and line for a line's) with the sentence the sheet would show.
422cash_terms_in_appA sale or bill on Cash terms posts with the collection or payment the sheet builds from it, so it is entered in MyBizMate. Send "terms": "on_account" for one recorded on account.
422cash_terms_post_in_appA sales invoice or bill on Cash terms records its payment as it posts. Post it in MyBizMate.
422not_a_draftOnly a draft is deleted with a key. Void a posted document instead; a voided one is deleted in MyBizMate.
422discount_amount_requiredA line names a discount_pct and no discount_amount. Send the amount taken off: the books record the amount.
422invalid_requestA value of the request is not valid for this action (an id that names nothing, a number out of range). Correct it and send it again.
422limit_reachedA limit of the company's plan was reached.
409conflictIt conflicts with a record that already exists, such as a number already taken.
503busyAnother request holds the record. Nothing was written: send the same request again.
503timeoutThe call ran longer than the 8 seconds one call may take, the limit MyBizMate's own screens are held to, and was stopped. Nothing was written: send it again after Retry-After (another request may have been holding the record), and if it is stopped again, send fewer lines in one request.
503unavailableMyBizMate did not answer, so whether a write was made is not known. Send it again under the same Idempotency-Key, which never does it twice; without one, look for what it would have made before sending it again.
500server_errorA fault on MyBizMate's side. Send it again with the same Idempotency-Key.

Some refusals of the books carry a reason of their own in place of refused. Branch on the reasons you handle and treat any other 422 as a refusal to show a person, with its error.

What each tab offers

A resource is a tab of the Sheets, or a list the tabs draw on. The path names the resource and what to do with it.

Sales

From a quotation to the money collected.

Sales: resources and actions
TabResourceActions
Quotationsquotationlistgetcreateupdateset_statediscardcancel
Sales Orderssales_orderlistgetcreatecreate_fromupdateset_statediscardcancelcreate_from makes an order from a quotation.
Fulfillmentfulfillmentlistgetcreatecreate_fromupdateset_statediscardcancelcreate_from makes a fulfillment from a sales order.
Deliveriesdeliverylistgetcreatecreate_fromupdateset_statediscardcancelcreate_from makes a delivery from a sales order or a fulfillment.
Salesinvoicelistgetcreatecreate_frompostvoiddeletecreate drafts a sale from its own cells, as the Sales sheet builds it; create_from drafts one from a sales order, a fulfillment or a delivery.
Collectionscollectionlistgetpostvoiddelete
Credit Memocredit_memolistgetpostvoiddelete
Debit Memodebit_memolistgetpostvoiddelete
CWT (2307 received)wht_receivedlistgetpostvoiddeleteA BIR Form 2307 a customer gave for the tax it withheld.

Purchases

From a request to the money paid.

Purchases: resources and actions
TabResourceActions
Purchase Requestspurchase_requestlistgetcreateupdateset_statediscardcancel
Purchase Orderspurchase_orderlistgetcreatecreate_fromupdateset_statediscardcancelcreate_from makes an order from a purchase request.
Purchasesbilllistgetcreatecreate_frompostvoiddeletecreate drafts a bill from its own cells, as the Purchases sheet builds it; create_from drafts one from a purchase order.
Paymentspaymentlistgetpostvoiddelete
Supplier Memosupplier_memolistgetpostvoiddelete
WTP (2307 issued)wht_issuedlistgetpostvoiddeleteA BIR Form 2307 given to a supplier for the tax withheld from them.

Stock and the books

Goods in and out, the general journal, and every sheet document in one feed.

Stock and the books: resources and actions
TabResourceActions
Stock Instock_inlistgetpostvoiddelete
Stock Outstock_outlistgetpostvoiddelete
Stock Transferstock_transferlistgetpostvoiddelete
General Journaljournal_entrylistgetpostvoiddelete
All sheet documentsdocumentlistgetRead only: every tab above, and the opening receivables and payables. Payroll is not read with a key.

Lists

What documents name. Read these to find the ids a document needs.

Lists: resources and actions
TabResourceActions
Companycompanyget
CustomerscustomerlistAlso filtered by tin.
SupplierssupplierlistAlso filtered by tin.
Itemsproductlist
Warehouseswarehouselist
Tax codestax_codelistEach code's kind and rate are the ones in force today; a rate recorded from a later day shows from that day. That day moves no updated_at, so a copy of the tax codes is read whole each day, not by updated_since.
Chart of accountsaccountlist

The sheet tabs

Sales, Purchases, Collections, Payments, the memos, the stock tabs and the General Journal. <resource> is any of their names above.

POST /api/v1/<resource>/listRead

The tab's documents, a page at a time, each with its total, its party and its status.

Fields of /api/v1/<resource>/list
FieldWhat it is
statusOptionaldraft, posted or voided. Any other word is refused.
date_fromOptionalDocuments dated on or after this day (YYYY-MM-DD).
date_toOptionalDocuments dated on or before this day (YYYY-MM-DD).
party_idOptionalOnly this customer's or supplier's documents.
sortOptionalupdated (the default: oldest change first, for keeping a copy in step; a change is listed once it is 5 minutes old, so read a document you have just written with get) or date_desc (newest document first, at once, paged with offset, for a list on a screen; it reaches the newest 10,000 or so).
limitOptionalHow many to answer: 1 to 200, 50 when left out.
updated_sinceOptionalOnly documents changed at or after this instant (ISO 8601 with an offset). A change is listed once it is 5 minutes old, so a reading that follows next passes no save that finishes within that time: start the next reading where the last one stopped.
after_idOptionalWith updated_since, both taken from the next of the page before: the page after it.
offsetOptionalWith sort: date_desc: how many to skip, as the next of the page before says; at most 10,000. Past that no next is given, though has_more still says whether more exist: read a whole tab with sort: updated.
POST /api/v1/<resource>/getRead

One document in full: its lines, what it settles, and what is still open on it.

Fields of /api/v1/<resource>/get
FieldWhat it is
idRequiredThe record's id, as list answers it.
POST /api/v1/<resource>/postPost, void and cancel

Posts a draft to the books, as Post does on the sheet: its journal entry is written.

Fields of /api/v1/<resource>/post
FieldWhat it is
idRequiredThe record's id, as list answers it.
POST /api/v1/<resource>/voidPost, void and cancel

Voids a posted document, reversing its journal entry. The document stays, marked voided.

Fields of /api/v1/<resource>/void
FieldWhat it is
idRequiredThe record's id, as list answers it.
void_reasonRequiredWhy, in words. Kept with the document.
POST /api/v1/<resource>/deleteCreate and change drafts

Removes a DRAFT, and nothing else (not_a_draft): a posted document is voided instead, and a voided one is deleted in MyBizMate.

Fields of /api/v1/<resource>/delete
FieldWhat it is
idRequiredThe record's id, as list answers it.
POST /api/v1/invoice/create_fromCreate and change drafts

Drafts a sales invoice from a sales order, a fulfillment or a delivery, for what is not invoiced yet.

Fields of /api/v1/invoice/create_from
FieldWhat it is
source_document_idRequiredThe sales order, fulfillment or delivery.
doc_dateOptionalThe invoice's date (YYYY-MM-DD). Left out, the company's current business day.
party_idOptionalThe customer, where the source names none.
POST /api/v1/bill/create_fromCreate and change drafts

Drafts a bill from a purchase order, for what is not billed yet.

Fields of /api/v1/bill/create_from
FieldWhat it is
purchase_order_idRequiredThe purchase order.
doc_dateOptionalThe bill's date (YYYY-MM-DD). Left out, the company's current business day.

Every sheet document

POST /api/v1/document/listRead

Every sheet document, whatever its tab, a page at a time and each with its type: one feed to keep a copy of the books in step. It holds every tab's documents and the opening receivables and payables; payroll is not read with a key.

Fields of /api/v1/document/list
FieldWhat it is
statusOptionaldraft, posted or voided. Any other word is refused.
date_fromOptionalDocuments dated on or after this day (YYYY-MM-DD).
date_toOptionalDocuments dated on or before this day (YYYY-MM-DD).
party_idOptionalOnly this customer's or supplier's documents.
sortOptionalupdated (the default: oldest change first, for keeping a copy in step; a change is listed once it is 5 minutes old, so read a document you have just written with get) or date_desc (newest document first, at once, paged with offset, for a list on a screen; it reaches the newest 10,000 or so).
limitOptionalHow many to answer: 1 to 200, 50 when left out.
updated_sinceOptionalOnly documents changed at or after this instant (ISO 8601 with an offset). A change is listed once it is 5 minutes old, so a reading that follows next passes no save that finishes within that time: start the next reading where the last one stopped.
after_idOptionalWith updated_since, both taken from the next of the page before: the page after it.
offsetOptionalWith sort: date_desc: how many to skip, as the next of the page before says; at most 10,000. Past that no next is given, though has_more still says whether more exist: read a whole tab with sort: updated.
POST /api/v1/document/getRead

One sheet document by its id, whatever its tab: what a webhook's document_id is read with.

Fields of /api/v1/document/get
FieldWhat it is
idRequiredThe record's id, as list answers it.

The lists and the company

POST /api/v1/<resource>/listRead

The company's records of this kind, a page at a time, in a steady order.

Fields of /api/v1/<resource>/list
FieldWhat it is
codeOptionalOnly the record with this code.
searchOptionalOnly records whose code or name holds this text.
activeOptionaltrue for records in use, false for archived ones. Left out, both.
updated_sinceOptionalOnly records changed at or after this instant (ISO 8601 with an offset). A filter, not a feed: records are paged by id, and a save still being made while you read can commit afterwards under an earlier time. To keep a copy, start each reading 5 minutes before the last one began, and keep each record by its id.
limitOptionalHow many to answer: 1 to 200, 100 when left out.
after_idOptionalThe next.after_id of the page before: the page after it.
POST /api/v1/company/getRead

The company the key belongs to: its names, TIN, branch code, VAT registration and currency.

It takes no fields: send an empty object.

Creating sales and bills

A sale or a bill is created from its own cells, as a row of the Sales or Purchases sheet is: each line names the account it books to, its tax code and its amount. MyBizMate builds the document as the sheet builds that row: each line's VAT at its tax code's rate on the document's date, a discount taken off before the VAT, the tax withheld from its ATC code, and the receivable or payable on its Trade or Non-Trade account by what the lines sell or buy. It saves a draft, which post posts.

Name each record by its id, as the lists give it: the customer or supplier, each line's account and its tax code. Amounts are numbers. As in a file import, none of the customer's or supplier's defaults is applied (its branch, Terms or payment term): send each cell the document should carry. A request no draft can be made from is answered 422 with every cell at fault in problems, each by its field and, for a line's, its line counted from 1. A warning the sheet would show beside the row comes back in warnings, and the draft is saved.

POST /api/v1/invoice/createCreate and change drafts

Drafts a sale from its own cells, built as the Sales sheet builds a row: each line's VAT at its tax code's rate on the document's date, a discount taken off before the VAT, the customer's expected withholding from its ATC code, and the receivable on its Trade or Non-Trade account by what the lines sell. A Regular customer's sale on account, its lines naming accounts and no items. Answered with the draft's id, its entry's total_debit and total_credit, its updated_at and the warnings the sheet would show beside it; post it with post. A request no draft can be made from is refused, each cell at fault named in problems.

Fields of /api/v1/invoice/create
FieldWhat it is
dateRequiredThe document's date (YYYY-MM-DD).
customer_idRequiredThe customer, by its id from the Customers list.
termsRequiredon_account. A document on Cash terms (cash) is refused (cash_terms_in_app), and so is one that leaves Terms out: as in a file import, a Terms left out is Cash, whatever the customer's or supplier's own default.
linesRequiredAt least one line, at most 200. Each line's fields are listed below.
reference_noOptionalThe invoice's own number (the SI/OR No.), as your paper prints it.
particularsOptionalParticulars: a note kept with the document.
term_typeOptionalThe kind of credit: standard, consignment, charge, cod or check_on_delivery.
terms_daysOptionalCredit days, 0 to 3,650: the due date follows from them where none is sent. The customer's or supplier's default payment term is not applied.
due_dateOptionalWhen it falls due (YYYY-MM-DD).
branch_idOptionalWhere the company keeps branches: main, or one of its branches by its name as MyBizMate spells it. Left out, the document is booked to Main: the customer's or supplier's default branch is not applied. A company with no branches has no such field.
cf_…OptionalA field of the company's own (Settings → Custom fields), by its key. One that names a record of a master is not filled with a key yet.
POST /api/v1/bill/createCreate and change drafts

Drafts a bill from its own cells, built as the Purchases sheet builds a row: each line's Input VAT at its tax code's rate on the document's date (on Importation where the code is one), a discount taken off before the VAT, the tax withheld from its ATC code, and the payable on its Trade or Non-Trade account by what the lines buy. A bill on account, its lines naming accounts and no items. Answered with the draft's id, its entry's total_debit and total_credit, its updated_at and the warnings the sheet would show beside it; post it with post. A request no draft can be made from is refused, each cell at fault named in problems.

Fields of /api/v1/bill/create
FieldWhat it is
dateRequiredThe document's date (YYYY-MM-DD).
supplier_idRequiredThe supplier, by its id from the Suppliers list.
termsRequiredon_account. A document on Cash terms (cash) is refused (cash_terms_in_app), and so is one that leaves Terms out: as in a file import, a Terms left out is Cash, whatever the customer's or supplier's own default.
linesRequiredAt least one line, at most 200. Each line's fields are listed below.
reference_noOptionalThe supplier's invoice number, as their paper prints it.
particularsOptionalParticulars: a note kept with the document.
term_typeOptionalThe kind of credit: standard, consignment, charge, cod or check_on_delivery.
terms_daysOptionalCredit days, 0 to 3,650: the due date follows from them where none is sent. The customer's or supplier's default payment term is not applied.
due_dateOptionalWhen it falls due (YYYY-MM-DD).
branch_idOptionalWhere the company keeps branches: main, or one of its branches by its name as MyBizMate spells it. Left out, the document is booked to Main: the customer's or supplier's default branch is not applied. A company with no branches has no such field.
cf_…OptionalA field of the company's own (Settings → Custom fields), by its key. One that names a record of a master is not filled with a key yet.

A sale's line

Fields of a sale's line
FieldWhat it is
revenue_account_idRequiredThe income account, by its id from the Chart of accounts list.
tax_profile_idRequiredThe line's tax code, by its id from the Tax codes list, at its rate on the document's date. Where the company's books carry no VAT (a Non-VAT plan, or no VAT registration), a sale takes a non-VAT code: a VAT, zero-rated or exempt one is refused, as the Sales sheet offers none of them there.
grossRequiredThe line's amount, a number: VAT included where its tax code charges VAT.
discountOptionalAn amount taken off the line before its VAT, a number.
line_descriptionOptionalWhat the line is, in words.
atc_it_codeOptionalThe ATC code of the income tax the customer withholds from this line (its 2307 to come). A code the ATC list does not hold is refused.
atc_vat_codeOptionalThe ATC code of the VAT the customer withholds.

A bill's line

Fields of a bill's line
FieldWhat it is
expense_account_idRequiredThe account the bill debits — a purchase, an expense or an asset — by its id from the Chart of accounts list. Where the company tracks PPE items, a line on a fixed-asset account is drafted as the Purchases sheet drafts it, and its PPE items are linked in MyBizMate: bill.post refuses the bill until they cover the line.
tax_profile_idRequiredThe line's tax code, by its id from the Tax codes list, at its rate on the document's date. On a company that is not VAT-registered, a line under a VAT code keeps its VAT in its cost, as the Purchases sheet books it: no Input VAT is claimed.
grossRequiredThe line's amount, a number: VAT included where its tax code charges VAT.
discountOptionalAn amount taken off the line before its VAT, a number.
line_descriptionOptionalWhat the line is, in words.
atc_codeOptionalThe ATC code of the tax you withhold from the supplier on this line (EWT). A code the ATC list does not hold is refused.
atc_wvat_codeOptionalThe ATC code of the VAT you withhold from the supplier.

An example

Creating a sale
POST /api/v1/invoice/create
Idempotency-Key: shop-sale-SI-004211

{
  "date": "2026-11-27",
  "customer_id": "0b7e6a52-3c1d-4f8e-9a2b-5d4c3b2a1f0e",
  "terms": "on_account",
  "terms_days": 30,
  "reference_no": "SI-004211",
  "lines": [
    {
      "revenue_account_id": "5f1d3b7a-9c2e-4d6f-8a1b-3c5e7f9a1b2d",
      "tax_profile_id": "7d9f1b3a-5c7e-4a2b-8d6f-0e1a2b3c4d5e",
      "gross": 11200,
      "line_description": "Office chairs, 4 pcs"
    },
    {
      "revenue_account_id": "5f1d3b7a-9c2e-4d6f-8a1b-3c5e7f9a1b2d",
      "tax_profile_id": "7d9f1b3a-5c7e-4a2b-8d6f-0e1a2b3c4d5e",
      "gross": 560,
      "discount": 56,
      "line_description": "Delivery"
    }
  ]
}
The sale's answer
{
  "id": "a3c5e7f9-1b2d-4e6f-8a0b-2c4d6e8f0a1b",
  "total_debit": 11704,
  "total_credit": 11704,
  "updated_at": "2026-11-27T02:14:09.512341+00:00",
  "warnings": []
}

Creating orders

Quotations, Sales Orders, Fulfillment, Deliveries, Purchase Requests and Purchase Orders can be created and changed with a key. <resource> is any of their names.

POST /api/v1/<resource>/listRead

The tab's documents, a page at a time, each with its totals, its step and its status.

Fields of /api/v1/<resource>/list
FieldWhat it is
stateOptionalOnly documents at this step of the tab's flow.
statusOptionaldraft, posted or cancelled. Any other word is refused.
date_fromOptionalDocuments dated on or after this day (YYYY-MM-DD).
date_toOptionalDocuments dated on or before this day (YYYY-MM-DD).
party_idOptionalOnly this customer's or supplier's documents.
sortOptionalupdated (the default: oldest change first, for keeping a copy in step; a change is listed once it is 5 minutes old, so read a document you have just written with get) or date_desc (newest document first, at once, paged with offset, for a list on a screen; it reaches the newest 10,000 or so).
limitOptionalHow many to answer: 1 to 200, 50 when left out.
updated_sinceOptionalOnly documents changed at or after this instant (ISO 8601 with an offset). A change is listed once it is 5 minutes old, so a reading that follows next passes no save that finishes within that time: start the next reading where the last one stopped.
after_idOptionalWith updated_since, both taken from the next of the page before: the page after it.
offsetOptionalWith sort: date_desc: how many to skip, as the next of the page before says; at most 10,000. Past that no next is given, though has_more still says whether more exist: read a whole tab with sort: updated.
POST /api/v1/<resource>/getRead

One document in full: its lines, what it was made from, and next_states, the steps its tab's flow allows from where it stands.

Fields of /api/v1/<resource>/get
FieldWhat it is
idRequiredThe record's id, as list answers it.
POST /api/v1/<resource>/createCreate and change drafts

Creates a draft on the tab. Each line states a quantity and a price; MyBizMate works out its amount, and its tax where it names a tax code.

Fields of /api/v1/<resource>/create
FieldWhat it is
posting_dateRequiredThe document's date (YYYY-MM-DD).
linesRequiredAt least one line, at most 200. Each line's fields are listed below.
party_idOptionalThe customer (sales tabs) or the supplier (purchase tabs).
reference_noOptionalYour own reference for the document: an order number of your system.
memoOptionalA note kept with the document.
due_dateOptionalWhen it falls due (YYYY-MM-DD).
POST /api/v1/<resource>/create_fromCreate and change drafts

Creates the tab's document from the one before it in the flow, carrying the lines named.

Fields of /api/v1/<resource>/create_from
FieldWhat it is
source_document_idRequiredThe document to carry forward.
linesRequiredWhich of its lines, and how much of each: { "source_line_id": "…", "all": true } for all that is left of a line, or "qty" in place of all for part of it. Line ids come from the source's get.
POST /api/v1/<resource>/updateCreate and change drafts

Replaces a draft's header and lines with the ones sent.

Fields of /api/v1/<resource>/update
FieldWhat it is
idRequiredThe record's id, as list answers it.
posting_dateRequiredThe document's date (YYYY-MM-DD).
linesRequiredEvery line the document should hold: a line left out is removed. Send a line's id, as get answers it, for it to stay the same line. Where you change a line's quantity, price or discount, leave its gross_amount, net_amount and tax_amount out: MyBizMate works them out again, and an amount you send is kept as sent and must agree.
party_idOptionalThe customer (sales tabs) or the supplier (purchase tabs).
reference_noOptionalYour own reference for the document: an order number of your system.
memoOptionalA note kept with the document.
due_dateOptionalWhen it falls due (YYYY-MM-DD).
POST /api/v1/<resource>/set_statePost, void and cancel

Moves a document to another step of its tab's flow, as the step menu does on the sheet. Leaving the first step finalises it, so this needs the Post permission.

Fields of /api/v1/<resource>/set_state
FieldWhat it is
idRequiredThe record's id, as list answers it.
to_stateRequiredThe step to move to: the state of one of the next_states that get answers.
POST /api/v1/<resource>/discardCreate and change drafts

Removes a draft that nothing was made from.

Fields of /api/v1/<resource>/discard
FieldWhat it is
idRequiredThe record's id, as list answers it.
POST /api/v1/<resource>/cancelPost, void and cancel

Cancels a document that is past draft. It stays, marked cancelled.

Fields of /api/v1/<resource>/cancel
FieldWhat it is
idRequiredThe record's id, as list answers it.
cancel_reasonRequiredWhy, in words. Kept with the document.

A line

State what you know about a line. MyBizMate works out its amount as quantity times price less the discount, and its tax from the tax code at the rate of the document's date.

Fields of a line
FieldWhat it is
descriptionOptionalWhat the line is, in words. Send the item's name when the line is an item.
item_idOptionalThe item, from the Items list. Needs a qty above zero.
qtyOptionalThe quantity, a number.
unit_priceOptionalThe price of one, a number: what the customer pays, VAT included where the line's tax code is a VAT code.
discount_amountOptionalAn amount taken off the line, a number. Left out, none. A percentage off is sent as its amount: a line that names a discount_pct other than 0 and no discount_amount is refused (discount_amount_required).
tax_code_idOptionalThe line's tax code, from the Tax codes list (an item's own is its default_tax_code_id). Left out, the line is not taxed.
uomOptionalThe unit of measure, one from MyBizMate's list of units.
warehouse_idOptionalThe warehouse the line ships from or receives into.

An example

Creating a quotation
POST /api/v1/quotation/create
Idempotency-Key: web-order-000123

{
  "posting_date": "2026-11-27",
  "party_id": "0b7e6a52-3c1d-4f8e-9a2b-5d4c3b2a1f0e",
  "reference_no": "WEB-000123",
  "lines": [
    {
      "item_id": "c2a4e6f8-1b3d-4a5c-8e7f-9a0b1c2d3e4f",
      "description": "A4 copy paper, ream",
      "qty": 10,
      "unit_price": 285,
      "tax_code_id": "7d9f1b3a-5c7e-4a2b-8d6f-0e1a2b3c4d5e"
    },
    { "description": "Delivery", "qty": 1, "unit_price": 150 }
  ]
}
Its answer
{
  "id": "e4b1c7a9-2f6d-4b8a-9c3e-1d5f7a9b2c4e",
  "total_net": 2694.64,
  "total_tax": 305.36,
  "total_gross": 3000,
  "action": "erp_document.created"
}

From a quotation to a posted sales invoice:

Quotation to posted invoice
// 1. A quotation becomes a sales order: carry every line that is still open.
const { data: quote } = await mybizmate("quotation", "get", { id: quotationId });
const order = await mybizmate(
  "sales_order",
  "create_from",
  {
    source_document_id: quote.id,
    lines: quote.lines.map((line) => ({ source_line_id: line.id, all: true })),
  },
  `order-from-${quote.id}`,
);

// 2. Move the order along its flow: the steps it may take next are in next_states.
const { data: current } = await mybizmate("sales_order", "get", { id: order.id });
await mybizmate(
  "sales_order",
  "set_state",
  { id: order.id, to_state: current.next_states[0].state },
  `confirm-${order.id}`,
);

// 3. Draft its sales invoice, then post it to the books.
const invoice = await mybizmate(
  "invoice",
  "create_from",
  { source_document_id: order.id },
  `invoice-from-${order.id}`,
);
await mybizmate("invoice", "post", { id: invoice.id }, `post-${invoice.id}`);

Webhooks

A webhook tells your system that something happened, so it does not have to keep asking. In MyBizMate, on the Developers page, add an HTTPS address and choose its events. You are shown the endpoint's signing secret once.

Events
EventWhen it is sent
document.postedA sheet document was posted to the books. data.document_id names it: read it with document/get. A posted payroll run sends it too, and is not read with a key.
erp_document.postedA document of the earlier ERP module was posted. Sent only for companies that use that module.
A delivery
POST /your/endpoint
Content-Type: application/json
X-MyBizMate-Signature: t=1795749165,v1=5f2b…c81e
X-MyBizMate-Event-Id: 9a3c1e5b-7d2f-4b6a-8c0e-2f4a6c8e0b1d

{
  "id": "9a3c1e5b-7d2f-4b6a-8c0e-2f4a6c8e0b1d",
  "type": "document.posted",
  "version": 1,
  "occurred_at": "2026-11-27T03:12:45.120Z",
  "company_id": "6f1c2d3e-8a4b-4c5d-9e6f-0a1b2c3d4e5f",
  "correlation_id": "1e3a5c7e-9b1d-4f3a-8c5e-7a9b1c3d5e7f",
  "data": {
    "document_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "doc_no": "SI-000042",
    "gl_entry_id": "3c5e7a9b-1d2f-4b6c-8e0a-2c4e6a8b0d1f",
    "total_debit": 3000,
    "updated_at": "2026-11-27T03:12:45.098Z"
  }
}
  • Answer within 10 seconds with any 2xx status. Do the slow work after you answer.
  • A delivery that fails is sent again, up to 8 times in all, the wait doubling from about a minute. A redirect counts as a failure: give the final address.
  • The same event can arrive twice. Keep the X-MyBizMate-Event-Id of what you have handled and skip one you have seen.
  • Check the signature before you trust a delivery. X-MyBizMate-Signature carries a timestamp t and v1, the HMAC-SHA256 of <t>.<the raw body> in hex, keyed with the endpoint's signing secret.
Checking a signature (Node.js)
import crypto from "node:crypto";

// rawBody is the request body exactly as it arrived, as text, BEFORE any JSON parsing.
export function isFromMyBizMate(rawBody, signatureHeader, signingSecret, toleranceSeconds = 300) {
  const parts = Object.fromEntries((signatureHeader ?? "").split(",").map((p) => p.split("=")));
  const timestamp = Number(parts.t);
  if (!Number.isFinite(timestamp) || !parts.v1) return false;
  // Too old or too far ahead: a valid signature replayed later is refused here.
  if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false;

  const expected = crypto
    .createHmac("sha256", signingSecret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(parts.v1);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Not available yet

Said plainly, so that nobody builds on a guess:

  • Creating a document from nothing on the other classic sheet tabs: Collections, Payments, the memos, the 2307s (CWT and WTP), Stock In, Stock Out, Stock Transfer and the General Journal. Enter it in MyBizMate; it can then be read, posted, voided and deleted with the API.
  • With create on Sales and Purchases: a sale or purchase on Cash terms, a line naming an item, a statutory buyer's sale (Senior Citizen, PWD, Solo Parent, National Athlete or Coach, Medal of Valor), a custom field that names a record of a master, a named payment term (send terms_days or due_date) and a bill's VAT on Invoice cell (on a company that is not VAT-registered, a line under the supplier's VAT code keeps its VAT in its cost and withholds on the amount without it). Enter those in MyBizMate, or draft a sales invoice or a bill from an order with create_from.
  • Posting a sales invoice or a bill on Cash terms. Its collection or payment is recorded as it posts, so it is posted in MyBizMate.
  • Creating or changing customers, suppliers and items. They are read here.
  • Payroll: a key reads no payroll run, since it would read every employee's pay. A posted payroll run still sends document.posted, and document/get answers it not_found.
  • Timekeeping, tax returns and financial reports.
  • Webhook events other than a document being posted, a log of deliveries you can read, and replacing or removing an endpoint's signing secret (an endpoint can be paused).

OpenAPI and help

The same contract is published as an OpenAPI 3.1 document, generated from what the server accepts, for a client generator or an API tool: /api/v1/openapi.json.

Stuck, or need something this page says is not available yet? Write to support@mybizmate.io with the reason you were answered and the time of the request.

Your books, open to your own systems

Developer mode comes with the ERP plans. Start with the books, and connect your online store, your other systems or a field app when you are ready.