> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Process Square payments and manage orders from Guild agents

> Connect Guild agents to Square to process payments, manage orders, handle disputes, track inventory, and run loyalty programs with governed credentials.

Integrations · Square

A Guild agent can process Square payments, manage orders, and handle disputes on your team's behalf. Guild stores the Square API key server-side so agent code never sees it, and credential policies let you restrict exactly which Square operations each agent can call.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Square.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Square to your first agent.

## What the Square integration exposes

The integration provides tools that cover payments, refunds, and Terminal checkouts; catalog objects and inventory; orders, invoices, subscriptions, and gift cards; customers, loyalty accounts, team members, shifts, and dispute evidence. Tools are named with the square\_ prefix. Use pick() to include only the tools your agent needs.

## How it works

**1. Open credentials and connect**

In Guild, go to Access & setup > Credentials, click Connect, and select square. Paste your Square-issued bearer token into the API Key field.

**2. Import tools in your agent**

Import SquareTools from the `guildai~square` package and spread it into your agent's tools object. Guild sends the key as a bearer token in the Authorization header on every call.

**3. Narrow tools with pick**

Use pick() to include only the specific square\_ tools your agent needs. See the tools reference at /sdk/tools for selecting specific tools.

## Why Square access needs governing

Square tools can create payments, issue refunds, cancel subscriptions, delete customer profiles, and accept or submit dispute evidence. Guild stores the credential server-side and injects it only after the credential proxy checks your policies, so agents never handle the key directly. You can write ALLOW and DENY rules on the credential to restrict which square\_ operations each agent or workspace may call, using wildcard patterns such as square\_list\_\* for read-only access or an explicit DENY on square\_create\_payment for agents that should never charge cards.

Credential scope controls go further: you can dedicate a credential to a single agent, restrict a workspace to its own credentials, or grant a member credential so the agent acts as one person rather than the whole organization. Audit records show every call the proxy handled. Without these controls, any agent with access to the credential could reach every operation the key permits.

## About the Square integration

Agents can process and manage payments, refunds, and Terminal checkouts through Square's REST API. They can handle catalog objects, inventory, orders, invoices, subscriptions, and gift cards. Agents can also manage customers, loyalty accounts, team members, shifts, and dispute evidence. The integration is `guildai~square`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as a bearer token in the `Authorization` header

### Setup

