create_order
Create new orders in ShipStation by providing order data as JSON. This tool adds orders to your shipping platform for processing and fulfillment.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"orderData": "<orderData>"
},
"name": "create_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderData | Yes | JSON string containing the order data |
Implementation Reference
- src/tools/order-tools.js:60-73 (handler)The handler function that executes the create_order tool logic: parses JSON input and calls the ShipStation API to create an order, returning formatted result or error.
handler: async ({ orderData }) => { try { const parsedData = JSON.parse(orderData); const result = await shipStationClient.createOrder(parsedData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } } - src/tools/order-tools.js:57-59 (schema)Zod schema defining the input for the create_order tool: a JSON string for orderData.
schema: { orderData: z.string().describe("JSON string containing the order data") }, - src/server.js:174-191 (registration)Registration of all tools including create_order by spreading orderTools and calling server.tool() in a loop on the MCP server instance.
[ ...orderTools, ...shipmentTools, ...carrierTools, ...warehouseTools, ...productTools, ...customerTools, ...storeTools, ...webhookTools, ...fulfillmentTools ].forEach(tool => { server.tool( tool.name, tool.schema, tool.handler, { description: tool.description } ); }); - src/tools/order-tools.js:54-74 (registration)Tool definition object for create_order including name, description, schema, and handler, exported as part of orderTools array.
{ name: "create_order", description: "Create a new order in ShipStation", schema: { orderData: z.string().describe("JSON string containing the order data") }, handler: async ({ orderData }) => { try { const parsedData = JSON.parse(orderData); const result = await shipStationClient.createOrder(parsedData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: error.message }], isError: true }; } } }, - src/api-client.js:56-57 (helper)Underlying API client method createOrder called by the tool handler to make the POST request to ShipStation's /orders/createorder endpoint.
async createOrder(orderData) { return this.request('POST', '/orders/createorder', orderData);