订单与商品
一笔订单对应一件商品,从余额付款。需要 100 件,就下 100 笔订单。商品需要通过单独的请求获取:创建订单的响应中不包含商品。
订单流程
- 商品目录
GET /v1/catalog:商品、交付方式、价格和库存情况。 - 下单
POST /v1/orders在同一操作中从余额扣款并交付商品。订单号(order_id)由我们生成。 - 商品
GET /v1/orders/:{order_id} key为卡密或兑换码,account为账号。请加密存储。 - 在客户账号上开通订阅 订单等待客户信息(状态
waiting):请通过POST /v1/orders/提交(见「开通」一节)。{order_id}/ activate
下单没有收到响应时,不要盲目重试
先调用 GET /v1/orders 查看当天(UTC)的订单;如果在 UTC 午夜前后发出请求,请同时检查前一天(?date=)。订单已存在,就继续处理该订单;不存在,才重新下单。盲目重试会产生第二笔订单,并从余额中再次扣款。
商品目录
GET /v1/catalog — 每件商品只有一个 product_id,商品如何交付给客户由 delivery_methods 描述:每种交付方式都有自己的价格 price_usdt、订阅时长 subscription_days 和库存状态 in_stock(API 不返回具体库存数量)。商品目录每 1 分钟更新一次。
delivery_method |
客户获得什么 |
|---|---|
key |
卡密或兑换码,由客户自行激活 |
activation |
在本人账号上开通的订阅:需要客户提供信息(见「开通」一节) |
card_payment |
在本人账号上开通的订阅,由我方银行卡代付:需要客户的邮箱(见「由我方银行卡代付」一节) |
account |
现成账号 |
new_account |
我们提供的新账号(含邮箱),比 card_payment 贵 2.00 USDT |
创建订单
POST /v1/orders — {"product_id": "…"}。如果商品有多种交付方式,请加上 "delivery_method";缺少该字段时会返回 40005 delivery_method_required,并在 details 中列出可选方式:我们不会替您擅自选择,因为不同方式的价格不同。
curl https://api.astrum.shop/v1/orders \
-H "Authorization: Bearer $ASTRUM_KEY" \
-H "Content-Type: application/json" \
-d '{"product_id": "3f6c0e7e-2b1d-4c1a-9a57-4d0f1b8e2c11"}'
import os, httpx
order = httpx.post(
"https://api.astrum.shop/v1/orders",
headers={"Authorization": f"Bearer {os.environ['ASTRUM_KEY']}"},
json={"product_id": "3f6c0e7e-2b1d-4c1a-9a57-4d0f1b8e2c11"},
timeout=30,
).json()
const res = await fetch("https://api.astrum.shop/v1/orders", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ASTRUM_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ product_id: "3f6c0e7e-2b1d-4c1a-9a57-4d0f1b8e2c11" }),
});
const order = await res.json();
该响应中不包含商品。
请通过 GET /v1/orders/ 获取商品,加密存储,且不要写入日志。
示例:从余额下单
{
"product_id": "3f6c0e7e-2b1d-4c1a-9a57-4d0f1b8e2c11"
}
{
"order_id": "b1e04c6e-5a0b-4f6e-9a39-0b9f2f1c8d21",
"product_id": "3f6c0e7e-2b1d-4c1a-9a57-4d0f1b8e2c11",
"product_name": "ChatGPT Plus",
"delivery_method": "activation",
"subscription_days": 30,
"status": "waiting",
"status_text": "等待您提供开通所需的信息。",
"price_usdt": "20.00",
"refunded_usdt": null,
"created_at": "2026-09-28T10:14:03Z",
"available_actions": [
"activate",
"cancel"
],
"activation": {
"customer_data_type": "chatgpt_session",
"customer_instruction": "请在浏览器中登录 ChatGPT,打开 chatgpt.com/api/auth/session 页面,完整复制页面上的全部文字并发送给我们。如果您当前在团队工作空间中,请先切换到个人账号。",
"verification_link": null,
"verification_until": null,
"current_plan_until": null,
"note_to_customer": null,
"page_url": "https://activate.astrum.shop/#t=seBMbloLT26aOQufLxyNIfi1NV8Ia9Gl8a4-FyM75pc"
},
"warranty": {
"until": null,
"claim_id": null,
"claim_status": null
}
}
订单状态
status |
订单情况 |
|---|---|
completed |
卡密或账号已交付,或订阅已开通 |
waiting |
等待客户操作:需要提供什么见 activation,当前进展见 status_text |
processing |
处理中,客户无需任何操作 |
failed |
未能成功,我们正在排查 |
canceled |
已取消,款项已退回余额 |
refunded |
因售后申请退款,款项已退回余额 |
status_text 是面向客户的现成文本,请原样展示。当前可执行的操作见 available_actions(activate、retry、force、cancel)。
订单中返回的商品
GET /v1/orders/ — 返回订单,以及已交付的商品:
| 字段 | 何时返回 | 内容 |
|---|---|---|
key |
交付方式为 key |
字符串形式的卡密或兑换码 |
account |
交付方式为 account 和 new_account |
login、password、email、email_password;新账号还包含 login_method(password 或 email_code,即用邮件中的验证码登录)和 email_recovery;text 为交付时的完整账号信息原文 |
商品尚未交付时,响应中完全没有 key 和 account 字段。无法明确拆分的账号信息(例如密码中含有冒号),请直接使用 text 中的完整内容。
当日订单
GET /v1/orders — 返回当天(UTC 自然日)的订单,最新的在前;查询其他日期使用 ?date=2026-09-28。列表中不包含商品。
取消订单
POST /v1/orders/ — 款项立即退回余额,商品退回库存。在商品被取走之前可以取消:
- 卡密或账号:
GET /v1/orders/尚未返回过商品;{order_id} - 订阅:尚未提交过客户信息。
当前能否取消,看 available_actions 中是否有 cancel。否则会返回错误:50002 goods_already_taken、50003 customer_data_already_sent、50005 order_in_progress(新账号从下单第一分钟起即开始准备)。已交付的商品有问题时,请在交付后 7 天内提交售后申请(见「质保」一节)。
错误
请根据 code 而不是文本做分支判断:message 面向人阅读,内容可能变化。访问类错误对所有接口通用,完整列表见「错误码」一节。
30001 not_enough_balanceGET /v1/balance/top-up-addresses )后重试。40002 out_of_stock40003 card_payment_queue_full40004 no_email_for_new_account40001 product_not_foundGET /v1/catalog 获取 product_id。40005 delivery_method_requireddetails.delivery_methods 及商品目录。40006 delivery_method_unavailabledetails.delivery_methods 及商品目录。20002 too_many_ordersRetry-After 秒。限额见 GET /v1/account。20004 daily_order_limit_reached20005 daily_spend_limit_reachedGET /v1/balance 中的 available_today_usdt。额度在 UTC 时间 00:00 重置。90003 exchange_rate_unavailable90004 try_again11006 validation_errordetails.errors:字段及原因。