File expense draft
create_expense_draftFiles a paid-expense draft in Taokeh from a receipt. It does not post: the draft stays pending until a person approves it in Taokeh, and only that approval reaches the ledger. debitAccountCode and creditAccountCode are codes listed by expense_accounts; the field rules are in intake_contract. amountUncertain marks a printed total with an uncertain digit; needsReview with a short notes line flags any other doubt for the reviewer. The original receipt can ride the draft and lands on the posted entry on approval, sent one way per call: inline as attachmentBase64 + attachmentMediaType for a small file (with attachmentBytes, so a truncated paste is refused), an attachmentToken from request_attachment_upload for a larger file, or shoeboxItemId for a Shoebox photo. Inline also works for a client that cannot reach taokeh.my for the separate upload. Returns the draft id, review and approval links, and a possibleDuplicate block when a matching entry may already be posted.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"date": "<date>",
"debitAccountCode": "<debitAccountCode>",
"creditAccountCode": "<creditAccountCode>",
"amount": "<amount>"
},
"name": "create_expense_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| memo | No | ||
| notes | No | Short reviewer note (one or two sentences, in the reviewer's language) naming what to double-check: a smudged total, an uncertain party, a judgment call. Shown on the approval card. Empty when nothing needs flagging. | |
| amount | Yes | ||
| currency | No | ||
| inputTax | No | ||
| reference | No | ||
| needsReview | No | ||
| shoeboxItemId | No | Id of the Shoebox photo (from shoebox_items) this draft was read from. Taokeh attaches its own stored copy, so no image is sent with it; mutually exclusive with attachmentBase64 and attachmentToken. A photo already booked, set aside or carrying a pending draft is refused. Approval closes the Shoebox item. | |
| amountUncertain | No | ||
| attachmentBytes | No | Decoded byte size of the original file. With attachmentBase64, the server refuses a truncated paste instead of filing a corrupt file. | |
| attachmentToken | No | Token from request_attachment_upload, after the file bytes were PUT to its uploadUrl; carries a larger file without base64. Mutually exclusive with attachmentBase64. Lands on the posted entry on approval. | |
| attachmentBase64 | No | The original receipt as base64, for a small file (a few KB). It rides the draft and lands on the posted entry on approval. A bad type or oversize file is refused and nothing is filed. | |
| attachmentSha256 | No | SHA-256 of the original file (64 hex chars): an optional second check alongside attachmentBase64. | |
| debitAccountCode | Yes | ||
| creditAccountCode | Yes | ||
| attachmentFilename | No | Optional original filename, e.g. receipt.jpg. | |
| attachmentMediaType | No | MIME type, e.g. 'image/jpeg' or 'application/pdf'. Needed with attachmentBase64; a type that does not match the bytes is refused and nothing is filed. |