KosmoKrator

ecommerce

ShipBob Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write Bearer token auth

Lua Namespace

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

Agent-Facing Lua Docs

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

ShipBob — Lua API Reference

list_orders

List fulfillment orders with pagination and optional status filtering.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
limitintegernoResults per page (default: 25, max: 100)
statusstringnoFilter by status: pending, processing, fulfilled, cancelled

Examples

-- List pending orders
local result = app.integrations.shipbob.list_orders({
  status = "pending",
  limit = 10
})

for _, order in ipairs(result) do
  print("Order #" .. order.id .. " - " .. order.status)
end

-- Paginate through all orders
local page2 = app.integrations.shipbob.list_orders({
  page = 2,
  limit = 50
})

get_order

Get details for a specific order by ID.

Parameters

NameTypeRequiredDescription
idintegeryesThe ShipBob order ID

Example

local order = app.integrations.shipbob.get_order({ id = 12345 })
print("Order #" .. order.id)
print("Status: " .. order.status)
print("Tracking: " .. (order.tracking_number or "N/A"))

create_order

Create a new fulfillment order.

Parameters

NameTypeRequiredDescription
receiving_notestringyesNote for the fulfillment center
productsarrayyesList of product line items (each with id and quantity)
shipping_methodstringnoShipping method: ground, expedited, overnight, etc.

Example

local order = app.integrations.shipbob.create_order({
  receiving_note = "Priority shipment — handle with care",
  products = {
    { id = 101, quantity = 2 },
    { id = 205, quantity = 1 }
  },
  shipping_method = "expedited"
})

print("Created order #" .. order.id)

list_products

List products in your ShipBob inventory.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
limitintegernoResults per page (default: 25, max: 100)

Example

local result = app.integrations.shipbob.list_products({
  page = 1,
  limit = 50
})

for _, product in ipairs(result) do
  print(product.name .. " (SKU: " .. product.sku .. ") — " .. product.quantity .. " in stock")
end

get_product

Get details for a specific product by ID.

Parameters

NameTypeRequiredDescription
idintegeryesThe ShipBob product ID

Example

local product = app.integrations.shipbob.get_product({ id = 678 })
print(product.name .. " — " .. product.quantity .. " units available")

list_shipments

List shipments with pagination.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (default: 1)
limitintegernoResults per page (default: 25, max: 100)

Example

local result = app.integrations.shipbob.list_shipments({
  page = 1,
  limit = 25
})

for _, shipment in ipairs(result) do
  print("Shipment #" .. shipment.id .. " — " .. shipment.status .. " (" .. shipment.carrier .. ")")
end

get_current_user

Get the currently authenticated user profile.

Parameters

None.

Example

local user = app.integrations.shipbob.get_current_user({})
print("Logged in as: " .. user.email)

Multi-Account Usage

If you have multiple ShipBob accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.shipbob.list_orders({})

-- Explicit default (portable across setups)
app.integrations.shipbob.default.list_orders({})

-- Named accounts
app.integrations.shipbob.production.list_orders({})
app.integrations.shipbob.staging.list_orders({})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# ShipBob — Lua API Reference

## list_orders

List fulfillment orders with pagination and optional status filtering.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `limit` | integer | no | Results per page (default: 25, max: 100) |
| `status` | string | no | Filter by status: `pending`, `processing`, `fulfilled`, `cancelled` |

### Examples

```lua
-- List pending orders
local result = app.integrations.shipbob.list_orders({
  status = "pending",
  limit = 10
})

for _, order in ipairs(result) do
  print("Order #" .. order.id .. " - " .. order.status)
end

-- Paginate through all orders
local page2 = app.integrations.shipbob.list_orders({
  page = 2,
  limit = 50
})
```

---

## get_order

Get details for a specific order by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The ShipBob order ID |

### Example

```lua
local order = app.integrations.shipbob.get_order({ id = 12345 })
print("Order #" .. order.id)
print("Status: " .. order.status)
print("Tracking: " .. (order.tracking_number or "N/A"))
```

---

## create_order

Create a new fulfillment order.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `receiving_note` | string | yes | Note for the fulfillment center |
| `products` | array | yes | List of product line items (each with `id` and `quantity`) |
| `shipping_method` | string | no | Shipping method: `ground`, `expedited`, `overnight`, etc. |

