KosmoKrator

productivity

ShipStation Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the ShipStation KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.shipstation.*. Use lua_read_doc("integrations.shipstation") inside KosmoKrator to discover the same reference at runtime.

Call Lua from the Headless CLI

Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic ShipStation workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.shipstation.list_batches({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("shipstation"))' --json
kosmo integrations:lua --eval 'print(docs.read("shipstation.list_batches"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local shipstation = app.integrations.shipstation
local result = shipstation.list_batches({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.shipstation, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.shipstation.default.* or app.integrations.shipstation.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need ShipStation, use the narrower mcp:lua command.

MCP Lua command
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

ShipStation

Namespace: shipstation

Use ShipStation tools for the ShipStation API V2 surface: batches, carriers, downloads, fulfillments, inventory, labels, mailing, manifests, pickups, package types, products, purchase orders, rates, shipments, suppliers, tags, totes, tracking, warehouses, users, and webhooks.

ShipStation V2 authenticates with the API-Key header. The default API root is https://api.shipstation.com; tools include the /v2 path prefix.

JSON responses are returned as { status = 200, data = { ... } }. Empty successful responses return { status = 204, success = true }.

Use shipstation_api_get, shipstation_api_post, shipstation_api_put, shipstation_api_patch, and shipstation_api_delete for supported V2 paths not represented by a named tool. Raw paths must be relative, for example /v2/shipments; absolute URLs are rejected.

Raw agent markdown
# ShipStation

Namespace: `shipstation`

Use ShipStation tools for the ShipStation API V2 surface: batches, carriers, downloads, fulfillments, inventory, labels, mailing, manifests, pickups, package types, products, purchase orders, rates, shipments, suppliers, tags, totes, tracking, warehouses, users, and webhooks.

ShipStation V2 authenticates with the `API-Key` header. The default API root is `https://api.shipstation.com`; tools include the `/v2` path prefix.

JSON responses are returned as `{ status = 200, data = { ... } }`. Empty successful responses return `{ status = 204, success = true }`.

Use `shipstation_api_get`, `shipstation_api_post`, `shipstation_api_put`, `shipstation_api_patch`, and `shipstation_api_delete` for supported V2 paths not represented by a named tool. Raw paths must be relative, for example `/v2/shipments`; absolute URLs are rejected.
Metadata-derived Lua example
local result = app.integrations.shipstation.list_batches({})
print(result)

Functions

list_batches Read

List ShipStation batches.

Lua path
app.integrations.shipstation.list_batches
Full name
shipstation.shipstation_batches_list
ParameterTypeRequiredDescription
No parameters.
create_batch Write

Create a batch for bulk label processing.

Lua path
app.integrations.shipstation.create_batch
Full name
shipstation.shipstation_batches_create
ParameterTypeRequiredDescription
No parameters.
get_batch_by_external_id Read

Retrieve a batch by external batch ID.

Lua path
app.integrations.shipstation.get_batch_by_external_id
Full name
shipstation.shipstation_batches_get_external
ParameterTypeRequiredDescription
No parameters.
delete_batch Write

Delete a batch.

Lua path
app.integrations.shipstation.delete_batch
Full name
shipstation.shipstation_batches_delete
ParameterTypeRequiredDescription
No parameters.
get_batch Read

Retrieve a batch.

Lua path
app.integrations.shipstation.get_batch
Full name
shipstation.shipstation_batches_get
ParameterTypeRequiredDescription
No parameters.
update_batch Write

Update a batch.

Lua path
app.integrations.shipstation.update_batch
Full name
shipstation.shipstation_batches_update
ParameterTypeRequiredDescription
No parameters.
add_batch_shipments Write

Add shipments to a batch.

Lua path
app.integrations.shipstation.add_batch_shipments
Full name
shipstation.shipstation_batches_add
ParameterTypeRequiredDescription
No parameters.
list_batch_errors Read

List batch processing errors.

Lua path
app.integrations.shipstation.list_batch_errors
Full name
shipstation.shipstation_batches_errors
ParameterTypeRequiredDescription
No parameters.
remove_batch_shipments Write

Remove shipments from a batch.

Lua path
app.integrations.shipstation.remove_batch_shipments
Full name
shipstation.shipstation_batches_remove
ParameterTypeRequiredDescription
No parameters.
process_batch_labels Write

Process labels for a batch.

Lua path
app.integrations.shipstation.process_batch_labels
Full name
shipstation.shipstation_batches_process
ParameterTypeRequiredDescription
No parameters.
list_carriers Read

List connected carrier accounts.

Lua path
app.integrations.shipstation.list_carriers
Full name
shipstation.shipstation_carriers_list
ParameterTypeRequiredDescription
No parameters.
get_carrier Read

Retrieve a carrier.

Lua path
app.integrations.shipstation.get_carrier
Full name
shipstation.shipstation_carriers_get
ParameterTypeRequiredDescription
No parameters.
list_carrier_options Read

List carrier advanced options.

Lua path
app.integrations.shipstation.list_carrier_options
Full name
shipstation.shipstation_carriers_options
ParameterTypeRequiredDescription
No parameters.
list_carrier_packages Read

List package types for a carrier.

Lua path
app.integrations.shipstation.list_carrier_packages
Full name
shipstation.shipstation_carriers_packages
ParameterTypeRequiredDescription
No parameters.
list_carrier_services Read

List services for a carrier.

Lua path
app.integrations.shipstation.list_carrier_services
Full name
shipstation.shipstation_carriers_services
ParameterTypeRequiredDescription
No parameters.
download_file Read

Download a label or document file.

Lua path
app.integrations.shipstation.download_file
Full name
shipstation.shipstation_downloads_get
ParameterTypeRequiredDescription
No parameters.
list_fulfillments Read

List fulfillments.

Lua path
app.integrations.shipstation.list_fulfillments
Full name
shipstation.shipstation_fulfillments_list
ParameterTypeRequiredDescription
No parameters.
create_fulfillment Write

Create a fulfillment to mark an order shipped.

Lua path
app.integrations.shipstation.create_fulfillment
Full name
shipstation.shipstation_fulfillments_create
ParameterTypeRequiredDescription
No parameters.
list_inventory Read

List inventory levels.

Lua path
app.integrations.shipstation.list_inventory
Full name
shipstation.shipstation_inventory_list
ParameterTypeRequiredDescription
No parameters.
adjust_inventory Write

Adjust inventory levels.

Lua path
app.integrations.shipstation.adjust_inventory
Full name
shipstation.shipstation_inventory_adjust
ParameterTypeRequiredDescription
No parameters.
list_inventory_warehouses Read

List inventory warehouses.

Lua path
app.integrations.shipstation.list_inventory_warehouses
Full name
shipstation.shipstation_inventory_warehouses_list
ParameterTypeRequiredDescription
No parameters.
create_inventory_warehouse Write

Create an inventory warehouse.

Lua path
app.integrations.shipstation.create_inventory_warehouse
Full name
shipstation.shipstation_inventory_warehouses_create
ParameterTypeRequiredDescription
No parameters.
get_inventory_warehouse Read

Retrieve an inventory warehouse.

Lua path
app.integrations.shipstation.get_inventory_warehouse
Full name
shipstation.shipstation_inventory_warehouses_get
ParameterTypeRequiredDescription
No parameters.
update_inventory_warehouse Write

Update an inventory warehouse.

Lua path
app.integrations.shipstation.update_inventory_warehouse
Full name
shipstation.shipstation_inventory_warehouses_update
ParameterTypeRequiredDescription
No parameters.
delete_inventory_warehouse Write

Delete an inventory warehouse.

Lua path
app.integrations.shipstation.delete_inventory_warehouse
Full name
shipstation.shipstation_inventory_warehouses_delete
ParameterTypeRequiredDescription
No parameters.
list_inventory_locations Read

List inventory locations.

Lua path
app.integrations.shipstation.list_inventory_locations
Full name
shipstation.shipstation_inventory_locations_list
ParameterTypeRequiredDescription
No parameters.
create_inventory_location Write

Create an inventory location.

Lua path
app.integrations.shipstation.create_inventory_location
Full name
shipstation.shipstation_inventory_locations_create
ParameterTypeRequiredDescription
No parameters.
get_inventory_location Read

Retrieve an inventory location.

Lua path
app.integrations.shipstation.get_inventory_location
Full name
shipstation.shipstation_inventory_locations_get
ParameterTypeRequiredDescription
No parameters.
update_inventory_location Write

Update an inventory location.

Lua path
app.integrations.shipstation.update_inventory_location
Full name
shipstation.shipstation_inventory_locations_update
ParameterTypeRequiredDescription
No parameters.
delete_inventory_location Write

Delete an inventory location.

Lua path
app.integrations.shipstation.delete_inventory_location
Full name
shipstation.shipstation_inventory_locations_delete
ParameterTypeRequiredDescription
No parameters.
list_labels Read

List labels.

Lua path
app.integrations.shipstation.list_labels
Full name
shipstation.shipstation_labels_list
ParameterTypeRequiredDescription
No parameters.
create_label Write

Create and purchase a label.

Lua path
app.integrations.shipstation.create_label
Full name
shipstation.shipstation_labels_create
ParameterTypeRequiredDescription
No parameters.
create_label_from_rate Write

Purchase a label from a rate.

Lua path
app.integrations.shipstation.create_label_from_rate
Full name
shipstation.shipstation_labels_create_from_rate
ParameterTypeRequiredDescription
No parameters.
create_label_from_shipment Write

Purchase a label from a shipment.

Lua path
app.integrations.shipstation.create_label_from_shipment
Full name
shipstation.shipstation_labels_create_from_shipment
ParameterTypeRequiredDescription
No parameters.
create_label_from_rate_shopper Write

Purchase a label from a rate shopper ID.

Lua path
app.integrations.shipstation.create_label_from_rate_shopper
Full name
shipstation.shipstation_labels_create_from_rate_shopper
ParameterTypeRequiredDescription
No parameters.
get_label Read

Retrieve a label.

Lua path
app.integrations.shipstation.get_label
Full name
shipstation.shipstation_labels_get
ParameterTypeRequiredDescription
No parameters.
get_label_by_external_shipment_id Read

Retrieve a label by external shipment ID.

Lua path
app.integrations.shipstation.get_label_by_external_shipment_id
Full name
shipstation.shipstation_labels_get_external
ParameterTypeRequiredDescription
No parameters.
create_return_label Write

Create a return label.

Lua path
app.integrations.shipstation.create_return_label
Full name
shipstation.shipstation_labels_return
ParameterTypeRequiredDescription
No parameters.
track_label Read

Track a label.

Lua path
app.integrations.shipstation.track_label
Full name
shipstation.shipstation_labels_track
ParameterTypeRequiredDescription
No parameters.
void_label Write

Void a label.

Lua path
app.integrations.shipstation.void_label
Full name
shipstation.shipstation_labels_void
ParameterTypeRequiredDescription
No parameters.
create_netstamps Write

Create USPS NetStamps.

Lua path
app.integrations.shipstation.create_netstamps
Full name
shipstation.shipstation_mailing_netstamps
ParameterTypeRequiredDescription
No parameters.
create_mail_labels Write

Create USPS mail labels.

Lua path
app.integrations.shipstation.create_mail_labels
Full name
shipstation.shipstation_mailing_mail_labels
ParameterTypeRequiredDescription
No parameters.
create_envelopes Write

Create USPS envelopes.

Lua path
app.integrations.shipstation.create_envelopes
Full name
shipstation.shipstation_mailing_envelopes
ParameterTypeRequiredDescription
No parameters.
list_manifests Read

List manifests.

Lua path
app.integrations.shipstation.list_manifests
Full name
shipstation.shipstation_manifests_list
ParameterTypeRequiredDescription
No parameters.
create_manifest Write

Create a manifest.

Lua path
app.integrations.shipstation.create_manifest
Full name
shipstation.shipstation_manifests_create
ParameterTypeRequiredDescription
No parameters.
get_manifest Read

Retrieve a manifest.

Lua path
app.integrations.shipstation.get_manifest
Full name
shipstation.shipstation_manifests_get
ParameterTypeRequiredDescription
No parameters.
list_pickups Read

List package pickups.

Lua path
app.integrations.shipstation.list_pickups
Full name
shipstation.shipstation_pickups_list
ParameterTypeRequiredDescription
No parameters.
create_pickup Write

Create a package pickup.

Lua path
app.integrations.shipstation.create_pickup
Full name
shipstation.shipstation_pickups_create
ParameterTypeRequiredDescription
No parameters.
get_pickup Read

Retrieve a package pickup.

Lua path
app.integrations.shipstation.get_pickup
Full name
shipstation.shipstation_pickups_get
ParameterTypeRequiredDescription
No parameters.
delete_pickup Write

Delete or cancel a package pickup.

Lua path
app.integrations.shipstation.delete_pickup
Full name
shipstation.shipstation_pickups_delete
ParameterTypeRequiredDescription
No parameters.
list_package_types Read

List custom package types.

Lua path
app.integrations.shipstation.list_package_types
Full name
shipstation.shipstation_packages_list
ParameterTypeRequiredDescription
No parameters.
create_package_type Write

Create a custom package type.

Lua path
app.integrations.shipstation.create_package_type
Full name
shipstation.shipstation_packages_create
ParameterTypeRequiredDescription
No parameters.
get_package_type Read

Retrieve a package type.

Lua path
app.integrations.shipstation.get_package_type
Full name
shipstation.shipstation_packages_get
ParameterTypeRequiredDescription
No parameters.
update_package_type Write

Update a package type.

Lua path
app.integrations.shipstation.update_package_type
Full name
shipstation.shipstation_packages_update
ParameterTypeRequiredDescription
No parameters.
delete_package_type Write

Delete a package type.

Lua path
app.integrations.shipstation.delete_package_type
Full name
shipstation.shipstation_packages_delete
ParameterTypeRequiredDescription
No parameters.
list_products Read

List products.

Lua path
app.integrations.shipstation.list_products
Full name
shipstation.shipstation_products_list
ParameterTypeRequiredDescription
No parameters.
list_purchase_orders Read

List purchase orders.

Lua path
app.integrations.shipstation.list_purchase_orders
Full name
shipstation.shipstation_purchase_orders_list
ParameterTypeRequiredDescription
No parameters.
create_purchase_order Write

Create a purchase order.

Lua path
app.integrations.shipstation.create_purchase_order
Full name
shipstation.shipstation_purchase_orders_create
ParameterTypeRequiredDescription
No parameters.
get_purchase_order Read

Retrieve a purchase order.

Lua path
app.integrations.shipstation.get_purchase_order
Full name
shipstation.shipstation_purchase_orders_get
ParameterTypeRequiredDescription
No parameters.
update_purchase_order Write

Update a purchase order.

Lua path
app.integrations.shipstation.update_purchase_order
Full name
shipstation.shipstation_purchase_orders_update
ParameterTypeRequiredDescription
No parameters.
update_purchase_order_shipping Write

Update purchase order shipping details.

Lua path
app.integrations.shipstation.update_purchase_order_shipping
Full name
shipstation.shipstation_purchase_orders_shipping_details
ParameterTypeRequiredDescription
No parameters.
update_purchase_order_status Write

Update purchase order status.

Lua path
app.integrations.shipstation.update_purchase_order_status
Full name
shipstation.shipstation_purchase_orders_status
ParameterTypeRequiredDescription
No parameters.
receive_purchase_order Write

Receive purchase order items.

Lua path
app.integrations.shipstation.receive_purchase_order
Full name
shipstation.shipstation_purchase_orders_receives
ParameterTypeRequiredDescription
No parameters.
get_purchase_order_summary Read

Download purchase order summary document.

Lua path
app.integrations.shipstation.get_purchase_order_summary
Full name
shipstation.shipstation_purchase_orders_summary
ParameterTypeRequiredDescription
No parameters.
create_rates Write

Compare shipment rates.

Lua path
app.integrations.shipstation.create_rates
Full name
shipstation.shipstation_rates_create
ParameterTypeRequiredDescription
No parameters.
estimate_rates Write

Estimate rates without creating a shipment.

Lua path
app.integrations.shipstation.estimate_rates
Full name
shipstation.shipstation_rates_estimate
ParameterTypeRequiredDescription
No parameters.
get_rate Read

Retrieve a rate.

Lua path
app.integrations.shipstation.get_rate
Full name
shipstation.shipstation_rates_get
ParameterTypeRequiredDescription
No parameters.
list_shipments Read

List shipments.

Lua path
app.integrations.shipstation.list_shipments
Full name
shipstation.shipstation_shipments_list
ParameterTypeRequiredDescription
No parameters.
create_shipment Write

Create a shipment.

Lua path
app.integrations.shipstation.create_shipment
Full name
shipstation.shipstation_shipments_create
ParameterTypeRequiredDescription
No parameters.
create_user_shipment Write

Create a user shipment.

Lua path
app.integrations.shipstation.create_user_shipment
Full name
shipstation.shipstation_shipments_create_user
ParameterTypeRequiredDescription
No parameters.
get_shipment_by_external_id Read

Retrieve a shipment by external shipment ID.

Lua path
app.integrations.shipstation.get_shipment_by_external_id
Full name
shipstation.shipstation_shipments_get_external
ParameterTypeRequiredDescription
No parameters.
get_shipment Read

Retrieve a shipment.

Lua path
app.integrations.shipstation.get_shipment
Full name
shipstation.shipstation_shipments_get
ParameterTypeRequiredDescription
No parameters.
update_shipment Write

Update a shipment.

Lua path
app.integrations.shipstation.update_shipment
Full name
shipstation.shipstation_shipments_update
ParameterTypeRequiredDescription
No parameters.
cancel_shipment Write

Cancel a shipment.

Lua path
app.integrations.shipstation.cancel_shipment
Full name
shipstation.shipstation_shipments_cancel
ParameterTypeRequiredDescription
No parameters.
get_shipment_rates Read

Get rates for a shipment.

Lua path
app.integrations.shipstation.get_shipment_rates
Full name
shipstation.shipstation_shipments_rates
ParameterTypeRequiredDescription
No parameters.
add_shipment_tag Write

Add a tag to a shipment.

Lua path
app.integrations.shipstation.add_shipment_tag
Full name
shipstation.shipstation_shipments_add_tag
ParameterTypeRequiredDescription
No parameters.
remove_shipment_tag Write

Remove a tag from a shipment.

Lua path
app.integrations.shipstation.remove_shipment_tag
Full name
shipstation.shipstation_shipments_remove_tag
ParameterTypeRequiredDescription
No parameters.
list_suppliers Read

List suppliers.

Lua path
app.integrations.shipstation.list_suppliers
Full name
shipstation.shipstation_suppliers_list
ParameterTypeRequiredDescription
No parameters.
create_supplier Write

Create a supplier.

Lua path
app.integrations.shipstation.create_supplier
Full name
shipstation.shipstation_suppliers_create
ParameterTypeRequiredDescription
No parameters.
get_supplier Read

Retrieve a supplier.

Lua path
app.integrations.shipstation.get_supplier
Full name
shipstation.shipstation_suppliers_get
ParameterTypeRequiredDescription
No parameters.
update_supplier Write

Update a supplier.

Lua path
app.integrations.shipstation.update_supplier
Full name
shipstation.shipstation_suppliers_update
ParameterTypeRequiredDescription
No parameters.
list_tags Read

List shipment tags.

Lua path
app.integrations.shipstation.list_tags
Full name
shipstation.shipstation_tags_list
ParameterTypeRequiredDescription
No parameters.
create_tag Write

Create a tag.

Lua path
app.integrations.shipstation.create_tag
Full name
shipstation.shipstation_tags_create
ParameterTypeRequiredDescription
No parameters.
list_totes Read

List totes.

Lua path
app.integrations.shipstation.list_totes
Full name
shipstation.shipstation_totes_list
ParameterTypeRequiredDescription
No parameters.
create_tote Write

Create a tote.

Lua path
app.integrations.shipstation.create_tote
Full name
shipstation.shipstation_totes_create
ParameterTypeRequiredDescription
No parameters.
list_tote_quantities Read

List tote quantities.

Lua path
app.integrations.shipstation.list_tote_quantities
Full name
shipstation.shipstation_totes_quantities
ParameterTypeRequiredDescription
No parameters.
get_tote Read

Retrieve a tote.

Lua path
app.integrations.shipstation.get_tote
Full name
shipstation.shipstation_totes_get
ParameterTypeRequiredDescription
No parameters.
update_tote Write

Update a tote.

Lua path
app.integrations.shipstation.update_tote
Full name
shipstation.shipstation_totes_update
ParameterTypeRequiredDescription
No parameters.
delete_tote Write

Delete a tote.

Lua path
app.integrations.shipstation.delete_tote
Full name
shipstation.shipstation_totes_delete
ParameterTypeRequiredDescription
No parameters.
stop_tracking Write

Stop receiving tracking updates.

Lua path
app.integrations.shipstation.stop_tracking
Full name
shipstation.shipstation_tracking_stop
ParameterTypeRequiredDescription
No parameters.
list_warehouses Read

List warehouses.

Lua path
app.integrations.shipstation.list_warehouses
Full name
shipstation.shipstation_warehouses_list
ParameterTypeRequiredDescription
No parameters.
get_warehouse Read

Retrieve a warehouse.

Lua path
app.integrations.shipstation.get_warehouse
Full name
shipstation.shipstation_warehouses_get
ParameterTypeRequiredDescription
No parameters.
list_users Read

List ShipStation account users.

Lua path
app.integrations.shipstation.list_users
Full name
shipstation.shipstation_users_list
ParameterTypeRequiredDescription
No parameters.
list_webhooks Read

List webhooks.

Lua path
app.integrations.shipstation.list_webhooks
Full name
shipstation.shipstation_webhooks_list
ParameterTypeRequiredDescription
No parameters.
create_webhook Write

Create a webhook.

Lua path
app.integrations.shipstation.create_webhook
Full name
shipstation.shipstation_webhooks_create
ParameterTypeRequiredDescription
No parameters.
get_webhook Read

Retrieve a webhook.

Lua path
app.integrations.shipstation.get_webhook
Full name
shipstation.shipstation_webhooks_get
ParameterTypeRequiredDescription
No parameters.
update_webhook Write

Update a webhook.

Lua path
app.integrations.shipstation.update_webhook
Full name
shipstation.shipstation_webhooks_update
ParameterTypeRequiredDescription
No parameters.
delete_webhook Write

Delete a webhook.

Lua path
app.integrations.shipstation.delete_webhook
Full name
shipstation.shipstation_webhooks_delete
ParameterTypeRequiredDescription
No parameters.
api_get Read

Call a safe relative ShipStation API GET path.

Lua path
app.integrations.shipstation.api_get
Full name
shipstation.shipstation_api_get
ParameterTypeRequiredDescription
No parameters.
api_post Write

Call a safe relative ShipStation API POST path.

Lua path
app.integrations.shipstation.api_post
Full name
shipstation.shipstation_api_post
ParameterTypeRequiredDescription
No parameters.
api_put Write

Call a safe relative ShipStation API PUT path.

Lua path
app.integrations.shipstation.api_put
Full name
shipstation.shipstation_api_put
ParameterTypeRequiredDescription
No parameters.
api_patch Write

Call a safe relative ShipStation API PATCH path.

Lua path
app.integrations.shipstation.api_patch
Full name
shipstation.shipstation_api_patch
ParameterTypeRequiredDescription
No parameters.
api_delete Write

Call a safe relative ShipStation API DELETE path.

Lua path
app.integrations.shipstation.api_delete
Full name
shipstation.shipstation_api_delete
ParameterTypeRequiredDescription
No parameters.