KosmoKrator

sales

Square CLI for AI Agents

Use the Square CLI from KosmoKrator to call Square tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 7 read 0 write Bearer token auth

Square CLI Setup

Square can be configured headlessly with `kosmokrator integrations:configure square`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure square --set access_token="$SQUARE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor square --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token SQUARE_ACCESS_TOKEN Secret secret yes Access Token

Call Square Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call square.square_get_current_user '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:square square_get_current_user '{}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs square --json
kosmo integrations:docs square.square_get_current_user --json
kosmo integrations:schema square.square_get_current_user --json
kosmo integrations:search "Square" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Square.

square.square_get_current_user

Read read

Get the current authenticated Square merchant account. Returns merchant details including business name, country, currency, and status.

Parameters
none

Generic CLI call

kosmo integrations:call square.square_get_current_user '{}' --json

Provider shortcut

kosmo integrations:square square_get_current_user '{}' --json

square.square_get_customer

Read read

Retrieve a Square customer by ID. Returns full customer details including email, phone, address, and cards on file.

Parameters
id

Generic CLI call

kosmo integrations:call square.square_get_customer '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:square square_get_customer '{"id":"example_id"}' --json

square.square_get_order

Read read

Retrieve a Square order by ID. Returns full order details including line items, totals, taxes, and discounts.

Parameters
id

Generic CLI call

kosmo integrations:call square.square_get_order '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:square square_get_order '{"id":"example_id"}' --json

square.square_get_payment

Read read

Retrieve a Square payment by ID. Returns full payment details including amount, status, card details, and processing fees.

Parameters
id

Generic CLI call

kosmo integrations:call square.square_get_payment '{"id":"example_id"}' --json

Provider shortcut

kosmo integrations:square square_get_payment '{"id":"example_id"}' --json

square.square_list_customers

Read read

List Square customers with optional filtering. Supports pagination with cursor.

Parameters
limit, cursor, sort_field, sort_order

Generic CLI call

kosmo integrations:call square.square_list_customers '{"limit":1,"cursor":"example_cursor","sort_field":"example_sort_field","sort_order":"example_sort_order"}' --json

Provider shortcut

kosmo integrations:square square_list_customers '{"limit":1,"cursor":"example_cursor","sort_field":"example_sort_field","sort_order":"example_sort_order"}' --json

square.square_list_orders

Read read

List Square orders for a specific location. Requires a location_id. Supports filtering by order states and pagination with cursor.

Parameters
location_id, limit, cursor, states

Generic CLI call

kosmo integrations:call square.square_list_orders '{"location_id":"example_location_id","limit":1,"cursor":"example_cursor","states":"example_states"}' --json

Provider shortcut

kosmo integrations:square square_list_orders '{"location_id":"example_location_id","limit":1,"cursor":"example_cursor","states":"example_states"}' --json

square.square_list_payments

Read read

List Square payments with optional filtering. Supports filtering by location ID, begin_time / end_time (ISO 8601), and pagination with cursor.

Parameters
location_id, begin_time, end_time, limit, cursor

Generic CLI call

kosmo integrations:call square.square_list_payments '{"location_id":"example_location_id","begin_time":"example_begin_time","end_time":"example_end_time","limit":1,"cursor":"example_cursor"}' --json

Provider shortcut

kosmo integrations:square square_list_payments '{"location_id":"example_location_id","begin_time":"example_begin_time","end_time":"example_end_time","limit":1,"cursor":"example_cursor"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

square.square_get_current_user

Get the current authenticated Square merchant account. Returns merchant details including business name, country, currency, and status.

Operation
Read read
Schema command
kosmo integrations:schema square.square_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

square.square_get_customer

Retrieve a Square customer by ID. Returns full customer details including email, phone, address, and cards on file.

Operation
Read read
Schema command
kosmo integrations:schema square.square_get_customer --json
ParameterTypeRequiredDescription
id string yes Square customer ID.

square.square_get_order

Retrieve a Square order by ID. Returns full order details including line items, totals, taxes, and discounts.

Operation
Read read
Schema command
kosmo integrations:schema square.square_get_order --json
ParameterTypeRequiredDescription
id string yes Square order ID.

square.square_get_payment

Retrieve a Square payment by ID. Returns full payment details including amount, status, card details, and processing fees.

Operation
Read read
Schema command
kosmo integrations:schema square.square_get_payment --json
ParameterTypeRequiredDescription
id string yes Square payment ID.

square.square_list_customers

List Square customers with optional filtering. Supports pagination with cursor.

Operation
Read read
Schema command
kosmo integrations:schema square.square_list_customers --json
ParameterTypeRequiredDescription
limit integer no Number of customers to return (1–100, default 20).
cursor string no Cursor for pagination — returned from a previous request.
sort_field string no Sort field (DEFAULT, CREATED_AT, FAMILY_NAME, GIVEN_NAME).
sort_order string no Sort order (ASC, DESC).

square.square_list_orders

List Square orders for a specific location. Requires a location_id. Supports filtering by order states and pagination with cursor.

Operation
Read read
Schema command
kosmo integrations:schema square.square_list_orders --json
ParameterTypeRequiredDescription
location_id string yes Square location ID.
limit integer no Number of orders to return (1–100, default 20).
cursor string no Cursor for pagination — returned from a previous request.
states array no Filter by order states (OPEN, COMPLETED, CANCELED). Pass as a comma-separated string.

square.square_list_payments

List Square payments with optional filtering. Supports filtering by location ID, begin_time / end_time (ISO 8601), and pagination with cursor.

Operation
Read read
Schema command
kosmo integrations:schema square.square_list_payments --json
ParameterTypeRequiredDescription
location_id string no Filter by location ID.
begin_time string no Start of time range (ISO 8601, e.g., "2024-01-01T00:00:00Z").
end_time string no End of time range (ISO 8601).
limit integer no Number of payments to return (1–100, default 20).
cursor string no Cursor for pagination — returned from a previous request.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.