开发者

domain.latino API

稳定、带版本控制的 HTTP API,可用于查询 .latino 可用性、检索精选目录、使用已保存的卡片进行预订,以及管理卡片和 webhook。请求为 JSON,响应也为 JSON。

下载 OpenAPI (JSON) 获取 API 密钥

Base URL https://domain.latino/api/v1

身份验证

将您的 API 密钥作为 Bearer 令牌发送。请在账户设置中创建和管理密钥——完整密钥仅在创建时显示一次,请妥善保存。

Authorization: Bearer dpk_live_<selector>_<secret>

密钥形如 dpk_<env>_<selector>_<secret>,其中 env 为 live 或 test。

已登录的浏览器会话可以调用相同的接口;使用会话身份验证进行写操作时,还需额外提供 X-CSRF-Token 请求头。使用 Bearer 令牌的请求则无需此项。

权限范围与速率限制

每个密钥都带有一组权限范围。调用时所用的密钥必须持有该接口所需的权限范围。速率限制按权限范围、按密钥分别应用。

权限范围 授予权限 速率限制 层级
domain.check Check a single .pay domain — availability + pricing 50/sec 公开
catalog.search AI keyword search against the curated catalog 30/min 公开
orders.read List + read the account's own orders 60/min 公开
orders.write Create a pre-order against a saved payment method 10/min 公开
payment_methods.read List saved cards (Stripe payment methods) 20/min 公开
payment_methods.write Add (SetupIntent) + remove saved cards 20/min 公开
account.read Read account profile: email, role, vip_tier, granted scopes 60/min 公开
webhooks.read List configured webhook endpoints 20/min 公开
webhooks.write Create + delete webhook endpoints 10/min 公开
zone_file.download Download the full daily .pay DNS zone-file snapshot 24/day 受限
premium.list Paginated registry premium catalogue (incl. reserved/blocked) 60/min 受限
registered.list Paginated registered .pay names (from the DNS zone file) + AI brand context 60/min 受限

受限权限范围采用双重门控:密钥可以列出该权限范围,但只有在管理员将其授予您的账户后,调用才会成功。请在账户设置中申请。

支持的域名后缀

一个账户和一个 API 密钥适用于以下所有后缀 — 调用的基础 URL 决定所选后缀。

.pay https://domain.pay/api/v1
.latino https://domain.latino/api/v1
.dot https://domain.dot/api/v1

快速上手

通过两个快速调用即可开始:

# 查询某个名称
curl -s https://domain.latino/api/v1/check-domain \
  -H "Authorization: Bearer dpk_live_…" \
  -H "Content-Type: application/json" \
  -d '{"domain":"acme.latino"}'

# 我是谁 + 我能做什么
curl -s https://domain.latino/api/v1/account \
  -H "Authorization: Bearer dpk_live_…"

接口

所有接口均已上线。请求和响应的结构、参数以及状态码在 OpenAPI 文档中有完整说明。

Account

GET /account account.read Your profile + the scopes effective for this key.

Domains

POST /check-domain domain.check Availability + pricing for one name in a supported zone. Fast DB-only lookup (no live registry call) — POST /orders re-verifies live.

Catalog

POST /catalog/search catalog.search Keyword search over the curated catalogue.

Orders

GET /orders orders.read List your orders, newest first.
GET /orders/{id} orders.read One order + its customer message thread.
POST /orders orders.write Create a pre-order + charge a saved card (send an Idempotency-Key).

Payment methods

GET /account/payment-methods payment_methods.read List saved cards.
POST /account/payment-methods payment_methods.write Start a Stripe SetupIntent to add a card.
DELETE /account/payment-methods/{id} payment_methods.write Remove a saved card.

Webhooks

GET /webhooks webhooks.read List webhook endpoints.
POST /webhooks webhooks.write Register an endpoint (signing secret shown once).
DELETE /webhooks/{id} webhooks.write Delete an endpoint.

Restricted

GET /zone-file zone_file.download Daily DNS zone-file snapshot for the zone of the host you call.
GET /premium premium.list Registry premium catalogue.
GET /registered registered.list Registered names in the called zone + AI brand context.

若需完整的请求/响应约定,请导入 OpenAPI 规范: 下载 OpenAPI (JSON).

Webhook

注册一个 HTTPS 接口,我们会在事件发生时推送签名事件。签名密钥仅在创建时显示一次。

事件描述
order.createdA new order (pre-order) was created on the account
order.status_changedAn order changed payment status
payment.succeededA payment for an order succeeded
payment.failedA payment for an order failed or was canceled
payment.refundedA charge for an order was refunded
appraisal.completedA domain appraisal for an order finished

我们以 JSON 形式 POST 事件信封:

{
  "id": "evt_…",
  "event": "payment.succeeded",
  "created": "2026-05-28T12:00:00+00:00",
  "data": { "order": { … } }
}

使用您的签名密钥对原始请求体重新计算 HMAC-SHA256,并进行恒定时间比较,以验证每一次投递:

X-Domain-Pay-Signature: sha256=<HMAC_SHA256(raw_body, signing_secret)>

非 2xx 响应(或超时)会以指数退避(1 min to 24 h)重试,最多 6 次。连续 5 次投递失败后,该接口会被自动禁用,并通知所有者。

错误

所有错误采用统一结构。每个错误都会回传 request_id——在支持请求中请附上它。

{ "error": "scope_required", "message": "…", "request_id": "req_ab12…", "scope": "orders.read" }
HTTPerror含义
400invalid_requestMalformed or missing parameters.
401unauthorized / invalid_keyNo or invalid credential.
402card_declined / authentication_requiredPayment failed or needs SCA.
403scope_requiredThe key lacks the endpoint's scope.
403access_not_grantedRestricted scope not yet approved for this account.
403csrf_requiredSession write without a valid X-CSRF-Token.
404not_foundNo such endpoint or resource.
405method_not_allowedWrong HTTP verb.
409request_in_progressAn idempotency key's first request is still in flight.
422idempotency_key_reusedSame idempotency key, different parameters.
422contact_incompleteGA zones: add a registrant contact under /account/contacts first.
423account_lockedAccount is locked — contact support.
429rate_limitedSlow down; see the Retry-After header.
500server_errorOur fault.

受限访问

zone-file、premium 和 registered 接口除需相应权限范围外,还需获得批准的授权:

  1. 创建(或已拥有)一个列出该受限权限范围的 API 密钥。
  2. 在账户设置中,打开“受限 API 访问”,选择该权限范围,并说明您将如何使用这些数据。
  3. 我们的团队会进行审核,并将审批结果通过邮件通知您。
  4. 一旦获批,您账户下任何列出该权限范围的密钥都可立即使用。无需付费层级——审批按账户进行。

获取 API 密钥 下载 OpenAPI (JSON)