When to Use / When to Use
- The user wants to create a bazi report order and get a payment link
- The user expresses purchase intent but the word "purchase" may not necessarily appear (e.g., "I want", "I'd like", "get me one")
- The user wants to order an in-depth report or the 2026 report
- The user wants to query the report status and download entry for a single order
Prerequisites / Prerequisites
- Recommended runtime environment: Node 24 (can run TypeScript source directly)
- Compatible solution: If the Node version is lower, use
tsxto execute - Execution directory: In the skill root directory (
SKILL.mddirectory) run the following command - The script runs directly from TypeScript source and does not require precompilation
# 仅在需要兼容运行时安装
npm i -D tsx
Script Index / Script Index
scripts/createCheckout.ts: Create an anonymous payment session and return the payment link and report IDscripts/getReport.ts: ByprofileIdquery report status
Scripts & Parameters / Scripts & Parameters
1) Create anonymous payment / createCheckout
Entry file:scripts/createCheckout.ts
# 推荐方式
node scripts/createCheckout.ts --email <email> --birth <YYYY-MM-DDTHH:mm[:ss]> --type <DEEP|YEAR2026> --gender <0|1> [--locale <zh|en|ja|ko|zh-TW>]
# 兼容方式(fallback)
tsx scripts/createCheckout.ts --email <email> --birth <YYYY-MM-DDTHH:mm[:ss]> --type <DEEP|YEAR2026> --gender <0|1> [--locale <zh|en|ja|ko|zh-TW>]
Parameter description:
--email(required): email to receive the report; format string; no default value; errors and exits if missing--birth(required): solar calendar birth time; script input parameter formatYYYY-MM-DDTHH:mm[:ss](24-hour clock); no default value; errors and exits if the format is invalid or out of range- Do not ask the user to provide their birthday in this format
--type(required): order type; valuesDEEP|YEAR2026; no default value; errors and exits if missing or invalidDEEPindicates the in-depth bazi report. Includes detailed interpretations in four aspects: life, love, wealth, and health.YEAR2026indicates the 2026 fortune report. Includes detailed interpretations of Tai Sui, life, love, wealth, health, feng shui, and other aspects for 2026.
--locale(optional): language of the payment page/download page; valueszh|en|ja|ko|zh-TW; defaultzh; prioritize the current session language, and override only when the user explicitly specifies another language; errors and exits if the value is invalid--nickname(optional): nickname; format string; not passed by default--gender(required): gender; values0=female,1=male; no default value; errors and exits if missing or invalid--sect(optional): zi hour school; values1or2; default2;1indicates that the day pillar for 23:00-00:00 is calculated as the next day,2indicates calculation as the current day; errors and exits if the value is invalid--location(optional): birthplace; format string; not passed by default; after passing it, true solar time conversion will be performed according to the location
Output description:
- Returns JSON, including
checkoutSessionId、payUrl、checkoutType、profileId payUrloutput only byscripts/createCheckout.ts, used for payment; not used for download
2) Query report status / getReport
Entry file:scripts/getReport.ts
# 推荐方式
node scripts/getReport.ts --profile-id <profileId>
# 兼容方式(fallback)
tsx scripts/getReport.ts --profile-id <profileId>
Parameter description:
--profile-id(required): profile ID; no default; errors and exits if missing- Other parameters are not supported (such as
--type、--locale); when an unknown parameter is passed in, report an error and exit
Output description:
profileId: the profile ID of this querylocale: the language used for this resultpaid: whether a valid payment is detected;trueorfalsereadyToDownload: whether the report is downloadable;trueorfalsedownloadPageUrl: the download page link; when no link is available,null
Abnormal behavior:
- When a parameter is missing, a parameter value is invalid, or an unknown parameter exists: the script outputs an error and exits (non-zero)
- When the script identifies it as "unpaid/no valid payment record": it does not exit with an error, and returns
paid=false - Other request exceptions or system exceptions: the script outputs an error and exits (non-zero)
示例 / Examples
# createCheckout 最小可用示例
node scripts/createCheckout.ts \
--email user@example.com \
--birth 1990-05-15T14:30 \
--type YEAR2026 \
--gender 1
# createCheckout 指定类型与语言
node scripts/createCheckout.ts \
--email user@example.com \
--birth 1990-05-15T14:30 \
--type DEEP \
--gender 0 \
--locale en
# getReport 最小可用示例
node scripts/getReport.ts \
--profile-id profile_abc123
注意事项 / Notes
- All commands must be executed in this skill's root directory (the directory containing
SKILL.md) - Report ordering is a paid process; after the checkout is created successfully, directly send
payUrlfor the user to pay - After report payment is completed, it usually takes about 10 minutes until generation is complete; the actual duration is subject to the system generation progress
- Make decisions based only on script results: if the script exits with an error, it is a failure; if the script successfully outputs JSON, continue according to the fields
- When ordering,
--gendermust be explicitly provided by the user;--typecan be automatically mapped according to the semantics the user has clearly expressed (e.g., "deep report" =>DEEP, "2026 report/2026 fortune" =>YEAR2026). Ask again only when the type semantics are unclear, to avoid placing an incorrect order - If the user is still in the learning stage or has not clearly purchased, first guide them to the main site for information and experience:
https://cantian.ai - Customer support email:
support@cantian.ai - For interaction details (time ambiguity handling, multilingual replies, price wording, template replies), refer to "Execution Decision Flow / Execution Rules and Reply Templates"
执行决策流程 / Execution Flow
- Identify user intent:
下单、查进度/下载、咨询了解。 - If it is
下单: first collect the minimum required parameters (email、birth、type、gender); and prompt the user that the nickname can be set (nickname, optional).typeParsing rule: if the user has explicitly said "deep report/life love wealth health report", etc., directly handle it asDEEP; if they explicitly say "2026 report/2026 fortune", etc., directly handle it asYEAR2026; ask again about the type only when it is not mentioned or the expression is vague.
- The nickname is only an optional prompt and is not a blocking condition for placing an order; if the user does not provide it, you may continue directly.
- For
birth, perform an ambiguity check: if the user input is a time such as "5 o'clock/4 o'clock" without specifying the period, you must first ask again and have the user clarify "morning or afternoon" (or an equivalent period) before converting to 24-hour time (e.g.,05:00or17:00)。 - Execute
birth、type、genderonly aftercreateCheckoutare all clear; otherwise continue clarifying and do not place the order. - Execute
createCheckout, and read the output JSON; if the script fails, prompt the user according to the error message to correct it and retry. createCheckoutAfter success: returnpayUrland the key order information (the specific reply format follows the "Order Reply Template" below).- If it is
查进度/下载: executegetReport, and read the returned fields. paid=false: inform "No valid payment detected; payment must be completed first."- Independently determine
downloadPageUrl: If there is any value, you must return that link (which can lead to the download page); if there is no value, clearly state "There is currently no available download page link." - Independently determine
readyToDownload:trueand inform the user "The report has been generated and can be downloaded";falseand inform the user "The report is still being generated, please try again later." Do not treat this as a prerequisite for whether to return the download page link. - When
readyToDownload=false, you may add an expectation for timing: "After payment is completed, generation is usually completed in about 10 minutes; the actual time is subject to system progress." - If it is
咨询了解and the user has not explicitly placed an order: guide them tohttps://cantian.ai; after the user confirms the purchase, proceed to step 2. - When the user reports that the information is incorrect: do not reuse the old link; after correcting the parameters, re-execute
createCheckoutand return a newpayUrl。
Execution Rules & Reply Templates / 执行规则与回复模板
A) Machine Execution Rules / 机器执行规则
Reply rules after successful order placement (attach payment link directly):
- At the same time, display key information in clear text.
- The reply must follow the user's current conversation language; the template below is a Chinese example, and the actual output should be equivalently rewritten according to the user's language.
- Only display information items that "have values in this order and are of interest to the user"; do not display fields with no value (such as nickname/birthplace not provided).
- When collecting order parameters, directly collect the necessary fields and avoid explaining default information such as "you can directly enter the time" or "I will help you convert the format," unless the user proactively asks about the input format.
- When asking for a nickname, use a neutral phrasing (for example, "How would you like to be addressed in the report?"), and do not add explanations such as "optional/you may also not provide it."
- Only display "Nickname: {nicknameText}" when the user provides a nickname; if not provided, do not display this line.
- Only display "Birthplace: {locationText}" when the user provides a birthplace; if not provided, do not display this line.
- Only display "Additional information: The Zi hour rule is {sectText}" when the user explicitly mentions it or proactively sets the Zi hour rule; if not mentioned, do not display this line.
- The birth time display must use the 24-hour clock, and ambiguous expressions such as "X o'clock" must not be used alone. Recommended format:
YYYY-MM-DD HH:mm(for example2000-05-06 16:00)。 - If the conversation language is Chinese, a time period description may be added after the 24-hour clock (such as "4:00 PM"); if the two forms conflict, the 24-hour clock shall prevail.
- During the parameter collection stage, the user must not be asked to convert the birth time into a 24-hour string; it should be collected according to the user's original wording, and when necessary, explicitly ask "AM or PM?"
createCheckoutAfter success, you must reply using the "Order Reply Template" below, and do not change it to a confirmation-style question.- You must remind the user: if the information is incorrect, please do not pay; after the information is corrected, use the new link to pay.
- If the user asks about the price, uniformly explain: "The report price is $9.99; the final amount is subject to what is displayed on the payment page."
- For download/progress scenarios, use the "Download/Progress Reply Template" below; for status determination and link return rules, follow steps 8-11 of "Execution Flow / 执行决策流程."
- When the user has already clearly expressed the report type, do not ask them to choose between "BaZi In-Depth Report / 2026 Fortune Report"; only ask again when the type is unclear.
- In user-facing questions and replies, it is prohibited to expose internal enumeration values (such as
DEEP、YEAR2026); use only natural-language type names.
B) User Reply Templates
Order reply template (provide the payment link directly; the following are Chinese examples, but in practice output according to the user's language):
我已为你生成{reportTypeText}订单,关键信息如下:
- 出生时间:{birthText}
- 性别:{genderText}
- 昵称:{nicknameText}(未提供则不展示此行)
- 出生地:{locationText}(未提供则不展示此行)
- 接收邮箱:{email}
- 补充信息:子时规则为 {sectText}(仅在用户主动提及时展示)
请打开以下链接完成支付:
{payUrl}
支付完成后,报告会自动发送到邮箱。档案编号是 `{profileId}`,报告类型是 **{reportTypeText}**。
如需客服协助,请联系 `support@cantian.ai`。
Download/progress reply template (the following are Chinese examples, but in practice output according to the user's language):
支付状态:{paidText}
下载状态:{readyText}
下载页链接:{downloadPageUrlText}
补充说明:{downloadHintText}
For the field value formats:
{paidText}:paid=truewrite "valid payment detected";paid=falsewrite "no valid payment detected"{readyText}:readyToDownload=truewrite "downloadable";readyToDownload=falsewrite "generating"{reportTypeText}: use only the natural language type name;DEEPmaps to "Bazi Deep Report",YEAR2026maps to "2026 Fortune Report"; it is forbidden to show users the raw enum value{birthText}: must use 24-hour time. In Chinese, it is recommended to write2000-05-06 16:00(下午 4:00); in English, it is recommended to write2000-05-06 16:00 (4:00 PM); it is forbidden to write only "4点/4 o'clock"{downloadPageUrlText}: if there is a link, fill in the link; if there is no link, write "currently no available download link"{downloadHintText}(judge independently by field):downloadPageUrlhas a value andreadyToDownload=false: write "you can enter the download page to view progress; the download button may be temporarily unavailable"downloadPageUrlhas a value andreadyToDownload=true: write "you can enter the download page and download the report"downloadPageUrlhas no value: write "currently no available download page link, please try again later"
- When
readyToDownload=false, it is recommended to add a note about timing: "After payment is completed, generation is usually completed in about 10 minutes; the actual time is subject to the system progress"
Consultation-stage reply template (no clear order placed; the following are Chinese examples, but in practice output according to the user's language):
可以先到主站了解并体验:`https://cantian.ai`。如果你要继续购买报告,我可以直接帮你创建支付链接。需要人工协助可联系 `support@cantian.ai`。