# Send Square to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "squareup",
    "name": "Square",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/squareup",
    "canonicalUrl": "https://clawhub.ai/byungkyu/squareup",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/squareup",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=squareup",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/squareup"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/squareup",
    "downloadUrl": "https://openagent3.xyz/downloads/squareup",
    "agentUrl": "https://openagent3.xyz/skills/squareup/agent",
    "manifestUrl": "https://openagent3.xyz/skills/squareup/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/squareup/agent.md"
  }
}
```
## Documentation

### Square

Access the Square API with managed OAuth authentication. Process payments, manage customers, orders, catalog items, inventory, and invoices.

### Quick Start

# List locations
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/squareup/v2/locations')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

### Base URL

https://gateway.maton.ai/squareup/{native-api-path}

Replace {native-api-path} with the actual Square API endpoint path. The gateway proxies requests to connect.squareup.com and automatically injects your OAuth token.

### Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

### Getting Your API Key

Sign in or create an account at maton.ai
Go to maton.ai/settings
Copy your API key

### Connection Management

Manage your Square OAuth connections at https://ctrl.maton.ai.

### List Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=squareup&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

### Create Connection

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'squareup'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

### Get Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Response:

{
  "connection": {
    "connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
    "status": "ACTIVE",
    "creation_time": "2025-12-08T07:20:53.488460Z",
    "last_updated_time": "2026-01-31T20:03:32.593153Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "squareup",
    "metadata": {}
  }
}

Open the returned url in a browser to complete OAuth authorization.

### Delete Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

### Specifying Connection

If you have multiple Square connections, specify which one to use with the Maton-Connection header:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/squareup/v2/locations')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '21fd90f9-5935-43cd-b6c8-bde9d915ca80')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

If omitted, the gateway uses the default (oldest) active connection.

### Locations

List Locations

GET /squareup/v2/locations

Get Location

GET /squareup/v2/locations/{location_id}

Create Location

POST /squareup/v2/locations
Content-Type: application/json

{
  "location": {
    "name": "New Location",
    "address": {
      "address_line_1": "123 Main St",
      "locality": "San Francisco",
      "administrative_district_level_1": "CA",
      "postal_code": "94102",
      "country": "US"
    }
  }
}

Update Location

PUT /squareup/v2/locations/{location_id}
Content-Type: application/json

{
  "location": {
    "name": "Updated Location Name"
  }
}

### Merchants

Get Merchant

GET /squareup/v2/merchants/me

List Merchants

GET /squareup/v2/merchants

### Payments

List Payments

GET /squareup/v2/payments

With filters:

GET /squareup/v2/payments?location_id={location_id}&begin_time=2026-01-01T00:00:00Z&end_time=2026-02-01T00:00:00Z

Get Payment

GET /squareup/v2/payments/{payment_id}

Create Payment

POST /squareup/v2/payments
Content-Type: application/json

{
  "source_id": "cnon:card-nonce-ok",
  "idempotency_key": "unique-key-12345",
  "amount_money": {
    "amount": 1000,
    "currency": "USD"
  },
  "location_id": "{location_id}"
}

Update Payment

PUT /squareup/v2/payments/{payment_id}
Content-Type: application/json

{
  "payment": {
    "tip_money": {
      "amount": 200,
      "currency": "USD"
    }
  },
  "idempotency_key": "unique-key-67890"
}

Complete Payment

POST /squareup/v2/payments/{payment_id}/complete
Content-Type: application/json

{}

Cancel Payment

POST /squareup/v2/payments/{payment_id}/cancel
Content-Type: application/json

{}

### Refunds

List Refunds

GET /squareup/v2/refunds

Get Refund

GET /squareup/v2/refunds/{refund_id}

Create Refund

POST /squareup/v2/refunds
Content-Type: application/json

{
  "idempotency_key": "unique-refund-key",
  "payment_id": "{payment_id}",
  "amount_money": {
    "amount": 500,
    "currency": "USD"
  },
  "reason": "Customer requested refund"
}

### Customers

List Customers

GET /squareup/v2/customers

Get Customer

GET /squareup/v2/customers/{customer_id}

Create Customer

POST /squareup/v2/customers
Content-Type: application/json

{
  "given_name": "John",
  "family_name": "Doe",
  "email_address": "john.doe@example.com",
  "phone_number": "+15551234567"
}

Update Customer

PUT /squareup/v2/customers/{customer_id}
Content-Type: application/json

{
  "email_address": "john.updated@example.com"
}

Delete Customer

DELETE /squareup/v2/customers/{customer_id}

Search Customers

POST /squareup/v2/customers/search
Content-Type: application/json

{
  "query": {
    "filter": {
      "email_address": {
        "exact": "john.doe@example.com"
      }
    }
  }
}

### Orders

Create Order

POST /squareup/v2/orders
Content-Type: application/json

{
  "order": {
    "location_id": "{location_id}",
    "line_items": [
      {
        "name": "Item 1",
        "quantity": "1",
        "base_price_money": {
          "amount": 1000,
          "currency": "USD"
        }
      }
    ]
  },
  "idempotency_key": "unique-order-key"
}

Get Order

GET /squareup/v2/orders/{order_id}

Update Order

PUT /squareup/v2/orders/{order_id}
Content-Type: application/json

{
  "order": {
    "location_id": "{location_id}",
    "version": 1
  },
  "fields_to_clear": ["line_items"]
}

Search Orders

POST /squareup/v2/orders/search
Content-Type: application/json

{
  "location_ids": ["{location_id}"],
  "query": {
    "filter": {
      "state_filter": {
        "states": ["OPEN"]
      }
    }
  }
}

Batch Retrieve Orders

POST /squareup/v2/orders/batch-retrieve
Content-Type: application/json

{
  "location_id": "{location_id}",
  "order_ids": ["{order_id_1}", "{order_id_2}"]
}

Pay Order

POST /squareup/v2/orders/{order_id}/pay
Content-Type: application/json

{
  "idempotency_key": "unique-key",
  "payment_ids": ["{payment_id}"]
}

### Catalog

List Catalog

GET /squareup/v2/catalog/list

With type filter:

GET /squareup/v2/catalog/list?types=ITEM,CATEGORY

Get Catalog Object

GET /squareup/v2/catalog/object/{object_id}

Upsert Catalog Object

POST /squareup/v2/catalog/object
Content-Type: application/json

{
  "idempotency_key": "unique-catalog-key",
  "object": {
    "type": "ITEM",
    "id": "#new-item",
    "item_data": {
      "name": "Coffee",
      "description": "Hot brewed coffee",
      "variations": [
        {
          "type": "ITEM_VARIATION",
          "id": "#small-coffee",
          "item_variation_data": {
            "name": "Small",
            "pricing_type": "FIXED_PRICING",
            "price_money": {
              "amount": 300,
              "currency": "USD"
            }
          }
        }
      ]
    }
  }
}

Delete Catalog Object

DELETE /squareup/v2/catalog/object/{object_id}

Batch Upsert Catalog Objects

POST /squareup/v2/catalog/batch-upsert
Content-Type: application/json

{
  "idempotency_key": "unique-batch-key",
  "batches": [
    {
      "objects": [...]
    }
  ]
}

Search Catalog Objects

POST /squareup/v2/catalog/search
Content-Type: application/json

{
  "object_types": ["ITEM"],
  "query": {
    "text_query": {
      "keywords": ["coffee"]
    }
  }
}

Get Catalog Info

GET /squareup/v2/catalog/info

### Inventory

Retrieve Inventory Count

GET /squareup/v2/inventory/{catalog_object_id}

Batch Retrieve Inventory Counts

POST /squareup/v2/inventory/counts/batch-retrieve
Content-Type: application/json

{
  "catalog_object_ids": ["{object_id_1}", "{object_id_2}"],
  "location_ids": ["{location_id}"]
}

Batch Change Inventory

POST /squareup/v2/inventory/changes/batch-create
Content-Type: application/json

{
  "idempotency_key": "unique-inventory-key",
  "changes": [
    {
      "type": "ADJUSTMENT",
      "adjustment": {
        "catalog_object_id": "{object_id}",
        "location_id": "{location_id}",
        "quantity": "10",
        "from_state": "NONE",
        "to_state": "IN_STOCK"
      }
    }
  ]
}

Retrieve Inventory Adjustment

GET /squareup/v2/inventory/adjustments/{adjustment_id}

### Invoices

List Invoices

GET /squareup/v2/invoices?location_id={location_id}

Get Invoice

GET /squareup/v2/invoices/{invoice_id}

Create Invoice

POST /squareup/v2/invoices
Content-Type: application/json

{
  "invoice": {
    "location_id": "{location_id}",
    "order_id": "{order_id}",
    "primary_recipient": {
      "customer_id": "{customer_id}"
    },
    "payment_requests": [
      {
        "request_type": "BALANCE",
        "due_date": "2026-02-15"
      }
    ],
    "delivery_method": "EMAIL"
  },
  "idempotency_key": "unique-invoice-key"
}

Update Invoice

PUT /squareup/v2/invoices/{invoice_id}
Content-Type: application/json

{
  "invoice": {
    "version": 1,
    "payment_requests": [
      {
        "uid": "{payment_request_uid}",
        "due_date": "2026-02-20"
      }
    ]
  },
  "idempotency_key": "unique-update-key"
}

Publish Invoice

POST /squareup/v2/invoices/{invoice_id}/publish
Content-Type: application/json

{
  "version": 1,
  "idempotency_key": "unique-publish-key"
}

Cancel Invoice

POST /squareup/v2/invoices/{invoice_id}/cancel
Content-Type: application/json

{
  "version": 1
}

Delete Invoice

DELETE /squareup/v2/invoices/{invoice_id}?version=1

Search Invoices

POST /squareup/v2/invoices/search
Content-Type: application/json

{
  "query": {
    "filter": {
      "location_ids": ["{location_id}"],
      "customer_ids": ["{customer_id}"]
    }
  }
}

### Team Members

Search Team Members

POST /squareup/v2/team-members/search
Content-Type: application/json

{
  "query": {
    "filter": {
      "location_ids": ["{location_id}"],
      "status": "ACTIVE"
    }
  }
}

Get Team Member

GET /squareup/v2/team-members/{team_member_id}

Update Team Member

PUT /squareup/v2/team-members/{team_member_id}
Content-Type: application/json

{
  "team_member": {
    "given_name": "Updated Name"
  }
}

### Loyalty

List Loyalty Programs

GET /squareup/v2/loyalty/programs

Get Loyalty Program

GET /squareup/v2/loyalty/programs/{program_id}

Search Loyalty Accounts

POST /squareup/v2/loyalty/accounts/search
Content-Type: application/json

{
  "query": {
    "customer_ids": ["{customer_id}"]
  }
}

Create Loyalty Account

POST /squareup/v2/loyalty/accounts
Content-Type: application/json

{
  "loyalty_account": {
    "program_id": "{program_id}",
    "mapping": {
      "phone_number": "+15551234567"
    }
  },
  "idempotency_key": "unique-key"
}

Accumulate Loyalty Points

POST /squareup/v2/loyalty/accounts/{account_id}/accumulate
Content-Type: application/json

{
  "accumulate_points": {
    "order_id": "{order_id}"
  },
  "location_id": "{location_id}",
  "idempotency_key": "unique-key"
}

### Payment Links (Online Checkout)

List Payment Links

GET /squareup/v2/online-checkout/payment-links

Get Payment Link

GET /squareup/v2/online-checkout/payment-links/{id}

Create Payment Link

POST /squareup/v2/online-checkout/payment-links
Content-Type: application/json

{
  "idempotency_key": "unique-key",
  "quick_pay": {
    "name": "Payment for Service",
    "price_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "location_id": "{location_id}"
  }
}

Update Payment Link

PUT /squareup/v2/online-checkout/payment-links/{id}
Content-Type: application/json

{
  "payment_link": {
    "version": 1,
    "description": "Updated description"
  }
}

Delete Payment Link

DELETE /squareup/v2/online-checkout/payment-links/{id}

### Cards

List Cards

GET /squareup/v2/cards
GET /squareup/v2/cards?customer_id={customer_id}

Get Card

GET /squareup/v2/cards/{card_id}

Create Card

POST /squareup/v2/cards
Content-Type: application/json

{
  "idempotency_key": "unique-key",
  "source_id": "cnon:card-nonce-ok",
  "card": {
    "customer_id": "{customer_id}"
  }
}

Disable Card

POST /squareup/v2/cards/{card_id}/disable

### Payouts

List Payouts

GET /squareup/v2/payouts
GET /squareup/v2/payouts?location_id={location_id}

Get Payout

GET /squareup/v2/payouts/{payout_id}

List Payout Entries

GET /squareup/v2/payouts/{payout_id}/payout-entries

### Bank Accounts

List Bank Accounts

GET /squareup/v2/bank-accounts

Get Bank Account

GET /squareup/v2/bank-accounts/{bank_account_id}

### Terminal

List Terminal Checkouts

GET /squareup/v2/terminals/checkouts

Create Terminal Checkout

POST /squareup/v2/terminals/checkouts
Content-Type: application/json

{
  "idempotency_key": "unique-key",
  "checkout": {
    "amount_money": {
      "amount": 1000,
      "currency": "USD"
    },
    "device_options": {
      "device_id": "{device_id}"
    }
  }
}

Get Terminal Checkout

GET /squareup/v2/terminals/checkouts/{checkout_id}

Search Terminal Checkouts

POST /squareup/v2/terminals/checkouts/search
Content-Type: application/json

{
  "query": {
    "filter": {
      "status": "COMPLETED"
    }
  }
}

Cancel Terminal Checkout

POST /squareup/v2/terminals/checkouts/{checkout_id}/cancel

### Pagination

Square uses cursor-based pagination. List endpoints return a cursor field when more results exist:

GET /squareup/v2/payments?cursor={cursor_value}

Response includes pagination info:

{
  "payments": [...],
  "cursor": "next_page_cursor_value"
}

Continue fetching by passing the cursor value in subsequent requests until no cursor is returned.

### JavaScript

const response = await fetch(
  'https://gateway.maton.ai/squareup/v2/locations',
  {
    headers: {
      'Authorization': \`Bearer ${process.env.MATON_API_KEY}\`
    }
  }
);
const data = await response.json();

### Python

import os
import requests

response = requests.get(
    'https://gateway.maton.ai/squareup/v2/locations',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()

### Notes

All amounts are in the smallest currency unit (e.g., cents for USD: 1000 = $10.00)
IDs are alphanumeric strings
Timestamps are in ISO 8601 format (e.g., 2026-02-07T01:59:28.459Z)
Most write operations require an idempotency_key to prevent duplicate operations
Some endpoints require specific OAuth scopes (CUSTOMERS_READ, ORDERS_READ, ITEMS_READ, INVOICES_READ, etc.)
IMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing
IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments

### Error Handling

StatusMeaning400Missing Square connection or bad request401Invalid or missing Maton API key403Insufficient OAuth scopes404Resource not found429Rate limited4xx/5xxPassthrough error from Square API

### Error Response Format

{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "NOT_FOUND",
      "detail": "Could not find payment with id: {payment_id}"
    }
  ]
}

### Troubleshooting: API Key Issues

Check that the MATON_API_KEY environment variable is set:

echo $MATON_API_KEY

Verify the API key is valid by listing connections:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

### Troubleshooting: Invalid App Name

Ensure your URL path starts with squareup. For example:

Correct: https://gateway.maton.ai/squareup/v2/locations
Incorrect: https://gateway.maton.ai/v2/locations

### Troubleshooting: Insufficient Scopes

If you receive a 403 error with INSUFFICIENT_SCOPES, the OAuth connection doesn't have the required permissions. Create a new connection and ensure you grant all necessary permissions during OAuth authorization.

### Resources

Square API Overview
Square API Reference
Payments API
Customers API
Orders API
Catalog API
Inventory API
Invoices API
Locations API
Team Members API
Loyalty API
Online Checkout API
Cards API
Payouts API
Bank Accounts API
Terminal API
Maton Community
Maton Support
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: byungkyu
- Version: 1.0.3
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-05-07T17:22:31.273Z
- Expires at: 2026-05-14T17:22:31.273Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/squareup)
- [Send to Agent page](https://openagent3.xyz/skills/squareup/agent)
- [JSON manifest](https://openagent3.xyz/skills/squareup/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/squareup/agent.md)
- [Download page](https://openagent3.xyz/downloads/squareup)