Square Connect API logo

Square Connect API

Square Connect API

Square Connect API 提供线上线下支付、订单、库存、客户管理能力,主要服务中小商户与餐饮零售。

访问站点 ↗健康巡检 9 小时前
适合什么时候用

线上线下统一 API,比纯线上支付商更全

先注意什么

国家覆盖较窄(主美国、加拿大、英国、爱尔兰、澳洲、日本)

第一步先查

到 developer.squareup.com 注册账户,从 Dashboard 取 sandbox / production 的 access_token(Personal Access Token 或 OAuth)。所有请求 Authorization: Bearer <token> 与 Square-Version 头。

认证
api_key
CORS
不支持
HTTPS
注册
需要
延迟
1309 ms
协议
REST
计费
paid

可用率 · 30 天窗口

巡检: 1可用率: 100%平均延迟: 1309ms
01

关于这个 API

Square 不是纯在线支付商——它把 POS 硬件、库存、订单、客户、会员等线下零售业务能力一起暴露成 API。这让它在餐饮、零售、美容等需要线下线上同步的场景里比纯线上的 Stripe 等更合适。

API 分多个模块:Payments(线上)、Terminal(线下读卡器)、Catalog(商品目录与库存)、Orders(订单、退款)、Customers(客户档案)、Subscriptions(订阅)、Bookings(预约)。所有模块共享同一个 Location 概念——商家可以有多个店面,每个 Location 有独立的库存与订单。

认证主要走 OAuth 或 Personal Access Token。所有请求要带 Square-Version 头来锁定 API 版本,避免上游变更影响。sandbox 完全免费且功能完整,包含模拟卡号、虚拟终端。国家覆盖比 Stripe 窄,主要美加英澳日,进入新市场需关注 supported countries 页。

02

你可以做什么

  • 1为电商应用接入在线 Square 支付
  • 2同步 POS 销售数据到外部分析系统
  • 3管理菜单、库存与商品目录
  • 4自动化对接 Square 终端做实体店收单
  • 5查询客户与订单数据做营销
03

优劣对比

优点

  • 线上线下统一 API,比纯线上支付商更全
  • sandbox 完备且免费
  • 硬件(terminal、reader)与 API 深度集成
  • 中小商户面向的开发者文档较友好

注意事项

  • 国家覆盖较窄(主美国、加拿大、英国、爱尔兰、澳洲、日本)
  • 某些功能仅在特定区域可用
  • 手续费率比 Stripe 略高
04

示例请求

通用模板 — 实际 endpoint 请查阅文档替换 <endpoint>。
curl https://squareup.com/developers/<endpoint> \
  -H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.
05

快速开始

到 developer.squareup.com 注册账户,从 Dashboard 取 sandbox / production 的 access_token(Personal Access Token 或 OAuth)。所有请求 Authorization: Bearer <token> 与 Square-Version 头。

06

常见问题

Square 调用 API 收费吗?+

API 本身免费;只对实际交易收取手续费。标准卡支付费率约 2.6% + 10¢/笔。

sandbox 怎么用?+

Dashboard 切到 sandbox 模式,会得到独立的测试 token 与虚拟商户。模拟卡号触发各种付款场景。

中国商户能用吗?+

不支持中国大陆商户。覆盖区域为美、加、英、爱、澳、日。

Square-Version 头是必填的吗?+

强烈建议;不指定会用账户默认版本,可能因 Square 升级而行为变化。

07

技术细节

CORS: NoHTTPS: Yes注册: Yes开源: No
认证方式
api_key
计费
paid
协议
REST
SDK
python, javascript, java, ruby, php, csharp, go
响应时间
1309 ms
上次巡检
2026/5/12 07:38:28
08

接口端点

从 OpenAPI spec 自动解析。显示 12 / 200 个未弃用端点。

POST
/mobile/authorization-codeMobileAuthorization

CreateMobileAuthorizationCode

POST
/oauth2/clients/{client_id}/access-token/renewOAuth

RenewToken

client_id:path*
POST
/oauth2/revokeOAuth

RevokeToken

POST
/oauth2/tokenOAuth

ObtainToken

GET
/v1/{location_id}/ordersV1Transactions

ListOrders

location_id:path*order:querylimit:querybatch_token:query
GET
/v1/{location_id}/orders/{order_id}V1Transactions

RetrieveOrder

location_id:path*order_id:path*
PUT
/v1/{location_id}/orders/{order_id}V1Transactions

UpdateOrder

location_id:path*order_id:path*
GET
/v1/{location_id}/paymentsV1Transactions

ListPayments

location_id:path*order:querybegin_time:queryend_time:querylimit:query+2 更多
GET
/v1/{location_id}/payments/{payment_id}V1Transactions

RetrievePayment

location_id:path*payment_id:path*
GET
/v1/{location_id}/refundsV1Transactions

ListRefunds

location_id:path*order:querybegin_time:queryend_time:querylimit:query+1 更多
POST
/v1/{location_id}/refundsV1Transactions

CreateRefund

location_id:path*
GET
/v1/{location_id}/settlementsV1Transactions

ListSettlements

location_id:path*order:querybegin_time:queryend_time:querylimit:query+2 更多

另有 188 个端点未显示,详见 OpenAPI spec。

09

标签