報價單

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

quote_convert

寫入可試算核可:不用

把報價單轉成訂單,報價單變成 CONVERTED;issue_bill(預設 true)同時開一張全額的請款單。要帶 quote_get 拿到的 version。

給 Agent 的原文

Turn a quote into an order; the quote becomes CONVERTED. issue_bill (default true) also issues a bill for the full amount. Send the version from quote_get.

參數

名稱型別必填說明
quotestring必填Quote number (QT-000001) or id
versioninteger必填
due_datedate(可以是 null)Empty uses the default payment term; not allowed with issue_bill: false
issue_billbooleanAlso issue a bill for the full amount (needs bills:create) default: true
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.

授權項目:quotes:convert;issue_bill 是 true(沒帶也是)時,另外要 bills:create。

quote_create

寫入可試算核可:不用

建立報價單(DRAFT),不會成立訂單或開請款單。可以先試算看金額。

給 Agent 的原文

Create a quote (status DRAFT). It does not create an order or a bill. Use dry_run to see the amounts first.

參數

名稱型別必填說明
itemsItem[]必填
items[].namestring必填
items[].unit_pricestring必填Amount as a string, e.g. "12000" or "12.50"
items[].quantityintegerdefault: 1
items[].discountDiscount(可以是 null)
items[].descriptionstring
items[].refstringItem code in an external system
currencystring(可以是 null)Empty uses the default currency of the workspace
localestring(可以是 null)
tax_includedbooleandefault: true
tax_typeTAXABLE | ZERO_RATED | EXEMPTdefault: "TAXABLE"
buyerBuyer(可以是 null)
buyer.legal_namestringEmpty uses the customer name
buyer.tax_idstring
buyer.addressstring
buyer.primary_emailstring
buyer.cc_emailsstring[]default: []
notesstring(可以是 null)Empty uses the default notes of the locale
customerCustomer(可以是 null)Required unless customer_id is given
customer.namestring必填
customer.refstringCustomer code in an external system; only stored and used for filtering
customer_idstring(可以是 null)Customer number or id (needs customers:read): customer and buyer fields you leave out are filled from the customer
valid_untildate(可以是 null)Omitted uses the default validity; null means none
agent_notestring
metadataMetadataEntry[](可以是 null)
metadata[].keystring必填
metadata[].valuestring必填
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.

授權項目:quotes:write;帶 customer_id 從客戶帶入資料時,另外要 customers:read。

quote_get

核可:不用

用編號(QT-000001)或 id 查一張報價單,附 version、分享連結(要 pii:read)和 allowed_actions。

給 Agent 的原文

Get one quote by number (QT-000001) or id, with its version, share_url (needs pii:read) and allowed_actions.

參數

名稱型別必填說明
quotestring必填Quote number (QT-000001) or id

授權項目:quotes:read

核可:不用

查報價單,新的在前;回摘要,要一張的完整內容用 quote_get。

給 Agent 的原文

Search quotes, newest first. Returns summaries; use quote_get for one quote.

參數

名稱型別必填說明
limitinteger1 to 100 default: 20
cursorstring(可以是 null)next_cursor from the previous page
keywordstringPart of the quote number or customer name; an email or phone needs pii:read
item_namestring
customer_refstring(可以是 null)
statusesDRAFT | SENT | ACCEPTED | REJECTED | EXPIRED | CONVERTED[](可以是 null)
created_fromdate(可以是 null)
created_todate(可以是 null)

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

quote_send

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

把報價單寄給報價單上的買方(附 PDF 和分享連結),草稿寄出之後變成已送出。寄出前要先試算,把結果給使用者看、問過使用者,再帶試算給的確認碼寄。

給 Agent 的原文

Email a quotation to the buyer on the quote (primary email and CC), with the PDF attached and a link to the quote's share page. A DRAFT quote becomes SENT once the email is sent. Only DRAFT, SENT and ACCEPTED quotes can be sent. Before sending, call with dry_run: true, show the user the quote, amount and recipients, and ask whether to send; then call again with the confirmation_code from the dry run.

參數

名稱型別必填說明
quotestring必填Quote number (QT-000001) or id
messagestringA note added to the email, up to 1,000 characters
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.

授權項目:quotes:send

quote_set_status

寫入核可:不用

把報價單的狀態改成 DRAFT、SENT、ACCEPTED、REJECTED 或 EXPIRED(CONVERTED 只能經 quote_convert)。

給 Agent 的原文

Change the status of a quote among DRAFT, SENT, ACCEPTED, REJECTED and EXPIRED (CONVERTED only comes from quote_convert).

參數

名稱型別必填說明
quotestring必填Quote number (QT-000001) or id
statusDRAFT | SENT | ACCEPTED | REJECTED | EXPIRED必填
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.

授權項目:quotes:write

quote_update

寫入核可:不用

整份換掉報價單的內容(CONVERTED 的不行),要帶 quote_get 拿到的 version。

給 Agent 的原文

Replace the whole content of a quote (not CONVERTED). Send the version from quote_get.

參數

名稱型別必填說明
itemsItem[]必填
items[].namestring必填
items[].unit_pricestring必填Amount as a string, e.g. "12000" or "12.50"
items[].quantityintegerdefault: 1
items[].discountDiscount(可以是 null)
items[].descriptionstring
items[].refstringItem code in an external system
currencystring(可以是 null)Empty uses the default currency of the workspace
localestring(可以是 null)
tax_includedbooleandefault: true
tax_typeTAXABLE | ZERO_RATED | EXEMPTdefault: "TAXABLE"
buyerBuyer(可以是 null)
buyer.legal_namestringEmpty uses the customer name
buyer.tax_idstring
buyer.addressstring
buyer.primary_emailstring
buyer.cc_emailsstring[]default: []
notesstring(可以是 null)Empty uses the default notes of the locale
quotestring必填Quote number (QT-000001) or id
versioninteger必填
customerCustomer必填
customer.namestring必填
customer.refstringCustomer code in an external system; only stored and used for filtering
valid_untildate(可以是 null)
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.

授權項目:quotes:write、pii:read

quote_update_agent_data

寫入核可:不用

換掉報價單上給 agent 用的備註和 metadata;網站、PDF、分享頁都不顯示,不用帶 version。

給 Agent 的原文

Replace the agent note and metadata of a quote. Not shown on the website, PDF or share page; no version needed.

參數

名稱型別必填說明
agent_notestring必填
metadataMetadataEntry[]必填
metadata[].keystring必填
metadata[].valuestring必填
quotestring必填Quote number (QT-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.

授權項目:quotes:write