Morning (GreenInvoice)
When to use
Use this skill when you need to interact with
Morning / GreenInvoice to:
- - Get an auth token (JWT) using API key credentials
- Create/update clients
- Create/update items
- Create documents (invoice / receipt / quote / order / credit / debit)
- Retrieve document outputs (e.g., IDs / links) if the tool supports it
What you need from the user
Collect only what’s required for the action:
Authentication
Client (if creating or searching)
- - INLINECODE2
- Optional:
taxId, email, phone, address, city, INLINECODE8
Item (if creating)
- - INLINECODE9
- INLINECODE10
- Optional:
description, INLINECODE12
Document (if creating)
- -
documentType (Invoice / Receipt / Quote / Order / CreditInvoice / DebitInvoice) - INLINECODE14 (or enough info to create the client)
- INLINECODE15 (each line: description or itemId, quantity, unitPrice)
- Optional:
currency, language, description, INLINECODE19
Tool contract
Use the
morning tool with an
action field.
Supported actions
- - INLINECODE22
- INLINECODE23
- INLINECODE24
- INLINECODE25
- (Optional, if implemented in your tool):
findClient, findItem, getDocument, INLINECODE29
Guardrails
- - Never log or echo
apiKeySecret or JWTs back to the user. - Prefer reusing existing
clientId / itemId when available. - Validate document lines:
-
quantity > 0
-
unitPrice >= 0
- - Currency: default to
"ILS" unless the user specifies otherwise. - Language: default to
"Hebrew" unless the user specifies otherwise.
Examples
1) Authenticate (JWT)
CODEBLOCK0
2) Create a client
CODEBLOCK1
3) Create an item
CODEBLOCK2
4) Create a document (Invoice)
CODEBLOCK3
5) Create a document (Receipt) using itemId
CODEBLOCK4
Error handling
- - If token is rejected (401/403): call
getToken again and retry the request once. - If client/item already exists:
- Prefer returning the existing ID (if tool supports lookup),
- Otherwise surface a clear message: “Client already exists; provide clientId or unique identifier.”
- - If validation fails: ask for the missing/invalid fields only (e.g., “quantity must be > 0”).
Output expectations
Return minimally:
- - Created resource IDs (
clientId, itemId, documentId) - Any relevant URLs (PDF / view links) if the API/tool provides them
Morning (GreenInvoice)
使用时机
当您需要通过
Morning / GreenInvoice 执行以下操作时使用此技能:
- - 使用 API 密钥凭证获取认证令牌 (JWT)
- 创建/更新 客户
- 创建/更新 项目
- 创建 单据(发票/收据/报价单/订单/贷项/借项)
- 获取单据输出(如 ID/链接)(如果工具支持)
需要用户提供的信息
仅收集操作所需的信息:
认证
客户(创建或搜索时)
- - name
- 可选:taxId、email、phone、address、city、country
项目(创建时)
- - name
- price
- 可选:description、currency
单据(创建时)
- - documentType(Invoice / Receipt / Quote / Order / CreditInvoice / DebitInvoice)
- clientId(或足够创建客户的信息)
- lines[](每行:description 或 itemId、quantity、unitPrice)
- 可选:currency、language、description、discount
工具约定
使用带有 action 字段的 morning 工具。
支持的操作
- - getToken
- createClient
- createItem
- createDocument
- (可选,如果工具已实现):findClient、findItem、getDocument、listDocuments
安全护栏
- - 切勿将 apiKeySecret 或 JWT 记录或回显给用户。
- 优先复用已有的 clientId / itemId。
- 验证单据行:
- quantity > 0
- unitPrice >= 0
- - 货币:默认使用 ILS,除非用户另有指定。
- 语言:默认使用 Hebrew,除非用户另有指定。
示例
1) 认证 (JWT)
json
{
action: getToken,
apiKeyId: YOUR
APIKEY_ID,
apiKeySecret: YOUR
APIKEY_SECRET
}
2) 创建客户
json
{
action: createClient,
jwt: JWT
FROMgetToken,
client: {
name: Acme Ltd,
taxId: 515555555,
email: billing@acme.com,
phone: +972-50-000-0000,
address: 1 Rothschild Blvd,
city: Tel Aviv,
country: Israel
}
}
3) 创建项目
json
{
action: createItem,
jwt: JWT
FROMgetToken,
item: {
name: Consulting hour,
description: Senior engineering consulting,
price: 500,
currency: ILS
}
}
4) 创建单据(发票)
json
{
action: createDocument,
jwt: JWT
FROMgetToken,
document: {
documentType: Invoice,
language: English,
currency: ILS,
clientId: CLIENT_ID,
description: Invoice for January services,
lines: [
{
description: Consulting hour,
quantity: 10,
unitPrice: 500
}
]
}
}
5) 使用 itemId 创建单据(收据)
json
{
action: createDocument,
jwt: JWT
FROMgetToken,
document: {
documentType: Receipt,
language: Hebrew,
currency: ILS,
clientId: CLIENT_ID,
lines: [
{
itemId: ITEM_ID,
quantity: 1,
unitPrice: 1200
}
]
}
}
错误处理
- - 如果令牌被拒绝(401/403):再次调用 getToken 并重试一次请求。
- 如果客户/项目已存在:
- 优先返回现有 ID(如果工具支持查找),
- 否则给出明确提示:“客户已存在;请提供 clientId 或唯一标识符。”
- - 如果验证失败:仅询问缺失或无效的字段(例如“quantity 必须大于 0”)。
输出预期
最少返回:
- - 创建的资源 ID(clientId、itemId、documentId)
- 如果 API/工具提供,返回相关 URL(PDF/查看链接)