프로그래밍 API & AI 에이전트
어떤 AI나 시스템에서든 워크스페이스를 운영하세요. Claude, ChatGPT, Gemini를 위한 MCP 서버와 연동용 REST API — 판매, 상품, 재고, 청구, 콘텐츠, 받은편지함.
AI 어시스턴트를 위해 — Claude, ChatGPT, Gemini
MCP 프로토콜llms.txt standardAI 앱에 URL 하나를 붙여 넣고 로그인하세요. Nine의 MCP 서버가 판매, 상품, 재고, 청구, 콘텐츠, 받은편지함에 걸친 86개 도구를 제공합니다. OpenAPI 3와 llms.txt로도 제공됩니다.
Gemini 앱 설정
- 1. Gemini → 설정 → 연결된 앱 → 맞춤 앱 → 맞춤 앱 추가를 엽니다.
- 2. MCP 서버 URL을 입력합니다:
https://app.ninehoang.com/mcp - 3. 다음을 누르고 Nine에서 연결을 승인합니다. 클라이언트 ID나 시크릿은 입력할 필요가 없습니다.
MCP 도구
| Tool Name | Description | Parameters |
|---|---|---|
| get_workspace | Which workspace this connection belongs to, and whether it may write. | none |
| list_sales_orders | Orders, newest first, with customer, status and totals — before tax, tax, total, cost and profit. | search?, status?, customer_id?, start_date?, end_date?, limit?, offset? |
| create_sales_order | Record a sale from products and quantities; names, prices and taxes come from the catalogue. Confirm it in the same call if you like. | lines [{ product_id, quantity, unit_price?, discount_percent? }], customer_id?, ordered_at?, note?, confirm? |
| confirm_sales_order | Confirm a draft: its cost is fixed and goods leave stock — or a delivery is created, with Inventory installed. | id |
| sales_report | Revenue before tax, cost of goods sold and gross profit for any period, with the top products and customers. | start_date?, end_date?, top? |
| list_products | The catalogue with category, cost and sales price, margin per unit, taxes and quantity on hand. | search?, category_id?, kind?, include_archived?, limit?, offset? |
| create_product | Add a product or service with its prices, taxes, tracking and opening stock. | name, kind?, category_id?, tracking?, sales_price?, cost_price?, sales_tax_ids?, purchase_tax_ids?, quantity? |
| list_replenishment | Reorder rules with on hand, incoming, outgoing, forecast — and how much to order. | product_id?, warehouse_id?, to_order_only? |
| create_invoice | A customer invoice or a vendor bill, with lines; post it to give it its number. | kind, partner_id?, reference?, invoice_date?, due_date?, lines?, post?, note? |
| record_invoice_payment | Record money received or paid against a posted invoice or bill. | invoice_id, amount, method_id, received_at?, note? |
| list_entries | A collection's entries — blog posts, services, projects — in every language, with fields, categories, tags and status. | collection, status?, limit?, offset? |
| create_entry | A new draft in any collection, in one language; its article is written next, as Markdown. | collection, title, locale?, slug?, summary?, fields?, parent_id? |
| set_article | Write one language of an entry's article as Markdown — headings, lists, callouts, galleries, embeds. | kind, id, locale, markdown |
| publish_article | Publish a draft now or at a set time, or take it off the site — when the workspace lets assistants publish. | kind, id, action?, at? |
| list_messages | Leads from the website's contact form, newest first, with where each stands in triage. | status?, search?, limit?, offset? |
| create_many | Up to 50 records of any types in one call — one approval. A later item can use an earlier one's result: "$0.id". | items [{ tool, arguments }] |
인증
AI 앱은 OAuth 2.1로 연결합니다(로그인 후 워크스페이스와 권한 선택). 연동 시스템은 요청마다 워크스페이스 토큰을 보냅니다 — Authorization: Bearer nh_ws_…. 저절로 만료되지 않으며, 취소하면 즉시 접근이 끝납니다.
curl "https://app.ninehoang.com/api/v1/sales_orders?select=*&order=ordered_at.desc&limit=20" \ -H "Authorization: Bearer nh_ws_YOUR_API_TOKEN"
curl -X POST "https://app.ninehoang.com/api/v1/tools/confirm_sales_order" \
-H "Authorization: Bearer nh_ws_YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "ORDER_UUID"}'SDK & 빠른 시작
표준 HTTP 클라이언트, JavaScript/TypeScript SDK 또는 Python을 사용하여 워크스페이스에 연결하세요.
# 1. Read rows — any table, with PostgREST filters
curl "https://app.ninehoang.com/api/v1/sales_orders?select=*&order=ordered_at.desc&limit=20" \
-H "Authorization: Bearer nh_ws_YOUR_API_TOKEN"
# 2. Run an action — the same rules the MCP server applies
curl -X POST "https://app.ninehoang.com/api/v1/tools/confirm_sales_order" \
-H "Authorization: Bearer nh_ws_YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id": "ORDER_UUID"}'리소스 엔드포인트 & 스키마
모든 테이블은 PostgREST 쿼리 언어로, 모든 업무 단계는 /api/v1/tools로 — 둘 다 행 수준 보안으로 토큰의 워크스페이스에 한정됩니다.
/api/v1/expenses_transactions| Field | Type | Description / Valid Options |
|---|---|---|
| id | uuid | Primary key identifier |
| name | text | Expense description / item (max 255 chars) |
| amount | numeric | Amount in workspace currency |
| category_id | enum | Options: 'food-drinks', 'entertainment', 'local-transport', 'clothing', 'beauty-care', 'sports', 'essentials', 'fixed-expenses', 'credit-repayment', 'installment-payment', 'family-support', 'travel', 'work-expenses', 'investments', 'other'. Read from `transaction_categories` (the rows offered to Expenses), so this list can grow without a deploy. |
| method_id | enum | Slugs from the transaction_methods table: 'cash', 'bank-transfer', 'mobile-wallet', 'credit-card', 'installment'. Read the live list from /openapi.json. |
| occurred_at | timestamptz | Date and time of transaction |
| note | text | Optional context or memo |
HTTP 상태 코드
API 자체의 오류는 { error }(이유를 설명하는 문장), 테이블 엔드포인트의 오류는 PostgREST의 { code, message }입니다.
Rows read, updated or deleted, or an action's result.
Rows created through POST /api/v1/{resource}; the created rows come back.
An action refused its arguments — { error } says why, in words — or a malformed filter or payload.
Missing, revoked or expired token, or the workspace's API switched off. AI apps reconnect through OAuth.
A read-only token tried to write, or the app that owns the data is not installed.
No such resource or action; GET /api/v1 and GET /api/v1/tools list them.
테넌트 격리 & 보안
모든 API 요청은 Postgres Row Level Security(RLS)를 통해 안전하게 격리됩니다. 시스템 자격 증명 및 내부 인증 설정은 완벽히 보호됩니다.
워크스페이스를 연결할 준비가 되셨나요?
워크스페이스 설정에서 직접 읽기 전용 또는 읽기/쓰기 권한의 API 토큰을 발급받고 관리하세요.