# Square — Pipedream Connect

> Solutions & Tools to Grow Your Business

- API slug: `square` (use in MCP headers and tool keys)
- Auth: OAuth (Pipedream-managed)
- Categories: Commerce
- Website: https://squareup.com
- Managed OAuth scopes: `CUSTOMERS_READ` · `CUSTOMERS_WRITE` · `PAYMENTS_READ` · `PAYMENTS_WRITE` · `ORDERS_READ` · `ORDERS_WRITE` · `SUBSCRIPTIONS_READ` · `SUBSCRIPTIONS_WRITE` · `ITEMS_READ` · `ITEMS_WRITE` · `INVOICES_READ` · `INVOICES_WRITE` · `LOYALTY_READ` · `LOYALTY_WRITE` · `EMPLOYEES_READ` · `EMPLOYEES_WRITE` · `MERCHANT_PROFILE_READ` · `BANK_ACCOUNTS_READ` · `SETTLEMENTS_READ` · `DEVELOPER_APPLICATION_WEBHOOKS_WRITE` · `APPOINTMENTS_ALL_READ` · `APPOINTMENTS_READ`
- This page (HTML): https://pipedream.com/apps/square
- Tools: 6 actions · 5 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: square`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "square",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Create Customer:
const result = await mcp.callTool({
  name: "square-create-customer",
  arguments: {
    givenName: "Given Name",
    familyName: "Family Name",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Square endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://connect.squareup.com/oauth2/token/status

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9jb25uZWN0LnNxdWFyZXVwLmNvbS9vYXV0aDIvdG9rZW4vc3RhdHVz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "square-create-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    square: { authProvisionId: "apn_xxxxxxx" },
    givenName: "Given Name",
    familyName: "Family Name",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (6)

### `square-create-customer` — Create Customer (Write)

Creates a new customer for a business. Must provide at least one of the following: Given Name, Family Name, Company Name, Email Address, or Phone Number. See the docs.

Full schema: https://pipedream.com/apps/square/actions/create-customer.md

### `square-create-invoice` — Create Invoice (Write)

Creates a draft invoice for an order. You must send (publish) the invoice before Square can process it. See the documentation.

Full schema: https://pipedream.com/apps/square/actions/create-invoice.md

### `square-create-order` — Create Order (Write)

Creates a new order that can include information about products for purchase. See docs here.

Full schema: https://pipedream.com/apps/square/actions/create-order.md

### `square-list-location-options` — List Location Options (Read-only)

Retrieves available options for the Location field.

Full schema: https://pipedream.com/apps/square/actions/list-location-options.md

### `square-list-event-types-options` — List Webhook Event Types Options (Read-only)

Retrieves available options for the Webhook Event Types field.

Full schema: https://pipedream.com/apps/square/actions/list-event-types-options.md

### `square-send-invoice` — Send Invoice (Write)

Publishes the latest version of a specified invoice. See the docs.

Full schema: https://pipedream.com/apps/square/actions/send-invoice.md

## Triggers (5)

### `square-catalog-item-updated` — Catalog Item Updated (Polling)

Emit new event every time a catalog item is updated. See the docs

Full schema: https://pipedream.com/apps/square/triggers/catalog-item-updated.md

### `square-new-booking-created` — New Booking Created (Polling)

Emit new event for every new booking created. See the docs

Full schema: https://pipedream.com/apps/square/triggers/new-booking-created.md

### `square-new-customer-created` — New Customer Created (Polling)

Emit new event for every new customer created. See the docs

Full schema: https://pipedream.com/apps/square/triggers/new-customer-created.md

### `square-new-invoice-created` — New Invoice Created (Polling)

Emit new event for every new invoice created. See the docs

Full schema: https://pipedream.com/apps/square/triggers/new-invoice-created.md

### `square-new-order-created` — New Order Created (Polling)

Emit new event for every new order created. See the docs

Full schema: https://pipedream.com/apps/square/triggers/new-order-created.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
