200 Received
application/json
{
"status": "received",
"code": "123456",
"received_at": "2026-07-10T11:30:12"
}
Base URL:
使用购买邮箱时获得的订单 access_key 获取最新验证码。
GET /api/v1/verification-code
X-Access-Key: <access_key>
status: "pending"
status: "received"
| 位置 | 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| Header | X-Access-Key | string | 是 | 购买邮箱时获得的订单 access key。 |
| 字段 | 类型 | 说明 |
|---|---|---|
| status | string | pending 或 received |
| code | string | null | 验证码;待接收时为 null |
| received_at | string | null | 验证码接收时间,ISO 8601 格式 |
application/json
{
"status": "received",
"code": "123456",
"received_at": "2026-07-10T11:30:12"
}
application/json
{
"status": "pending",
"code": null,
"received_at": null
}
curl "/api/v1/verification-code" \\ -H "X-Access-Key: <access_key>"
import requests
response = requests.get(
"/api/v1/verification-code",
headers={"X-Access-Key": "<access_key>"},
timeout=10,
)
response.raise_for_status()
print(response.json())
const accessKey = "<access_key>";
async function waitForCode() {
while (true) {
const response = await fetch("/api/v1/verification-code", {
headers: { "X-Access-Key": accessKey },
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const result = await response.json();
if (result.status === "received") return result.code;
await new Promise((resolve) => setTimeout(resolve, 20000));
}
}
console.log(await waitForCode());
| HTTP 状态 | 含义 |
|---|---|
| 200 | pending 表示尚未收到验证码,received 表示可读取 code。 |
| 401 | 未提供 X-Access-Key。 |
| 404 | access key 不可用或订单已失效。 |
| 429 | 请求频率超限;读取 Retry-After 后再试。 |
| 503 | 限流服务暂不可用,请稍后重试。 |
单次查询最多 100 个邮箱。每项使用独立 access key,响应通过非敏感 ref 与请求对应。
POST /api/v1/verification-codes/batch
application/json
{
"items": [
{
"ref": "mail-1",
"access_key": "<access_key_1>"
},
{
"ref": "mail-2",
"access_key": "<access_key_2>"
}
]
}
application/json
{
"summary": {
"requested": 2,
"received": 1,
"pending": 1,
"failed": 0
},
"items": [
{
"ref": "mail-1",
"status": "received",
"address": "first@icloud.com",
"code": "123456",
"received_at": "2026-07-10T11:30:12",
"expires_at": "2026-08-10T11:30:12"
},
{
"ref": "mail-2",
"status": "pending",
"address": "second@icloud.com",
"code": null,
"received_at": null,
"expires_at": "2026-08-10T11:30:12"
}
]
}
| 字段 | 约束 | 说明 |
|---|---|---|
| items | 1-100 | access key 列表;ref 和 access_key 均不可重复。 |
| ref | 1-64 字符 | 客户端关联标识,响应会原样返回。 |
| status | 枚举 | received、pending、expired 或 not_found。 |
账户级接口需要在每个请求中携带 X-API-Key。
| Method | Endpoint | 用途 |
|---|---|---|
| GET | /api/v1/products | 查询商品与库存 |
| GET | /api/v1/balance | 查询账户余额 |
| POST | /api/v1/orders | 创建订单 |
| GET | /api/v1/orders/{order_no} | 查询订单 |
| GET | /api/v1/inbox/{access_key} | 读取订单收件箱 |
| POST | /api/v1/inboxes/batch | 批量读取当前账户拥有的收件箱 |
查询商品、有效期档位与库存。
periods[].days 为可购买天数;tiers[].min_qty 与 tiers[].unit_price 为阶梯价格。
application/json
{
"products": [
{
"id": "icloud",
"name": "iCloud 邮箱",
"provider_type": "icloud",
"periods": [
{
"days": 30,
"tiers": [
{
"min_qty": 1,
"unit_price": 0.5
}
]
}
],
"stock": 24
}
]
}
查询账户余额,balance 的类型为 number。
application/json
{
"balance": 100.5
}
创建并交付订单。provider_type 为商品 ID;quantity 必填且范围为 1-100;duration_days 可选,缺省时使用默认有效期。
每个交付邮箱包含 address、access_key 和 expires_at。
application/json
{
"provider_type": "icloud",
"quantity": 2,
"duration_days": 30
}
application/json
{
"order_no": "MM20260710...",
"quantity": 2,
"duration_days": 30,
"unit_price": 0.5,
"total": 1.0,
"emails": [
{
"address": "user@icloud.com",
"access_key": "<access_key>",
"expires_at": "2026-08-09T11:30:12"
}
]
}
路径参数 order_no 为订单号;仅返回当前 API 账户拥有的订单。
application/json
{
"order_no": "MM20260710...",
"status": "completed",
"quantity": 2,
"total_amount": 1.0,
"created_at": "2026-07-10T11:30:12",
"emails": []
}
路径参数 access_key 为订单密钥,响应返回邮箱信息和最近邮件。
该接口返回邮件正文,仅应在服务端调用,不要写入浏览器或应用日志。
application/json
{
"address": "user@icloud.com",
"expires_at": "2026-08-09T11:30:12",
"messages": [
{
"from": "sender@example.com",
"subject": "Verification code",
"body": "Your code is 123456",
"verification_code": "123456",
"received_at": "2026-07-10T11:30:12"
}
]
}
单次最多 20 个 access key,仅返回当前 X-API-Key 客户名下的邮箱;其他客户的 key 按 not_found 处理。
application/json
{
"items": [
{
"ref": "mail-1",
"access_key": "<access_key_1>"
}
],
"message_limit": 10
}
application/json
{
"summary": {
"requested": 1,
"succeeded": 1,
"failed": 0
},
"items": [
{
"ref": "mail-1",
"status": "ok",
"inbox": {
"address": "user@icloud.com",
"expires_at": "2026-08-09T11:30:12",
"messages": []
}
}
]
}