Awesome-claude-skills-cn NetSuite Automation
NetSuite 自动化:通过 Oracle NetSuite ERP 的 SuiteQL 查询管理客户、销售订单、发票、库存和记录。
git clone https://github.com/Athe1st3154/awesome-claude-skills-cn
T=$(mktemp -d) && git clone --depth=1 https://github.com/Athe1st3154/awesome-claude-skills-cn "$T" && mkdir -p ~/.claude/skills && cp -r "$T/composio-skills/netsuite-automation" ~/.claude/skills/athe1st3154-awesome-claude-skills-cn-netsuite-automation && rm -rf "$T"
composio-skills/netsuite-automation/SKILL.mdNetSuite Automation
Automate Oracle NetSuite ERP operations including creating customers and sales orders, running SuiteQL queries, upserting records by external ID, and inspecting record metadata for comprehensive business management.
Toolkit docs: composio.dev/toolkits/netsuite
设置
This skill requires the Rube MCP server connected at
https://rube.app/mcp.
Before executing any tools, ensure an active connection exists for the
netsuite toolkit. If no connection is active, initiate one via RUBE_MANAGE_CONNECTIONS.
Core Workflows
1. Create Sales Orders
Create customer orders with line items including item references, quantities, and pricing.
Tool:
NETSUITE_CREATE_SALES_ORDER
Key Parameters:
(required) -- Customer reference:entity{"id": "<internal_id>"}
(required) -- Container withitem
array, each containing:items
(required) -- Item reference:item{"id": "<internal_id>"}
(required) -- Units to order (non-negative)quantity
-- Unit price (optional if item has default pricing)rate
-- Total line amount (alternative to rate)amount
-- Tax code reference:taxcode
(required if SuiteTax enabled){"id": "<internal_id>"}
-- Line item notesdescription
-- Transaction date intranDate
formatYYYY-MM-DD
-- Header memomemo
--orderStatus
(Pending Approval) or"A"
(Pending Fulfillment)"B"
-- External reference or PO numberotherrefnum
Example:
Tool: NETSUITE_CREATE_SALES_ORDER Arguments: entity: {"id": "1234"} item: { "items": [ {"item": {"id": "56"}, "quantity": 10, "rate": 25.00}, {"item": {"id": "78"}, "quantity": 5, "rate": 50.00} ] } tranDate: "2026-02-11" memo: "Q1 bulk order" orderStatus: "B"
2. Run SuiteQL Queries
Execute ad-hoc SQL queries against NetSuite data with server-side paging.
Tool:
NETSUITE_RUN_SUITEQL_QUERY
Key Parameters:
(required) -- SuiteQL SELECT statementq
-- Rows per page (default varies)limit
-- Zero-based index of first row (must be a multiple ofoffset
)limit
Examples:
Tool: NETSUITE_RUN_SUITEQL_QUERY Arguments: q: "SELECT id, companyname, email FROM customer WHERE isinactive = 'F' ORDER BY companyname" limit: 100 offset: 0
Tool: NETSUITE_RUN_SUITEQL_QUERY Arguments: q: "SELECT id, entitystatus, total FROM transaction WHERE type = 'SalesOrd' AND trandate >= '2026-01-01'" limit: 50
3. Create and Manage Customers
Create new customer records with subsidiary assignment and contact details.
Tools:
-- Create a new customerNETSUITE_CREATE_CUSTOMER
-- Retrieve customer by internal IDNETSUITE_GET_CUSTOMER
-- Update existing customer (PATCH semantics)NETSUITE_UPDATE_CUSTOMER
Key Parameters for
:NETSUITE_CREATE_CUSTOMER
(required) -- JSON object with customer data. Required fields:body
-- Object withsubsidiary
(subsidiary internal ID)id- Either
(for businesses) orcompanyName
+firstName
(for individuals)lastName - Optional:
,email
,phone
(set toisPerson
for individuals),"T"comments
-- Comma-separated sublist names to fully replace (e.g.,replace
)"contacts,addressbook"
Example:
Tool: NETSUITE_CREATE_CUSTOMER Arguments: body: { "companyName": "Acme Corp", "subsidiary": {"id": "1"}, "email": "info@acme.com", "phone": "555-0100" }
4. Upsert Records by External ID
Create or update records idempotently using an external identifier. Essential for sync workflows.
Tool:
NETSUITE_UPSERT_RECORD_BY_EXTERNAL_ID
Key Parameters:
(required) -- Record type name, e.g.,record_type
,"customer"
,"salesorder""customrecord_myrec"
(required) -- External ID value (letters, numbers, underscore, hyphen only)external_id
(required) -- JSON object matching the record schema; include mandatory fields when creatingbody
Example:
Tool: NETSUITE_UPSERT_RECORD_BY_EXTERNAL_ID Arguments: record_type: "customer" external_id: "CRM-CUST-42" body: { "companyName": "Acme Corp", "subsidiary": {"id": "1"}, "email": "updated@acme.com" }
Warning: Idempotency depends on consistent external ID usage. Mismatches silently create additional records instead of updating.
5. Inspect Record Metadata
Discover available fields, data types, constraints, and requirements before creating or updating records.
Tool:
NETSUITE_GET_RECORD_METADATA
Key Parameters:
(required) -- e.g.,record_type
,"customer"
,"salesorder"
,"invoice"
,"vendor"
,"employee""item"
--accept
(default, JSON Schema) or"application/schema+json"
(OpenAPI 3.0)"application/swagger+json"
Example:
Tool: NETSUITE_GET_RECORD_METADATA Arguments: record_type: "salesorder"
6. List and Filter Records
Retrieve multiple records with optional filtering and pagination.
Tool:
NETSUITE_LIST_RECORDS
Key Parameters:
(required) -- e.g.,recordType
,"customer""salesorder"
-- Filter expression using N/query operators, e.g.,q"email START_WITH \"barbara\""
-- Max records per page (1--1000, default 1000)limit
-- Zero-based index (must be divisible by limit)offset
Supporting Tools:
-- Alternative filtering (secondary to SuiteQL)NETSUITE_FILTER_RECORD_COLLECTION
-- Retrieve specific fields only (reduced payload)NETSUITE_GET_RECORD_SELECTED_FIELDS
Recommended Execution Plan
- Inspect the record schema using
to discover required fieldsNETSUITE_GET_RECORD_METADATA - Search for existing records using
to avoid duplicatesNETSUITE_RUN_SUITEQL_QUERY - Look up customer by email using SuiteQL; fetch details with
if foundNETSUITE_GET_CUSTOMER - Create customer if needed using
(ensureNETSUITE_CREATE_CUSTOMER
is set)subsidiary - Validate item internal IDs using
or SuiteQLNETSUITE_LIST_RECORDS - Create the sales order using
with validated referencesNETSUITE_CREATE_SALES_ORDER - Optionally upsert by external ID using
for sync workflowsNETSUITE_UPSERT_RECORD_BY_EXTERNAL_ID - Verify results using
to confirm pricing/totalsNETSUITE_GET_RECORD_SELECTED_FIELDS
已知陷阱
| Pitfall | Detail |
|---|---|
| Invalid item IDs | throws USER_ERROR when item internal ID is invalid. Pre-validate via or . |
| Missing required fields | returns 400 when required fields (e.g., ) are missing. Always inspect with first. |
| SuiteQL field names | Query differences by account can cause empty results. Confirm field names via when results look wrong. |
| Filter expression limits | may fail if filter syntax is unsupported. Treat as secondary to SuiteQL. |
| External ID idempotency | depends on consistent external IDs. Mismatches silently create duplicates instead of updating. |
| SuiteTax line items | Accounts with SuiteTax enabled require on every line item. Omitting it causes creation failures. |
快速参考
| Tool Slug | Description |
|---|---|
| Create a new sales order with line items |
| Execute ad-hoc SuiteQL queries with paging |
| Create a new customer record |
| Retrieve a customer by internal ID |
| Update an existing customer (PATCH) |
| Create or update a record by external ID |
| Inspect record schema and field definitions |
| List records with filtering and pagination |
| Alternative record filtering |
| Retrieve specific fields from a record |
由 Composio 提供支持