**1. Connect Square**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **square**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { SquareTools } from "@guildai-services/guildai~square"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with Square.",
  tools: { ...SquareTools },
})
```

### Selecting specific tools

Tools are named with the `square_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~square`:

> [accordion] All 200 tools
>
> | Tool | What it does |
> | - | - |
> | `square_accept_dispute` | Accepts the loss on a dispute. |
> | `square_accumulate_loyalty_points` | Adds points to a loyalty account. |
> | `square_add_group_to_customer` | Adds a group membership to a customer. |
> | `square_adjust_loyalty_points` | Adds points to or subtracts points from a buyer's account. |
> | `square_batch_change_inventory` | Applies adjustments and counts to the provided item quantities. |
> | `square_batch_delete_catalog_objects` | Deletes a set of CatalogItems based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. |
> | `square_batch_retrieve_catalog_objects` | Returns a set of objects based on the provided ID. |
> | `square_batch_retrieve_inventory_changes` | Returns historical physical counts and adjustments based on the provided filter criteria. |
> | `square_batch_retrieve_inventory_counts` | Returns current counts for the provided. |
> | `square_batch_retrieve_orders` | Retrieves a set of orders by their IDs. |
> | `square_batch_upsert_catalog_objects` | Creates or updates up to 10,000 target objects based on the provided list of objects. |
> | `square_bulk_create_team_members` | Creates multiple 'TeamMember' objects. |
> | `square_bulk_update_team_members` | Updates multiple 'TeamMember' objects. |
> | `square_calculate_loyalty_points` | Calculates the points a purchase earns. |
> | `square_calculate_order` | Enables applications to preview order pricing without creating an order. |
> | `square_cancel_booking` | Cancels an existing booking. |
> | `square_cancel_invoice` | Cancels an invoice. |
> | `square_cancel_payment` | Cancels (voids) a payment. |
> | `square_cancel_payment_by_idempotency_key` | Cancels (voids) a payment identified by the idempotency key that is specified in the request. |
> | `square_cancel_subscription` | Sets the 'canceled\_date' field to the end of the active billing period. |
> | `square_cancel_terminal_checkout` | Cancels a Terminal checkout request if the status of the request permits it. |
> | `square_cancel_terminal_refund` | Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. |
> | `square_capture_transaction` | Captures a transaction that was created with the Charge endpoint with a 'delay\_capture' value of 'true'. |
> | `square_catalog_info` | Retrieves information about the Square Catalog API, such as batch size limits that can be used by the 'BatchUpsertCatalogObjects' endpoint. |
> | `square_charge` | Charges a card represented by a card nonce or a customer's card on file. |
> | `square_complete_payment` | Completes (captures) a payment. |
> | `square_create_booking` | Creates a booking. |
> | `square_create_break_type` | Creates a new 'BreakType'. |
> | `square_create_card` | Adds a card on file to an existing merchant. |
> | `square_create_checkout` | Links a 'checkoutId' to a 'checkout\_page\_url' that customers are directed to in order to provide their payment information using a payment processing workflow hosted on connect.squareup.com. |
> | `square_create_customer` | Creates a new customer for a business. |
> | `square_create_customer_card` | Adds a card on file to an existing customer. |
> | `square_create_customer_group` | Creates a new customer group for a business. |
> | `square_create_device_code` | Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected terminal mode. |
> | `square_create_dispute_evidence_text` | Uploads text to use as evidence for a dispute challenge. |
> | `square_create_employee` | Use the CreateEmployee endpoint to add an employee to a Square account. |
> | `square_create_employee_role` | Creates an employee role you can then assign to employees. |
> | `square_create_gift_card` | Creates a digital gift card or registers a physical (plastic) gift card. |
> | `square_create_gift_card_activity` | Creates a gift card activity. |
> | `square_create_invoice` | Creates a draft invoice for an order created using the Orders API. |
> | `square_create_location` | Creates a location. |
> | `square_create_loyalty_account` | Creates a loyalty account. |
> | `square_create_loyalty_reward` | Creates a loyalty reward. |
> | `square_create_mobile_authorization_code` | Generates code to authorize a mobile application to connect to a Square card reader |
> | `square_create_order` | Creates a new order that can include information about products for purchase and settings to apply to the purchase. |
> | `square_create_payment` | Creates a payment using the provided source. |
> | `square_create_refund` | Issues a refund for a previously processed payment. |
> | `square_create_shift` | Creates a new 'Shift'. |
> | `square_create_subscription` | Creates a subscription for a customer to a subscription plan. |
> | `square_create_team_member` | Creates a single 'TeamMember' object. |
> | `square_create_terminal_checkout` | Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount. |
> | `square_create_terminal_refund` | Creates a request to refund an Interac payment completed on a Square Terminal. |
> | `square_delete_break_type` | Deletes an existing 'BreakType'. |
> | `square_delete_catalog_object` | Deletes a single CatalogObject based on the provided ID and returns the set of successfully deleted IDs in the response. |
> | `square_delete_customer` | Deletes a customer profile from a business. |
> | `square_delete_customer_card` | Removes a card on file from a customer. |
> | `square_delete_customer_group` | Deletes a customer group as identified by the 'group\_id' value. |
> | `square_delete_dispute_evidence` | Removes specified evidence from a dispute. |
> | `square_delete_invoice` | Deletes the specified invoice. |
> | `square_delete_loyalty_reward` | Deletes a loyalty reward by doing the following. |
> | `square_delete_shift` | Deletes a 'Shift'. |
> | `square_delete_snippet` | Removes your snippet from a Square Online site. |
> | `square_deprecated_batch_change_inventory` | Deprecated version of BatchChangeInventory after the endpoint URL is updated to conform to the standard convention. |
> | `square_deprecated_batch_retrieve_inventory_changes` | Deprecated version of BatchRetrieveInventoryChanges after the endpoint URL is updated to conform to the standard convention. |
> | `square_deprecated_batch_retrieve_inventory_counts` | Deprecated version of BatchRetrieveInventoryCounts after the endpoint URL is updated to conform to the standard convention. |
> | `square_deprecated_retrieve_inventory_adjustment` | Deprecated version of RetrieveInventoryAdjustment after the endpoint URL is updated to conform to the standard convention. |
> | `square_deprecated_retrieve_inventory_physical_count` | Deprecated version of RetrieveInventoryPhysicalCount after the endpoint URL is updated to conform to the standard convention. |
> | `square_disable_card` | Disables the card, preventing any further updates or charges. |
> | `square_get_bank_account` | Returns details of a BankAccount linked to a Square account. |
> | `square_get_bank_account_by_v1_id` | Returns details of a BankAccount identified by V1 bank account ID. |
> | `square_get_break_type` | Returns a single 'BreakType' specified by 'id'. |
> | `square_get_device_code` | Retrieves DeviceCode with the associated ID. |
> | `square_get_employee_wage` | Returns a single 'EmployeeWage' specified by 'id'. |
> | `square_get_invoice` | Retrieves an invoice by invoice ID. |
> | `square_get_payment` | Retrieves details for a specific payment. |
> | `square_get_payment_refund` | Retrieves a specific refund using the 'refund\_id'. |
> | `square_get_shift` | Returns a single 'Shift' specified by 'id'. |
> | `square_get_team_member_wage` | Returns a single 'TeamMemberWage' specified by 'id '. |
> | `square_get_terminal_checkout` | Retrieves a Terminal checkout request by 'checkout\_id'. |
> | `square_get_terminal_refund` | Retrieves an Interac Terminal refund object by ID. |
> | `square_get_v2_employees` | ListEmployees |
> | `square_get_v2_employees_by_id` | RetrieveEmployee |
> | `square_get_v2_locations_by_location_id_refunds` | Lists refunds for one of a business's locations. |
> | `square_get_v2_orders_by_order_id` | Retrieves an Order by ID. |
> | `square_get_v2_payments` | Retrieves a list of payments taken by the account making the request. |
> | `square_link_customer_to_gift_card` | Links a customer to a gift card |
> | `square_list_bank_accounts` | Returns a list of BankAccount objects linked to a Square account. |
> | `square_list_break_types` | Returns a paginated list of 'BreakType' instances for a business. |
> | `square_list_cards` | Retrieves a list of cards owned by the account making the request. |
> | `square_list_cash_drawer_shift_events` | Provides a paginated list of events for a single cash drawer shift. |
> | `square_list_cash_drawer_shifts` | Provides the details for all of the cash drawer shifts for a location in a date range. |
> | `square_list_catalog` | Returns a list of CatalogObjects that includes all objects of a set of desired types (for example, all CatalogItem and CatalogTax objects) in the catalog. |
> | `square_list_customer_groups` | Retrieves the list of customer groups of a business. |
> | `square_list_customers` | Lists customer profiles associated with a Square account. |
> | `square_list_customer_segments` | Retrieves the list of customer segments of a business. |
> | `square_list_device_codes` | Lists all DeviceCodes associated with the merchant. |
> | `square_list_dispute_evidence` | Returns a list of evidence associated with a dispute. |
> | `square_list_disputes` | Returns a list of disputes associated with a particular account. |
> | `square_list_employee_roles` | Provides summary information for all of a business's employee roles. |
> | `square_list_employees` | Provides summary information for all of a business's employees. |
> | `square_list_employee_wages` | Returns a paginated list of 'EmployeeWage' instances for a business. |
> | `square_list_gift_card_activities` | Lists gift card activities. |
> | `square_list_gift_cards` | Lists all gift cards. |
> | `square_list_invoices` | Returns a list of invoices for a given location. |
> | `square_list_locations` | Provides information of all locations of a business. |
> | `square_list_loyalty_programs` | Returns a list of loyalty programs in the seller's account. |
> | `square_list_merchants` | Returns 'Merchant' information for a given access token. |
> | `square_list_orders` | Provides summary information for a merchant's online store orders. |
> | `square_list_payment_refunds` | Retrieves a list of refunds for the account making the request. |
> | `square_list_payments` | Provides summary information for all payments taken for a given. |
> | `square_list_refunds` | Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. |
> | `square_list_settlements` | Provides summary information for all deposits and withdrawals initiated by Square to a linked bank account during a date range. |
> | `square_list_sites` | Lists the Square Online sites that belong to a seller. |
> | `square_list_subscription_events` | Lists all events for a specific subscription. |
> | `square_list_team_member_booking_profiles` | Lists booking profiles for team members. |
> | `square_list_team_member_wages` | Returns a paginated list of 'TeamMemberWage' instances for a business. |
> | `square_list_transactions` | Lists transactions for a particular location. |
> | `square_list_workweek_configs` | Returns a list of 'WorkweekConfig' instances for a business. |
> | `square_obtain_token` | Returns an OAuth access token. |
> | `square_pay_order` | Pay for an order using one or more approved payments or settle an order with a total of '0'. |
> | `square_post_v2_locations_by_location_id_transactions_by_transaction_id_refund` | Initiates a refund for a previously charged tender. |
> | `square_publish_invoice` | Publishes the specified draft invoice. |
> | `square_put_v2_orders_by_order_id` | Updates an open order by adding, replacing, or deleting fields. |
> | `square_redeem_loyalty_reward` | Redeems a loyalty reward. |
> | `square_refund_payment` | Refunds a payment. |
> | `square_register_domain` | Activates a domain for use with Apple Pay on the Web and Square. |
> | `square_remove_group_from_customer` | Removes a group membership from a customer. |
> | `square_renew_token` | 'RenewToken' is deprecated. |
> | `square_resume_subscription` | Resumes a deactivated subscription. |
> | `square_retrieve_booking` | Retrieves a booking. |
> | `square_retrieve_business_booking_profile` | Retrieves a seller's booking profile. |
> | `square_retrieve_card` | Retrieves details for a specific Card. |
> | `square_retrieve_cash_drawer_shift` | Provides the summary details for a single cash drawer shift. |
> | `square_retrieve_catalog_object` | Returns a single CatalogItem as a. |
> | `square_retrieve_customer` | Returns details for a single customer. |
> | `square_retrieve_customer_group` | Retrieves a specific customer group as identified by the 'group\_id' value. |
> | `square_retrieve_customer_segment` | Retrieves a specific customer segment as identified by the 'segment\_id' value. |
> | `square_retrieve_dispute` | Returns details about a specific dispute. |
> | `square_retrieve_dispute_evidence` | Returns the evidence metadata specified by the evidence ID in the request URL path |
> | `square_retrieve_employee` | Provides the details for a single employee. |
> | `square_retrieve_employee_role` | Provides the details for a single employee role. |
> | `square_retrieve_gift_card` | Retrieves a gift card using its ID. |
> | `square_retrieve_gift_card_from_gan` | Retrieves a gift card using the gift card account number (GAN). |
> | `square_retrieve_gift_card_from_nonce` | Retrieves a gift card using a nonce (a secure token) that represents the gift card. |
> | `square_retrieve_inventory_adjustment` | Returns the InventoryAdjustment object with the provided 'adjustment\_id'. |
> | `square_retrieve_inventory_changes` | Returns a set of physical counts and inventory adjustments for the provided CatalogObject at the requested. |
> | `square_retrieve_inventory_count` | Retrieves the current calculated stock count for a given. |
> | `square_retrieve_inventory_physical_count` | Returns the InventoryPhysicalCount object with the provided 'physical\_count\_id'. |
> | `square_retrieve_inventory_transfer` | Returns the InventoryTransfer object with the provided 'transfer\_id'. |
> | `square_retrieve_location` | Retrieves details of a location. |
> | `square_retrieve_loyalty_account` | Retrieves a loyalty account. |
> | `square_retrieve_loyalty_program` | Retrieves the loyalty program in a seller's account, specified by the program ID or the keyword 'main'. |
> | `square_retrieve_loyalty_reward` | Retrieves a loyalty reward. |
> | `square_retrieve_merchant` | Retrieve a 'Merchant' object for the given 'merchant\_id'. |
> | `square_retrieve_order` | Provides comprehensive information for a single online store order, including the order's history. |
> | `square_retrieve_payment` | Provides comprehensive information for a single payment. |
> | `square_retrieve_settlement` | Provides comprehensive information for a single settlement. |
> | `square_retrieve_snippet` | Retrieves your snippet from a Square Online site. |
> | `square_retrieve_subscription` | Retrieves a subscription. |
> | `square_retrieve_team_member` | Retrieves a 'TeamMember' object for the given 'TeamMember.id'. |
> | `square_retrieve_team_member_booking_profile` | Retrieves a team member's booking profile. |
> | `square_retrieve_transaction` | Retrieves details for a single transaction. |
> | `square_retrieve_wage_setting` | Retrieves a 'WageSetting' object for a team member specified by 'TeamMember.id'. |
> | `square_revoke_token` | Revokes an access token generated with the OAuth flow. |
> | `square_search_availability` | Searches for availabilities for booking. |
> | `square_search_catalog_items` | Searches for catalog items or item variations by matching supported search attribute values, including custom attribute values, against one or more of the specified query expressions. |
> | `square_search_catalog_objects` | Searches for CatalogObject of any type by matching supported search attribute values, excluding custom attribute values on items or item variations, against one or more of the specified query… |
> | `square_search_customers` | Searches the customer profiles associated with a Square account using a supported query filter. |
> | `square_search_invoices` | Searches for invoices from a location specified in the filter. |
> | `square_search_loyalty_accounts` | Searches for loyalty accounts in a loyalty program. |
> | `square_search_loyalty_events` | Searches for loyalty events. |
> | `square_search_loyalty_rewards` | Searches for loyalty rewards in a loyalty account. |
> | `square_search_orders` | Search all orders for one or more locations. |
> | `square_search_shifts` | Returns a paginated list of 'Shift' records for a business. |
> | `square_search_subscriptions` | Searches for subscriptions. |
> | `square_search_team_members` | Returns a paginated list of 'TeamMember' objects for a business. |
> | `square_search_terminal_checkouts` | Retrieves a filtered list of Terminal checkout requests created by the account making the request. |
> | `square_search_terminal_refunds` | Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. |
> | `square_submit_evidence` | Submits evidence to the cardholder's bank. |
> | `square_unlink_customer_from_gift_card` | Unlinks a customer from a gift card |
> | `square_update_booking` | Updates a booking. |
> | `square_update_break_type` | Updates an existing 'BreakType'. |
> | `square_update_customer` | Updates a customer profile. |
> | `square_update_customer_group` | Updates a customer group as identified by the 'group\_id' value. |
> | `square_update_employee` | UpdateEmployee |
> | `square_update_employee_role` | Modifies the details of an employee role. |
> | `square_update_invoice` | Updates an invoice by modifying fields, clearing fields, or both. |
> | `square_update_item_modifier_lists` | Updates the CatalogModifierList objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item. |
> | `square_update_item_taxes` | Updates the CatalogTax objects that apply to the targeted CatalogItem without having to perform an upsert on the entire item. |
> | `square_update_location` | Updates a location. |
> | `square_update_order` | Updates the details of an online store order. |
> | `square_update_payment` | Updates a payment with the APPROVED status. |
> | `square_update_shift` | Updates an existing 'Shift'. |
> | `square_update_subscription` | Updates a subscription. |
> | `square_update_team_member` | Updates a single 'TeamMember' object. |
> | `square_update_wage_setting` | Creates or updates a 'WageSetting' object. |
> | `square_update_workweek_config` | Updates a 'WorkweekConfig'. |
> | `square_upsert_catalog_object` | Creates or updates the target CatalogObject. |
> | `square_upsert_snippet` | Adds a snippet to a Square Online site or updates the existing snippet on the site. . |
> | `square_void_transaction` | Cancels a transaction that was created with the Charge endpoint with a 'delay\_capture' value of 'true'. |

## Frequently asked questions

> [accordion] Can I limit an agent to only reading Square data, not writing it?
>
> Yes. Write a credential policy with a DENY rule targeting mutating operations, or use wildcard patterns like square\_list\_\* and square\_get\_\* in an ALLOW rule. Guild's credential proxy enforces the rules before any request reaches Square. See /platform/credential-policies for syntax.

> [accordion] Where do I store my Square API key?
>
> Connect it in Access & setup > Credentials. Guild stores the key and adds it as a bearer token in the Authorization header on every request. Agent code never sees the key. See /platform/credentials for workspace, member, and agent-scoped options.

> [accordion] Can Guild agents receive Square webhook events?
>
> No. The catalog entry for `guildai~square` lists no webhook events, so agents cannot trigger on Square events through Guild's event system.

> [accordion] Can I give different Square credentials to different agents in the same workspace?
>
> Yes. Connect a dedicated credential from the installed agent's detail page, or grant an existing credential to a specific agent. Guild resolves credentials in order: grants and dedicated credentials take priority over workspace and account defaults. See /platform/credentials for the full resolution order.

## Put a governed agent on Square this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use Square.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect Square to your first agent.

## Related

**Also runs on Guild:** [Affinity](https://docs.guild.ai/integrations/affinity-openapi.md) · [Attio](https://docs.guild.ai/integrations/attio.md) · [Brex](https://docs.guild.ai/integrations/brex-openapi.md) · [Deel](https://docs.guild.ai/integrations/deel.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