### Example

```lua
local order = app.integrations.shipbob.create_order({
  receiving_note = "Priority shipment — handle with care",
  products = {
    { id = 101, quantity = 2 },
    { id = 205, quantity = 1 }
  },
  shipping_method = "expedited"
})

print("Created order #" .. order.id)
```

---

## list_products

List products in your ShipBob inventory.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `limit` | integer | no | Results per page (default: 25, max: 100) |

### Example

```lua
local result = app.integrations.shipbob.list_products({
  page = 1,
  limit = 50
})

for _, product in ipairs(result) do
  print(product.name .. " (SKU: " .. product.sku .. ") — " .. product.quantity .. " in stock")
end
```

---

## get_product

Get details for a specific product by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The ShipBob product ID |

### Example

```lua
local product = app.integrations.shipbob.get_product({ id = 678 })
print(product.name .. " — " .. product.quantity .. " units available")
```

---

## list_shipments

List shipments with pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (default: 1) |
| `limit` | integer | no | Results per page (default: 25, max: 100) |

### Example

```lua
local result = app.integrations.shipbob.list_shipments({
  page = 1,
  limit = 25
})

for _, shipment in ipairs(result) do
  print("Shipment #" .. shipment.id .. " — " .. shipment.status .. " (" .. shipment.carrier .. ")")
end
```

---

## get_current_user

Get the currently authenticated user profile.

### Parameters

None.

### Example

```lua
local user = app.integrations.shipbob.get_current_user({})
print("Logged in as: " .. user.email)
```

---

## Multi-Account Usage

If you have multiple ShipBob accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.shipbob.list_orders({})

-- Explicit default (portable across setups)
app.integrations.shipbob.default.list_orders({})

-- Named accounts
app.integrations.shipbob.production.list_orders({})
app.integrations.shipbob.staging.list_orders({})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.shipbob.shipbob_list_orders({
  page = 1,
  limit = 1,
  status = "example_status"
})
print(result)

Functions

shipbob_list_orders

List fulfillment orders from ShipBob. Supports pagination and filtering by status (e.g. pending, fulfilled, cancelled).

Operation
Read read
Full name
shipbob.shipbob_list_orders
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of orders per page (default: 25, max: 100).
status string no Filter by order status. Common values: pending, processing, fulfilled, cancelled.

shipbob_get_order

Get details for a specific ShipBob order by ID, including line items, shipping address, and fulfillment status.

Operation
Read read
Full name
shipbob.shipbob_get_order
ParameterTypeRequiredDescription
id integer yes The ShipBob order ID.

shipbob_create_order

Create a new fulfillment order in ShipBob. Provide product line items, a receiving note, and an optional shipping method.

Operation
Write write
Full name
shipbob.shipbob_create_order
ParameterTypeRequiredDescription
receiving_note string yes A note for the fulfillment center (e.g. "Handle with care" or "Priority shipment").
products array yes List of product line items. Each item should include product reference/ID and quantity. Example: [{"id": 123, "quantity": 2}]
shipping_method string no Desired shipping method (e.g. "ground", "expedited", "overnight"). Optional — ShipBob selects the best method if omitted.

shipbob_list_products

List products in your ShipBob inventory. Supports pagination with page and limit parameters.

Operation
Read read
Full name
shipbob.shipbob_list_products
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of products per page (default: 25, max: 100).

shipbob_get_product

Get details for a specific ShipBob product by ID, including SKU, inventory levels, and fulfillment info.

Operation
Read read
Full name
shipbob.shipbob_get_product
ParameterTypeRequiredDescription
id integer yes The ShipBob product ID.

shipbob_list_shipments

List shipments from ShipBob. Supports pagination with page and limit parameters.

Operation
Read read
Full name
shipbob.shipbob_list_shipments
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
limit integer no Number of shipments per page (default: 25, max: 100).

shipbob_get_current_user

Get the currently authenticated ShipBob user profile. Useful for verifying connectivity and account details.

Operation
Read read
Full name
shipbob.shipbob_get_current_user
ParameterTypeRequiredDescription
No parameters.