Morning (Green Invoice)
Verified@k0renn
npx machina-cli add skill @k0renn/morning-green-invoice --openclawMorning (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
apiKeyIdapiKeySecret
Client (if creating or searching)
name- Optional:
taxId,email,phone,address,city,country
Item (if creating)
nameprice- Optional:
description,currency
Document (if creating)
documentType(Invoice / Receipt / Quote / Order / CreditInvoice / DebitInvoice)clientId(or enough info to create the client)lines[](each line: description or itemId, quantity, unitPrice)- Optional:
currency,language,description,discount
Tool contract
Use the morning tool with an action field.
Supported actions
getTokencreateClientcreateItemcreateDocument- (Optional, if implemented in your tool):
findClient,findItem,getDocument,listDocuments
Guardrails
- Never log or echo
apiKeySecretor JWTs back to the user. - Prefer reusing existing
clientId/itemIdwhen available. - Validate document lines:
quantity> 0unitPrice>= 0
- Currency: default to
"ILS"unless the user specifies otherwise. - Language: default to
"Hebrew"unless the user specifies otherwise.
Examples
1) Authenticate (JWT)
{
"action": "getToken",
"apiKeyId": "YOUR_API_KEY_ID",
"apiKeySecret": "YOUR_API_KEY_SECRET"
}
2) Create a client
{
"action": "createClient",
"jwt": "JWT_FROM_getToken",
"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) Create an item
{
"action": "createItem",
"jwt": "JWT_FROM_getToken",
"item": {
"name": "Consulting hour",
"description": "Senior engineering consulting",
"price": 500,
"currency": "ILS"
}
}
4) Create a document (Invoice)
{
"action": "createDocument",
"jwt": "JWT_FROM_getToken",
"document": {
"documentType": "Invoice",
"language": "English",
"currency": "ILS",
"clientId": "CLIENT_ID",
"description": "Invoice for January services",
"lines": [
{
"description": "Consulting hour",
"quantity": 10,
"unitPrice": 500
}
]
}
}
5) Create a document (Receipt) using itemId
{
"action": "createDocument",
"jwt": "JWT_FROM_getToken",
"document": {
"documentType": "Receipt",
"language": "Hebrew",
"currency": "ILS",
"clientId": "CLIENT_ID",
"lines": [
{
"itemId": "ITEM_ID",
"quantity": 1,
"unitPrice": 1200
}
]
}
}
Error handling
- If token is rejected (401/403): call
getTokenagain 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
Overview
This skill authenticates with Morning GreenInvoice to access core accounting capabilities. Use it to create or update clients and items, and to generate documents such as invoices, receipts, quotes, orders, credits, or debits, returning IDs or view links when supported.
How This Skill Works
The skill uses the Morning tool with an action field to perform operations such as getToken, createClient, createItem, and createDocument. It enforces guardrails like never logging secrets and by default setting currency to ILS and language to Hebrew, while reusing existing IDs when available.
When to Use It
- Authenticate and obtain a JWT for Morning GreenInvoice
- Create or update a client record
- Add or update an item for billing
- Create a document such as an invoice, receipt, quote, order, or credit
- Retrieve document outputs like IDs or view URLs
Quick Start
- Step 1: Authenticate with getToken using apiKeyId and apiKeySecret to get a JWT
- Step 2: Use the JWT to call createClient, createItem, or createDocument as needed
- Step 3: Return created IDs and any output URLs; store IDs for reuse
Best Practices
- Reuse existing clientId or itemId when available
- Validate document lines: quantity > 0 and unitPrice >= 0
- Default currency to ILS and language to Hebrew unless specified
- Never log or echo apiKeySecret or JWTs
- Collect only required fields for each action to minimize errors
Example Use Cases
- Authenticate to Morning and obtain a JWT
- Create a new client with name and taxId and optional contact details
- Create a new item with name price and currency
- Create an invoice for a client with line items
- Receive the documentId or a view link after creation