請款單

這一頁從系統實際的 tool 產生。授權項目是權杖要勾的項目;「核可」是 Agent 呼叫之後要不要等人在網站上核可。

bill_cancel

寫入核可:看情況這張請款單(或訂單的任一張請款單)寄出過要人核可。

取消一張 UNPAID 的請款單(沒有付款、沒有有效的發票);訂單留著,這筆金額可以再請款。

給 Agent 的原文

Cancel one UNPAID bill (no payments, no valid e-invoice); the order stays and the amount can be billed again.

參數

名稱型別必填說明
billstring必填Bill number (BL-000001) or id
reasonstring必填
idempotency_keystring必填Required for every call that writes (not for dry_run). The same key within 24 hours returns the first result instead of doing it again.

授權項目:bills:cancel

bill_create

寫入可試算核可:不用

從訂單開一張請款單:金額(或訂單總額的百分比;都不帶就是還沒請款的金額)、到期日、標題。同一張訂單的請款單加起來不能超過總額。可以先試算看稅額和還沒請款的金額。

給 Agent 的原文

Issue a bill from an order: amount (or percent of the order total; neither = the unbilled amount), due_date and title. The bills of an order cannot add up to more than its total. Use dry_run to see the tax and the unbilled amount first.

參數

名稱型別必填說明
orderstring必填Order number (OD-000001) or id
amountstring(可以是 null)Amount of this bill; empty uses the unbilled amount of the order; not with percent
percentinteger(可以是 null)1 to 100: this percent of the order total (rounded); not with amount
due_datedate(可以是 null)Empty uses the default payment term
titlestringe.g. Deposit, Final payment; up to 100 characters
dry_runbooleandefault: false
idempotency_keystringRequired for every call that writes (not for dry_run). The same key within 24 hours returns the first result instead of doing it again.

授權項目:bills:create

bill_get

核可:不用

用編號(BL-000001)或 id 查一張請款單:金額、訂單、version、分享連結(要 pii:read)、allowed_actions,以及這把權杖讀得到的付款、退款、統一發票和寄信紀錄。

給 Agent 的原文

Get one bill by number (BL-000001) or id: amounts, order, version, share_url (needs pii:read), allowed_actions, and the payments, refunds, e-invoices and emails this token may read.

參數

名稱型別必填說明
billstring必填Bill number (BL-000001) or id

授權項目:bills:read

寫入核可:不用

重新產生請款單的分享連結,舊的馬上失效。

給 Agent 的原文

Make a new share link for a bill; the old one stops working at once.

名稱型別必填說明
billstring必填Bill number (BL-000001) or id
idempotency_keystring必填Required for every call that writes (not for dry_run). The same key within 24 hours returns the first result instead of doing it again.

授權項目:bills:update、pii:read

核可:不用

查請款單(新的在前,或照到期日);回摘要,要一張的完整內容用 bill_get。

給 Agent 的原文

Search bills (newest first, or by due date). Returns summaries; use bill_get for one bill.

參數

名稱型別必填說明
limitinteger1 to 100 default: 20
cursorstring(可以是 null)next_cursor from the previous page
keywordstringPart of the bill/order number or customer name; an email or phone needs pii:read
item_namestring
customer_refstring(可以是 null)
statusUNPAID | PAID | CANCELLED(可以是 null)
overduebooleandefault: false
created_fromdate(可以是 null)
created_todate(可以是 null)
due_date_fromdate(可以是 null)
due_date_todate(可以是 null)
order_byCREATED_DESC | DUE_DATE_ASCdefault: "CREATED_DESC"
has_refundsbooleandefault: false
has_einvoiceboolean(可以是 null)
emailedboolean(可以是 null)
currencystring(可以是 null)
overdue_days_mininteger(可以是 null)
overdue_days_maxinteger(可以是 null)

授權項目:bills:read;keyword 像 Email 或電話時,另外要 pii:read。

bill_send

寫入可試算核可:不用寄出前要先試算帶確認碼

把請款單寄給客戶(主要 Email 和副本)。一張時跟網站一樣,不能寄就失敗;好幾張時每張各自檢查,回排進佇列的和略過的。可以先試算看會寄給誰。寄出前要先試算,把結果給使用者看、問過使用者,再帶試算給的確認碼寄。

給 Agent 的原文

Email bills to their customers (primary email and cc). With one bill it fails like the website does; with several, each bill is checked on its own and the result lists the queued and the skipped ones. Use dry_run to see who would get them. Before sending, call with dry_run: true, show the user the bills, amounts and recipients, and ask whether to send; then call again with the confirmation_code from the dry run.

參數

名稱型別必填說明
billsstring[]必填1 to 100 bill numbers (BL-000001) or ids
messagestringA note added to the email
dry_runbooleandefault: false
confirmation_codestring(可以是 null)Required unless dry_run is true: the confirmation_code returned by a dry run with the same parameters.
idempotency_keystringRequired for every call that writes (not for dry_run). The same key within 24 hours returns the first result instead of doing it again.

授權項目:bills:send

bill_update_due_date

寫入核可:不用

改 UNPAID 請款單的到期日,要帶 bill_get 拿到的 version。

給 Agent 的原文

Change the due date of an UNPAID bill. Send the version from bill_get.

參數

名稱型別必填說明
billstring必填Bill number (BL-000001) or id
versioninteger必填
due_datedate必填
idempotency_keystring必填Required for every call that writes (not for dry_run). The same key within 24 hours returns the first result instead of doing it again.

授權項目:bills:update