@mongoui/skills 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/install.js +45 -1
- package/dist/products/index.js +9 -9
- package/package.json +1 -1
- package/skills/flink-flight-api/{flink-openapi-integration/SKILL.md → SKILL.md} +3 -3
- package/skills/flink-flight-api/agents/openai.yaml +4 -0
- package/skills/glink-hotel-api/SKILL.md +152 -0
- package/skills/glink-hotel-api/agents/openai.yaml +4 -0
- package/skills/glink-hotel-api/references/api-workflows.md +158 -0
- package/skills/glink-hotel-api/{glink-openapi-integration/references → references}/auth-and-credentials.md +14 -27
- package/skills/glink-hotel-api/references/endpoint-index.md +129 -0
- package/skills/glink-hotel-api/{glink-openapi-integration/scripts → scripts}/glink_signed_request.py +16 -5
- package/skills/flink-flight-api/flink-openapi-integration/agents/openai.yaml +0 -4
- package/skills/glink-hotel-api/glink-openapi-integration/SKILL.md +0 -75
- package/skills/glink-hotel-api/glink-openapi-integration/agents/openai.yaml +0 -4
- package/skills/glink-hotel-api/glink-openapi-integration/references/api-workflows.md +0 -110
- package/skills/glink-hotel-api/glink-openapi-integration/references/endpoint-index.md +0 -130
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/api-workflows.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/auth-and-credentials.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/references → references}/endpoint-index.md +0 -0
- /package/skills/flink-flight-api/{flink-openapi-integration/scripts → scripts}/flink_signed_request.py +0 -0
package/dist/commands/install.js
CHANGED
|
@@ -64,7 +64,10 @@ export async function runInstall(productName, options) {
|
|
|
64
64
|
}
|
|
65
65
|
await fs.access(sourceSkillFile);
|
|
66
66
|
const sourceSkillContent = await fs.readFile(sourceSkillFile, "utf8");
|
|
67
|
-
const
|
|
67
|
+
const bundledSkillContent = sourceSkillDir
|
|
68
|
+
? await buildBundledSkillContent(sourceSkillDir, sourceSkillContent)
|
|
69
|
+
: sourceSkillContent;
|
|
70
|
+
const targetSkillContent = renderInstalledContent(installTarget.tool, product.name, product.displayName, bundledSkillContent);
|
|
68
71
|
await fs.writeFile(targetSkillFile, targetSkillContent, "utf8");
|
|
69
72
|
console.log("Installed skill:");
|
|
70
73
|
console.log("- command: install");
|
|
@@ -135,3 +138,44 @@ async function copyDirectory(sourceDir, targetDir) {
|
|
|
135
138
|
await fs.copyFile(sourcePath, targetPath);
|
|
136
139
|
}
|
|
137
140
|
}
|
|
141
|
+
async function buildBundledSkillContent(sourceSkillDir, sourceSkillContent) {
|
|
142
|
+
const referencesDir = path.join(sourceSkillDir, "references");
|
|
143
|
+
const scriptsDir = path.join(sourceSkillDir, "scripts");
|
|
144
|
+
const referenceSections = await readBundledFiles(referencesDir, "markdown");
|
|
145
|
+
const scriptSections = await readBundledFiles(scriptsDir, "code");
|
|
146
|
+
const sections = [sourceSkillContent.trim()];
|
|
147
|
+
if (referenceSections.length > 0) {
|
|
148
|
+
sections.push("## Bundled References", ...referenceSections);
|
|
149
|
+
}
|
|
150
|
+
if (scriptSections.length > 0) {
|
|
151
|
+
sections.push("## Bundled Scripts", ...scriptSections);
|
|
152
|
+
}
|
|
153
|
+
return `${sections.join("\n\n")}\n`;
|
|
154
|
+
}
|
|
155
|
+
async function readBundledFiles(dirPath, mode) {
|
|
156
|
+
try {
|
|
157
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
158
|
+
const files = entries
|
|
159
|
+
.filter((entry) => entry.isFile())
|
|
160
|
+
.map((entry) => entry.name)
|
|
161
|
+
.sort((left, right) => left.localeCompare(right));
|
|
162
|
+
const sections = [];
|
|
163
|
+
for (const fileName of files) {
|
|
164
|
+
const filePath = path.join(dirPath, fileName);
|
|
165
|
+
const fileContent = await fs.readFile(filePath, "utf8");
|
|
166
|
+
if (mode === "markdown") {
|
|
167
|
+
sections.push(`### ${fileName}\n\n${fileContent.trim()}`);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const language = path.extname(fileName).replace(/^\./, "") || "text";
|
|
171
|
+
sections.push(`### ${fileName}\n\n\`\`\`${language}\n${fileContent.trim()}\n\`\`\``);
|
|
172
|
+
}
|
|
173
|
+
return sections;
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
if (error.code === "ENOENT") {
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
}
|
package/dist/products/index.js
CHANGED
|
@@ -2,20 +2,20 @@ const PRODUCTS = {
|
|
|
2
2
|
"glink-hotel-api": {
|
|
3
3
|
name: "glink-hotel-api",
|
|
4
4
|
displayName: "Glink Hotel API",
|
|
5
|
-
skillFile: "skills/glink-hotel-api/
|
|
6
|
-
skillDir: "skills/glink-hotel-api
|
|
5
|
+
skillFile: "skills/glink-hotel-api/SKILL.md",
|
|
6
|
+
skillDir: "skills/glink-hotel-api",
|
|
7
7
|
},
|
|
8
8
|
"flink-flight-api": {
|
|
9
9
|
name: "flink-flight-api",
|
|
10
10
|
displayName: "Flink Flight API",
|
|
11
|
-
skillFile: "skills/flink-flight-api/
|
|
12
|
-
skillDir: "skills/flink-flight-api
|
|
13
|
-
},
|
|
14
|
-
"tmc-whitelabel": {
|
|
15
|
-
name: "tmc-whitelabel",
|
|
16
|
-
displayName: "TMC Whitelabel",
|
|
17
|
-
skillFile: "skills/tmc-whitelabel/SKILL.md",
|
|
11
|
+
skillFile: "skills/flink-flight-api/SKILL.md",
|
|
12
|
+
skillDir: "skills/flink-flight-api",
|
|
18
13
|
},
|
|
14
|
+
// "tmc-whitelabel": {
|
|
15
|
+
// name: "tmc-whitelabel",
|
|
16
|
+
// displayName: "TMC Whitelabel",
|
|
17
|
+
// skillFile: "skills/tmc-whitelabel/SKILL.md",
|
|
18
|
+
// },
|
|
19
19
|
};
|
|
20
20
|
export function getProduct(productName) {
|
|
21
21
|
return PRODUCTS[productName];
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: flink-
|
|
3
|
-
description: Integrate with the Flink flight OpenAPI exposed through the Open Platform runtime gateway. Use when
|
|
2
|
+
name: flink-flight-api
|
|
3
|
+
description: Integrate with the Flink flight OpenAPI exposed through the Open Platform runtime gateway. Use when an AI coding assistant needs to read, verify, explain, test, or implement against `docs/swagger/flink-api.json` or Flink route code; choose Flink ticket endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or handle Chinese/English requests about Flink 机票 search, booking, payment, order detail, change, refund, airport, airline, nationality, and fields workflows.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Flink
|
|
6
|
+
# Flink Flight API Skill
|
|
7
7
|
|
|
8
8
|
## Quick Start
|
|
9
9
|
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: glink-hotel-api
|
|
3
|
+
description: Integrate with the Glink hotel OpenAPI exposed through the Open Platform runtime gateway. Use when Codex needs to read, verify, explain, test, or implement against `docs/swagger/glink-api.json` or Glink route code; choose Glink hotel endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or drive Chinese/English requests about Glink hotel static data, hotel search, hotel info, product detail, booking, payment, order, cancel, order status push/callback, checkout, invoice, and balance workflows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Glink OpenAPI Integration
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
Use this skill when the task is "call Glink through the open platform".
|
|
11
|
+
|
|
12
|
+
Start with the smallest current source that answers the request:
|
|
13
|
+
|
|
14
|
+
- Prefer the repository source of truth when it exists: `docs/swagger/glink-api.json`, route handlers, DTOs, and tests.
|
|
15
|
+
- Treat the current DHub shared document and `docs/swagger/glink-api.json` as the route source of truth; older bundled notes can be stale.
|
|
16
|
+
- Customer-facing explanations should use only our short interface paths such as `/search/destination`, `/booking/createOrder`, and `/order/orderDetail`.
|
|
17
|
+
- Read `references/auth-and-credentials.md` for signing, headers, key acquisition, reset, and auth troubleshooting.
|
|
18
|
+
- Read `references/api-workflows.md` for hotel search, booking, cancel, checkout, invoice, and balance workflows.
|
|
19
|
+
- Read `references/endpoint-index.md` for a compact endpoint map and platform-managed field caveats, then verify fragile fields against the current swagger or code.
|
|
20
|
+
- Use `scripts/glink_signed_request.py` to generate headers, inspect the canonical string, or send a signed request.
|
|
21
|
+
|
|
22
|
+
## Working Rules
|
|
23
|
+
|
|
24
|
+
Follow this workflow:
|
|
25
|
+
|
|
26
|
+
1. Confirm the environment: `sandbox` and `production` credentials are separate.
|
|
27
|
+
2. Confirm whether the user is asking for documentation, code changes, local smoke testing, or live API calls.
|
|
28
|
+
3. Confirm the interface path, for example `/search/destination` or `/booking/productDetails`.
|
|
29
|
+
4. Choose the integration mode before recommending a flow:
|
|
30
|
+
- Standard API Integration: for partners who build and maintain a local saleable hotel catalog and room mapping.
|
|
31
|
+
- Lightweight Integration Flow: for faster launch with destination-driven hotel discovery and less pre-synced catalog data.
|
|
32
|
+
5. Keep customer-facing docs and answers aligned to our short interface paths only, such as `/search/destination`, `/booking/productDetails`, and `/order/orderDetail`.
|
|
33
|
+
6. For actual gateway signing/calls, the runtime public path is the short path prefixed with `/openapi/v1/glink`. Keep that detail in tooling/auth guidance, not in customer workflow names.
|
|
34
|
+
7. Build the minimum valid request body from swagger/code first, using `references/endpoint-index.md` as navigation.
|
|
35
|
+
8. Sign the exact runtime public path, sorted query string, and raw body bytes with the platform secret.
|
|
36
|
+
9. Evaluate both HTTP status and response envelope `code`, not HTTP status alone.
|
|
37
|
+
|
|
38
|
+
When the user asks for the Open Platform Glink hotel onboarding or booking flow, choose one of these two approved integration modes and use the mandatory interface sets below.
|
|
39
|
+
|
|
40
|
+
## Standard API Integration
|
|
41
|
+
|
|
42
|
+
Mandatory interfaces:
|
|
43
|
+
|
|
44
|
+
| No. | Interface | Method | Path |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| 1 | Available Hotel ID List | POST | `/search/hotelIdList` |
|
|
47
|
+
| 2 | Query Hotel Basic Information | POST | `/hotel/detail` |
|
|
48
|
+
| 3 | Hotel Real-Time Product Query | POST | `/booking/productDetails` |
|
|
49
|
+
| 4 | Trial Booking / Availability Check | POST | `/booking/availabilityCheck` |
|
|
50
|
+
| 5 | Create Order | POST | `/booking/createOrder` |
|
|
51
|
+
| 6 | Order Payment | POST | `/booking/payOrder` |
|
|
52
|
+
| 7 | Cancel Order | POST | `/order/cancelOrder` |
|
|
53
|
+
| 8 | Order Detail Query | POST | `/order/orderDetail` |
|
|
54
|
+
|
|
55
|
+
Use this sequence by default:
|
|
56
|
+
|
|
57
|
+
1. Static bootstrap: `/search/hotelIdList` -> `/hotel/detail` for hotel/room static data, then persist local hotel and room mappings.
|
|
58
|
+
2. Optional foundational data: `/region/countries` and `/region/cities` can be used to build country/city mappings against the FCG hotel system.
|
|
59
|
+
3. Static maintenance: run `/hotel/increment`, then call `/hotel/detail` for changed hotel IDs and update or disconnect local mappings when needed.
|
|
60
|
+
4. List pricing: run `/hotel/lowestPrice` for mapped hotels as list-page display/reference data. The next 30 days of daily lowest prices are updated every day; recommend updating daily after 5:00 AM.
|
|
61
|
+
5. Detail pricing: call `/booking/productDetails` in real time when the customer enters the hotel detail or booking path. Before querying, check the local saleable hotel ID cache and skip hotels not in the saleable list. Prefer `bookType=1` products as bookable candidates.
|
|
62
|
+
6. Booking pre-check: when the user clicks Book, call `/booking/availabilityCheck` with the actual room count to confirm the product is bookable before entering the order form.
|
|
63
|
+
7. Submit order: call `/booking/availabilityCheck` again immediately before `/booking/createOrder`; if still bookable, call `/booking/createOrder`.
|
|
64
|
+
8. Payment and confirmation: after `/booking/createOrder`, call `/booking/payOrder` only after local customer payment succeeds or when the platform has decided the Glink order should be confirmed.
|
|
65
|
+
9. Confirmation result: treat `/notify/orderStatus` as the primary confirmation channel and make the callback idempotent. Use `/order/orderDetail` only as low-frequency compensation if no confirmation result is received.
|
|
66
|
+
10. Cancellation: call `/order/cancelOrder` for unpaid timeout such as 30 minutes or active customer cancellation. If the cancellation API returns success, update the local order and stop polling.
|
|
67
|
+
|
|
68
|
+
## Lightweight Integration Flow
|
|
69
|
+
|
|
70
|
+
Mandatory interfaces:
|
|
71
|
+
|
|
72
|
+
| No. | Interface | Method | Path |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| 1 | Destination Query | POST | `/search/destination` |
|
|
75
|
+
| 2 | Get Hotel Filter Conditions | POST | `/search/hotelFilters` |
|
|
76
|
+
| 3 | Query Hotel List by Destination | POST | `/search/hotelList` |
|
|
77
|
+
| 4 | Query Hotel Basic Information | POST | `/hotel/detail` |
|
|
78
|
+
| 5 | Query Hotel Basic Information Increment | POST | `/hotel/increment` |
|
|
79
|
+
| 6 | Query Hotel Images | POST | `/hotel/images` |
|
|
80
|
+
| 7 | Hotel Real-Time Product Query | POST | `/booking/productDetails` |
|
|
81
|
+
| 8 | Trial Booking / Availability Check | POST | `/booking/availabilityCheck` |
|
|
82
|
+
| 9 | Create Order | POST | `/booking/createOrder` |
|
|
83
|
+
| 10 | Order Payment | POST | `/booking/payOrder` |
|
|
84
|
+
| 11 | Cancel Order | POST | `/order/cancelOrder` |
|
|
85
|
+
| 12 | Order Detail Query | POST | `/order/orderDetail` |
|
|
86
|
+
| 13 | Order Status Push | POST | `/notify/orderStatus` |
|
|
87
|
+
|
|
88
|
+
Use this sequence by default:
|
|
89
|
+
|
|
90
|
+
1. Destination bootstrap: call `/search/destination` to obtain the destination ID.
|
|
91
|
+
2. Discovery: optionally call `/search/hotelFilters` for filter conditions, then call `/search/hotelList` with the destination ID to obtain matching hotels.
|
|
92
|
+
3. Display hydration: call `/hotel/detail` for hotel static information and `/hotel/images` for images used by the client.
|
|
93
|
+
4. Static maintenance: use `/hotel/increment` to discover changed hotel static information when local caching is used.
|
|
94
|
+
5. List pricing: optionally call `/hotel/lowestPrice` as list-page price reference when the product experience needs a stable starting price.
|
|
95
|
+
6. Detail pricing: call `/booking/productDetails` in real time when the customer enters the hotel detail or booking path. Prefer `bookType=1` products.
|
|
96
|
+
7. Booking pre-check: when the user clicks Book, call `/booking/availabilityCheck` with the actual room count before entering the order form.
|
|
97
|
+
8. Submit order: call `/booking/availabilityCheck` again immediately before `/booking/createOrder`; if still bookable, call `/booking/createOrder`.
|
|
98
|
+
9. Payment and confirmation: after `/booking/createOrder`, call `/booking/payOrder` only after local customer payment succeeds or when the platform has decided the Glink order should be confirmed.
|
|
99
|
+
10. Confirmation result: treat `/notify/orderStatus` as the primary confirmation channel and make the callback idempotent. Use `/order/orderDetail` only as low-frequency compensation if no confirmation result is received.
|
|
100
|
+
11. Cancellation: call `/order/cancelOrder` for unpaid timeout such as 30 minutes or active customer cancellation. If the cancellation API returns success, update the local order and stop polling.
|
|
101
|
+
|
|
102
|
+
## Mandatory Order Placement Flow
|
|
103
|
+
|
|
104
|
+
Use these calls for order placement in both integration modes:
|
|
105
|
+
|
|
106
|
+
1. `/hotel/lowestPrice`: Query the lowest price of mapped hotels as a reference for whether to display the hotel in the local hotel list.
|
|
107
|
+
2. `/booking/productDetails`: Called in real time when a customer enters the hotel details or booking path.
|
|
108
|
+
3. `/booking/availabilityCheck`: Validate whether a bookable product can be reserved, passing in the actual number of rooms to book.
|
|
109
|
+
4. `/booking/createOrder`: Called after trial booking passes and the local order is successfully created. It is recommended to perform another trial booking validation before calling.
|
|
110
|
+
5. `/booking/payOrder`: Called after the local customer pays successfully, or when the order needs confirmation, to notify FCG to process the order.
|
|
111
|
+
6. `/order/cancelOrder`: Called when the order is unpaid for 30 minutes or the customer actively cancels. If the interface returns success, update the local order and stop polling.
|
|
112
|
+
7. `/notify/orderStatus`: After payment notification, FCG processes the order and pushes the status. This callback must support idempotency.
|
|
113
|
+
8. `/order/orderDetail`: If no confirmation result is received after payment, periodic queries can be used as compensation. Frequent polling is unnecessary; stop querying once the order is confirmed or canceled.
|
|
114
|
+
|
|
115
|
+
## Do Not Violate
|
|
116
|
+
|
|
117
|
+
- Always send `X-OP-App-Key`, `X-OP-Timestamp`, `X-OP-Nonce`, and `X-OP-Sign`.
|
|
118
|
+
- Send only the business fields defined by our Open Platform swagger.
|
|
119
|
+
- For adapter code, keep internal route configuration and customer-facing interface paths clearly separated.
|
|
120
|
+
- Never invent credentials or secrets. Use explicit user-provided values or environment variables.
|
|
121
|
+
- Treat `code=SUCCESS` as success. Treat `code=SUPPLIER_BIZ_ERROR` as a business failure even if HTTP status is `200`.
|
|
122
|
+
- Keep timestamp skew within `+-5` minutes.
|
|
123
|
+
- Reuse of the same nonce under the same app key can trigger `NONCE_REPLAY`.
|
|
124
|
+
- If a swagger schema still shows Glink-managed fields as required, follow the route description first and omit those platform-managed internal fields from the client payload.
|
|
125
|
+
- If external reference material and the current swagger/code use different names, use our current short interface path as the source of truth.
|
|
126
|
+
- Do not frequently poll order status. Stop polling once the order is confirmed or canceled; rely on idempotent push/callback handling as the source of truth for confirmation progress.
|
|
127
|
+
- Do not query real-time products for hotels outside the cached saleable hotel list; it wastes integration quota and usually returns no useful sellable data.
|
|
128
|
+
- For Standard API Integration, recommend local saleable hotel cache maintenance. For Lightweight Integration Flow, recommend the smaller destination-driven flow unless the user explicitly needs full static catalog sync.
|
|
129
|
+
|
|
130
|
+
## Typical Requests
|
|
131
|
+
|
|
132
|
+
Use these patterns by default:
|
|
133
|
+
|
|
134
|
+
- Static data and filters: `/region/countries`, `/region/cities`, `/region/popularCities`, `/region/businesses`, `/region/districts`, `/region/pois`, and `/hotel/groupBrand`.
|
|
135
|
+
- Standard catalog sync: `/search/hotelIdList` -> `/hotel/detail`; maintain with `/hotel/increment` -> `/hotel/detail`.
|
|
136
|
+
- Lightweight discovery: `/search/destination` -> `/search/hotelFilters` -> `/search/hotelList` -> `/hotel/detail`/`/hotel/images` -> `/booking/productDetails`.
|
|
137
|
+
- Search and booking: `/hotel/lowestPrice` for list display/reference -> `/booking/productDetails` for hotel detail -> `/booking/availabilityCheck` -> optional second `/booking/availabilityCheck` -> `/booking/createOrder` -> `/booking/payOrder` -> order push/callback primary, `/order/orderDetail` as compensation.
|
|
138
|
+
- Order aftercare: `/order/cancelOrder`, order push/callback, `/order/orderDetail`, `/order/checkInDetail`, `/order/checkoutRequest`, `/order/checkoutDetail`.
|
|
139
|
+
- Finance: `/order/invoiceRequest`, `/order/invoiceInfo`, `/search/creditBalance`.
|
|
140
|
+
|
|
141
|
+
## Output Expectations
|
|
142
|
+
|
|
143
|
+
When answering or coding with this skill:
|
|
144
|
+
|
|
145
|
+
- Prefer concrete request examples over abstract summaries.
|
|
146
|
+
- Name the source used when the current swagger/code and bundled references disagree, but keep customer-facing answers on our short interface paths.
|
|
147
|
+
- State whether the recommendation follows Standard API Integration or Lightweight Integration Flow when giving onboarding advice.
|
|
148
|
+
- State which environment the credential belongs to.
|
|
149
|
+
- State whether the payload should contain only business fields.
|
|
150
|
+
- Call out Glink-managed field residue in the swagger when relevant.
|
|
151
|
+
- Call out auth failures with the likely root cause and the exact header or field to inspect.
|
|
152
|
+
- For code changes, keep internal Glink integration auth and platform gateway auth clearly separated.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Glink API Workflows
|
|
2
|
+
|
|
3
|
+
Source of truth:
|
|
4
|
+
|
|
5
|
+
- Current Open Platform route and payload source: `docs/swagger/glink-api.json`.
|
|
6
|
+
- Customer-facing explanations should use only our short interface paths, such as `/search/destination`, `/booking/createOrder`, and `/order/orderDetail`.
|
|
7
|
+
|
|
8
|
+
## Standard API Integration
|
|
9
|
+
|
|
10
|
+
Use this mode when the integrator will maintain a local saleable hotel catalog, hotel-room mapping, and daily price refresh jobs.
|
|
11
|
+
|
|
12
|
+
Mandatory interfaces:
|
|
13
|
+
|
|
14
|
+
| No. | Interface | Method | Path |
|
|
15
|
+
| --- | --- | --- | --- |
|
|
16
|
+
| 1 | Available Hotel ID List | POST | `/search/hotelIdList` |
|
|
17
|
+
| 2 | Query Hotel Basic Information | POST | `/hotel/detail` |
|
|
18
|
+
| 3 | Hotel Real-Time Product Query | POST | `/booking/productDetails` |
|
|
19
|
+
| 4 | Trial Booking / Availability Check | POST | `/booking/availabilityCheck` |
|
|
20
|
+
| 5 | Create Order | POST | `/booking/createOrder` |
|
|
21
|
+
| 6 | Order Payment | POST | `/booking/payOrder` |
|
|
22
|
+
| 7 | Cancel Order | POST | `/order/cancelOrder` |
|
|
23
|
+
| 8 | Order Detail Query | POST | `/order/orderDetail` |
|
|
24
|
+
|
|
25
|
+
## Static Data
|
|
26
|
+
|
|
27
|
+
Use these calls to build hotel search prerequisites:
|
|
28
|
+
|
|
29
|
+
- `/region/countries`
|
|
30
|
+
- `/region/cities`
|
|
31
|
+
- `/region/popularCities`
|
|
32
|
+
- `/region/districts`
|
|
33
|
+
- `/region/pois`
|
|
34
|
+
- `/region/businesses`
|
|
35
|
+
- `/hotel/groupBrand`
|
|
36
|
+
|
|
37
|
+
These APIs usually feed country/city selection, district filters, POI filters, business area filters, and brand filters.
|
|
38
|
+
|
|
39
|
+
For Standard API Integration, build local hotel and room mapping in this order:
|
|
40
|
+
|
|
41
|
+
1. `/search/hotelIdList`
|
|
42
|
+
- Fetch the account's saleable hotel ID list and cache it locally.
|
|
43
|
+
2. `/hotel/detail`
|
|
44
|
+
- Fetch hotel and room static data for the cached hotel IDs. Persist only the fields needed for local hotel and room mapping.
|
|
45
|
+
3. `/hotel/increment`
|
|
46
|
+
- Periodically fetch changed hotel IDs, including added, updated, or deleted hotels.
|
|
47
|
+
4. `/hotel/detail`
|
|
48
|
+
- Rehydrate changed hotel IDs and decide whether local mappings should be updated or disconnected.
|
|
49
|
+
5. `/hotel/lowestPrice`
|
|
50
|
+
- Refresh mapped-hotel starting prices daily, normally after 05:00.
|
|
51
|
+
|
|
52
|
+
## Lightweight Integration Flow
|
|
53
|
+
|
|
54
|
+
Use this mode when the user wants a faster launch with less up-front static sync and a destination-driven hotel discovery path.
|
|
55
|
+
|
|
56
|
+
Mandatory interfaces:
|
|
57
|
+
|
|
58
|
+
| No. | Interface | Method | Path |
|
|
59
|
+
| --- | --- | --- | --- |
|
|
60
|
+
| 1 | Destination Query | POST | `/search/destination` |
|
|
61
|
+
| 2 | Get Hotel Filter Conditions | POST | `/search/hotelFilters` |
|
|
62
|
+
| 3 | Query Hotel List by Destination | POST | `/search/hotelList` |
|
|
63
|
+
| 4 | Query Hotel Basic Information | POST | `/hotel/detail` |
|
|
64
|
+
| 5 | Query Hotel Basic Information Increment | POST | `/hotel/increment` |
|
|
65
|
+
| 6 | Query Hotel Images | POST | `/hotel/images` |
|
|
66
|
+
| 7 | Hotel Real-Time Product Query | POST | `/booking/productDetails` |
|
|
67
|
+
| 8 | Trial Booking / Availability Check | POST | `/booking/availabilityCheck` |
|
|
68
|
+
| 9 | Create Order | POST | `/booking/createOrder` |
|
|
69
|
+
| 10 | Order Payment | POST | `/booking/payOrder` |
|
|
70
|
+
| 11 | Cancel Order | POST | `/order/cancelOrder` |
|
|
71
|
+
| 12 | Order Detail Query | POST | `/order/orderDetail` |
|
|
72
|
+
| 13 | Order Status Push | POST | `/notify/orderStatus` |
|
|
73
|
+
|
|
74
|
+
Recommended sequence:
|
|
75
|
+
|
|
76
|
+
1. `/search/destination`
|
|
77
|
+
- Resolve the destination keyword into an Open Platform destination ID.
|
|
78
|
+
2. `/search/hotelFilters`
|
|
79
|
+
- Fetch filter conditions when the UI needs hotel filters.
|
|
80
|
+
3. `/search/hotelList`
|
|
81
|
+
- Search destination-based hotel results using the destination ID, stay dates, and optional filters.
|
|
82
|
+
4. `/hotel/detail` and optionally `/hotel/images`
|
|
83
|
+
- Read richer hotel details and media for client display after the hotel list returns candidates.
|
|
84
|
+
5. `/hotel/lowestPrice`
|
|
85
|
+
- Optional but useful for list-page price reference when the experience needs a stable starting-price display.
|
|
86
|
+
6. `/booking/productDetails`
|
|
87
|
+
- Query real-time sellable products for a selected hotel on the hotel detail or booking path.
|
|
88
|
+
7. `/booking/availabilityCheck`
|
|
89
|
+
- Run trial booking with the actual room count before final booking.
|
|
90
|
+
8. `/booking/createOrder`
|
|
91
|
+
- Create the order after trial booking succeeds. If the booking step is delayed, run `/booking/availabilityCheck` again first.
|
|
92
|
+
9. `/booking/payOrder`
|
|
93
|
+
- Notify payment status after local payment succeeds or when the platform decides the order should be confirmed.
|
|
94
|
+
|
|
95
|
+
Lightweight mode still benefits from small local caches:
|
|
96
|
+
|
|
97
|
+
- Cache destination lookup results from `/search/destination` when the same searches are repeated often.
|
|
98
|
+
- Keep the current hotel IDs from `/search/hotelList` or prior detail-page flows long enough to avoid wasteful duplicate quote traffic.
|
|
99
|
+
- Treat order push/callback as primary even in lightweight mode.
|
|
100
|
+
|
|
101
|
+
## Booking Flow
|
|
102
|
+
|
|
103
|
+
Use this sequence for both Standard API Integration and Lightweight Integration Flow:
|
|
104
|
+
|
|
105
|
+
1. `/booking/productDetails`
|
|
106
|
+
- Identify the exact sellable room and rate.
|
|
107
|
+
2. `/booking/availabilityCheck`
|
|
108
|
+
- Perform pre-booking validation with the actual room count. Use this before showing or entering the final order submission path.
|
|
109
|
+
3. `/booking/createOrder`
|
|
110
|
+
- Submit the order with guest, contact, amount, and price item details. When the local order has been created and is ready to submit, call `/booking/availabilityCheck` again first if there is any delay or state change risk.
|
|
111
|
+
4. `/booking/payOrder`
|
|
112
|
+
- Notify payment after local customer payment succeeds, or after the platform has decided the order should be confirmed.
|
|
113
|
+
5. `/notify/orderStatus`
|
|
114
|
+
- Treat the push/callback as the primary confirmation result channel. The receiver must be idempotent.
|
|
115
|
+
6. `/order/orderDetail`
|
|
116
|
+
- Use as low-frequency compensation only before final confirmation or cancellation. Do not keep polling confirmed or canceled orders.
|
|
117
|
+
|
|
118
|
+
Key order identifiers:
|
|
119
|
+
|
|
120
|
+
- `coOrderCode`: customer platform order number.
|
|
121
|
+
- `fcOrderCode`: FCG order number when available.
|
|
122
|
+
|
|
123
|
+
Prefer carrying both once they appear, because several aftercare APIs accept one or both.
|
|
124
|
+
|
|
125
|
+
## Order Aftercare
|
|
126
|
+
|
|
127
|
+
Use these calls after booking:
|
|
128
|
+
|
|
129
|
+
- `/order/cancelOrder`
|
|
130
|
+
- Cancel an order when policy permits, when the customer asks to cancel, or when the local unpaid timeout is reached, such as 30 minutes. If cancellation returns success, update the local order and do not continue polling for another push.
|
|
131
|
+
- `/notify/orderStatus`
|
|
132
|
+
- Required for order confirmation progress after `/booking/payOrder`; implement idempotency.
|
|
133
|
+
- `/order/checkInDetail`
|
|
134
|
+
- Read extended order or check-in related detail.
|
|
135
|
+
- `/order/checkoutRequest`
|
|
136
|
+
- Submit a checkout or refund-like aftercare request for an order.
|
|
137
|
+
- `/order/checkoutDetail`
|
|
138
|
+
- Query the checkout task by `taskOrderCode`.
|
|
139
|
+
|
|
140
|
+
## Finance
|
|
141
|
+
|
|
142
|
+
Use these calls for financial follow-up:
|
|
143
|
+
|
|
144
|
+
- `/order/invoiceRequest`
|
|
145
|
+
- Submit invoice information using business fields only.
|
|
146
|
+
- `/order/invoiceInfo`
|
|
147
|
+
- Query invoice status and invoice metadata after an invoice request.
|
|
148
|
+
- `/search/creditBalance`
|
|
149
|
+
- Read remaining credit balance.
|
|
150
|
+
|
|
151
|
+
## Business Handling Rules
|
|
152
|
+
|
|
153
|
+
- Do not treat HTTP `200` as enough; inspect `code`.
|
|
154
|
+
- Use only our short interface paths in customer-facing docs and workflows.
|
|
155
|
+
- Preserve FCG order identifiers from earlier responses instead of recomputing them.
|
|
156
|
+
- Keep local saleable hotel ID cache and hotel/room mappings current before pricing and booking.
|
|
157
|
+
- Avoid integration quota waste: skip `/booking/productDetails` for hotels not in the saleable hotel cache.
|
|
158
|
+
- Push/callback is primary for order confirmation; `/order/orderDetail` is only a compensation path and should not be frequent.
|
|
@@ -34,7 +34,7 @@ APP_KEY
|
|
|
34
34
|
Rules:
|
|
35
35
|
|
|
36
36
|
- Uppercase `METHOD`.
|
|
37
|
-
- Use the exact public request path, for example `/openapi/v1/glink/
|
|
37
|
+
- Use the exact runtime public request path. Customer-facing docs use short paths like `/region/businesses`; for actual signing, prefix with `/openapi/v1/glink`, for example `/openapi/v1/glink/region/businesses`.
|
|
38
38
|
- Sort query parameters by key and then value before joining them as `k=v&k2=v2`.
|
|
39
39
|
- Hash the raw request body bytes with SHA256 and use the lowercase hex digest.
|
|
40
40
|
- Use the request timestamp exactly as sent in `X-OP-Timestamp`.
|
|
@@ -49,28 +49,15 @@ Notes:
|
|
|
49
49
|
- Nonce must be unique for the same app key in a short time window.
|
|
50
50
|
- For empty bodies, hash the empty byte string.
|
|
51
51
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
Glink downstream authentication is handled by the runtime gateway.
|
|
52
|
+
## Request Body Rules
|
|
55
53
|
|
|
56
54
|
Client responsibilities:
|
|
57
55
|
|
|
58
|
-
- Send only business fields.
|
|
59
|
-
- Sign the public
|
|
60
|
-
|
|
61
|
-
Do not send:
|
|
62
|
-
|
|
63
|
-
- `partnerCode`
|
|
64
|
-
- `signature` or `sign` used by Glink downstream auth
|
|
65
|
-
- `requestType`
|
|
66
|
-
- Glink-side `timestamp`
|
|
67
|
-
- wrapper objects like `header` or `businessRequest`
|
|
68
|
-
|
|
69
|
-
Important exception handling:
|
|
56
|
+
- Send only the business fields shown by our Open Platform swagger.
|
|
57
|
+
- Sign the runtime public request path, not only the short interface path.
|
|
58
|
+
- Do not add wrapper objects or hidden integration fields that are not part of our public schema.
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
- The route description still says the platform fills those fields automatically.
|
|
73
|
-
- Prefer the route description and treat those fields as platform-managed downstream fields.
|
|
60
|
+
If a legacy schema still exposes an internal managed field, prefer the route description and current swagger examples. Do not ask the customer to send fields that are not part of the Open Platform public contract.
|
|
74
61
|
|
|
75
62
|
## Credential Acquisition
|
|
76
63
|
|
|
@@ -94,7 +81,7 @@ Important constraints:
|
|
|
94
81
|
|
|
95
82
|
- Sandbox and production credentials are separate and not interchangeable.
|
|
96
83
|
- Developers can see platform credentials only.
|
|
97
|
-
- Developers cannot see
|
|
84
|
+
- Developers cannot see internal integration secrets.
|
|
98
85
|
|
|
99
86
|
## How To View Or Reset Keys
|
|
100
87
|
|
|
@@ -110,10 +97,10 @@ Developer portal APIs:
|
|
|
110
97
|
|
|
111
98
|
Response fields that matter:
|
|
112
99
|
|
|
113
|
-
- `open_app_id`: the App Key to place into `X-OP-App-Key
|
|
114
|
-
- `open_secret_masked`: masked secret for display only
|
|
115
|
-
- `open_secret_version`: useful for rotation tracking
|
|
116
|
-
- `plain_open_secret`: returned only on first issuance or reset
|
|
100
|
+
- `open_app_id`: the App Key to place into `X-OP-App-Key`.
|
|
101
|
+
- `open_secret_masked`: masked secret for display only.
|
|
102
|
+
- `open_secret_version`: useful for rotation tracking.
|
|
103
|
+
- `plain_open_secret`: returned only on first issuance or reset.
|
|
117
104
|
|
|
118
105
|
Practical guidance:
|
|
119
106
|
|
|
@@ -142,7 +129,7 @@ The platform wraps business responses in a common envelope:
|
|
|
142
129
|
{
|
|
143
130
|
"request_id": "req_xxx",
|
|
144
131
|
"trace_id": "trc_xxx",
|
|
145
|
-
"downstream_request_id": "
|
|
132
|
+
"downstream_request_id": "dreq_xxx",
|
|
146
133
|
"code": "SUCCESS",
|
|
147
134
|
"message": "ok",
|
|
148
135
|
"data": {}
|
|
@@ -152,6 +139,6 @@ The platform wraps business responses in a common envelope:
|
|
|
152
139
|
Interpretation:
|
|
153
140
|
|
|
154
141
|
- `request_id` and `trace_id` are platform-side tracing keys.
|
|
155
|
-
- `downstream_request_id` is
|
|
142
|
+
- `downstream_request_id` is a platform response field used for cross-system tracing when available.
|
|
156
143
|
- `code=SUCCESS` means the business call succeeded.
|
|
157
|
-
- `code=SUPPLIER_BIZ_ERROR` means
|
|
144
|
+
- `code=SUPPLIER_BIZ_ERROR` means the business call failed after reaching the hotel integration and can still arrive with HTTP `200`.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Glink Endpoint Index
|
|
2
|
+
|
|
3
|
+
Source of truth: current DHub / `docs/swagger/glink-api.json`.
|
|
4
|
+
|
|
5
|
+
All routes below are customer-facing short interface paths. For actual gateway calls and signing, prefix them with `/openapi/v1/glink`.
|
|
6
|
+
|
|
7
|
+
Customer-facing explanations should use only short interface paths such as `/search/destination`.
|
|
8
|
+
|
|
9
|
+
Integration mode shortcuts:
|
|
10
|
+
|
|
11
|
+
- Standard API Integration: prefer `/search/hotelIdList` -> `/hotel/detail` -> `/hotel/increment` and maintain local saleable hotel mappings.
|
|
12
|
+
- Lightweight Integration Flow: prefer `/search/destination` -> `/search/hotelFilters` -> `/search/hotelList` -> `/hotel/detail`/`/hotel/images` -> `/booking/productDetails` for faster launch.
|
|
13
|
+
|
|
14
|
+
## Region Static Data
|
|
15
|
+
|
|
16
|
+
- `/region/countries`
|
|
17
|
+
- Method: `POST`
|
|
18
|
+
- Required body fields: none.
|
|
19
|
+
- `/region/cities`
|
|
20
|
+
- Method: `POST`
|
|
21
|
+
- Common body fields: `countryCode`, `language`, `dataType`.
|
|
22
|
+
- `/region/popularCities`
|
|
23
|
+
- Method: `POST`
|
|
24
|
+
- Required body fields: none.
|
|
25
|
+
- `/region/businesses`
|
|
26
|
+
- Method: `POST`
|
|
27
|
+
- Common body fields: `cityCode`, `language`.
|
|
28
|
+
- `/region/districts`
|
|
29
|
+
- Method: `POST`
|
|
30
|
+
- Common body fields: `cityCode`, `language`.
|
|
31
|
+
- `/region/pois`
|
|
32
|
+
- Method: `POST`
|
|
33
|
+
- Common body fields: `cityCode`, `keyword`, `language`.
|
|
34
|
+
|
|
35
|
+
## Hotel Info
|
|
36
|
+
|
|
37
|
+
- `/search/hotelIdList`
|
|
38
|
+
- Method: `POST`
|
|
39
|
+
- Common body fields: `cityCode`.
|
|
40
|
+
- Use for saleable hotel ID bootstrap and cache refresh.
|
|
41
|
+
- `/hotel/detail`
|
|
42
|
+
- Method: `POST`
|
|
43
|
+
- Required body fields: `hotelIds`.
|
|
44
|
+
- `/hotel/increment`
|
|
45
|
+
- Method: `POST`
|
|
46
|
+
- Common body fields: `startTime`, `endTime`, `maxId`, `pageSize`.
|
|
47
|
+
- `/hotel/lowestPrice`
|
|
48
|
+
- Method: `POST`
|
|
49
|
+
- Common body fields: `hotelIds`, `checkInDate`, `checkOutDate`, `checkInType`.
|
|
50
|
+
- `/hotel/images`
|
|
51
|
+
- Method: `POST`
|
|
52
|
+
- Common body fields: `hotelIds` or `hotelId`; verify the current swagger example before strict DTO generation.
|
|
53
|
+
- `/hotel/groupBrand`
|
|
54
|
+
- Method: `POST`
|
|
55
|
+
- Required body fields: none.
|
|
56
|
+
|
|
57
|
+
## Search And Booking
|
|
58
|
+
|
|
59
|
+
- `/search/destination`
|
|
60
|
+
- Method: `POST`
|
|
61
|
+
- Common body fields: `keyWord`, `cityCode`, `destinationType`, `source`.
|
|
62
|
+
- `/search/hotelFilters`
|
|
63
|
+
- Method: `POST`
|
|
64
|
+
- Common body fields: `destinationId`, `destinationType`, `language`, `lngGoogle`, `latGoogle`, `lngBaidu`, `latBaidu`, `dataType`, `distance`.
|
|
65
|
+
- `/search/hotelList`
|
|
66
|
+
- Method: `POST`
|
|
67
|
+
- Common body fields: `destinationId`, `destinationType`, `lngGoogle`, `latGoogle`, `lngBaidu`, `latBaidu`, `checkInDate`, `checkOutDate`, filters.
|
|
68
|
+
- `/booking/productDetails`
|
|
69
|
+
- Method: `POST`
|
|
70
|
+
- Required body fields: `hotelId`, `checkInDate`, `checkOutDate`, `roomNum`, `numberOfAdults`.
|
|
71
|
+
- `/booking/availabilityCheck`
|
|
72
|
+
- Method: `POST`
|
|
73
|
+
- Required body fields: `hotelId`, `roomId`, `ratePlanId`, `checkInDate`, `checkOutDate`, `roomNum`, `supplyCode`.
|
|
74
|
+
- `/booking/createOrder`
|
|
75
|
+
- Method: `POST`
|
|
76
|
+
- Required body fields: `hotelId`, `roomId`, `ratePlanId`, `checkInDate`, `checkOutDate`, `roomNum`, `supplyCode`, `totalAmount`, `coOrderCode`, `priceItems`, `guestInfos`, `linkMan`, `linkPhone`, `arriveTime`, `latestArriveTime`.
|
|
77
|
+
- `/booking/payOrder`
|
|
78
|
+
- Method: `POST`
|
|
79
|
+
- Common body fields: `coOrderCode`, `fcOrderCode`.
|
|
80
|
+
- `/search/creditBalance`
|
|
81
|
+
- Method: `POST`
|
|
82
|
+
- Required body fields: none; send `{}` or omit body according to the SDK/runtime caller.
|
|
83
|
+
|
|
84
|
+
## Order Info
|
|
85
|
+
|
|
86
|
+
- `/order/orderDetail`
|
|
87
|
+
- Method: `POST`
|
|
88
|
+
- Common body fields: `coOrderCode`, `fcOrderCode`.
|
|
89
|
+
- `/order/cancelOrder`
|
|
90
|
+
- Method: `POST`
|
|
91
|
+
- Common body fields: `coOrderCode`, `fcOrderCode`, `cancelReson`.
|
|
92
|
+
- `/order/checkInDetail`
|
|
93
|
+
- Method: `POST`
|
|
94
|
+
- Common body fields: `coOrderCode`, `fcOrderCode`.
|
|
95
|
+
- `/order/invoiceRequest`
|
|
96
|
+
- Method: `POST`
|
|
97
|
+
- Business fields to focus on: `orderCode`, `invoiceTypeInteger`, `invoiceHeader`, `amount`, `applyId`, `invoiceTitleType`, `getMethod`.
|
|
98
|
+
- `/order/invoiceInfo`
|
|
99
|
+
- Method: `POST`
|
|
100
|
+
- Common body fields: `coOrderCode` or `fcOrderCode`.
|
|
101
|
+
- `/order/checkoutRequest`
|
|
102
|
+
- Method: `POST`
|
|
103
|
+
- Required body fields: `fcOrderCode`, `supplierRefundNumber`, `checkoutReason`, `refundType`, `checkoutRooms`.
|
|
104
|
+
- `/order/checkoutDetail`
|
|
105
|
+
- Method: `POST`
|
|
106
|
+
- Common body fields: `taskOrderCode`, `coOrderCode`, `fcOrderCode`; verify current swagger example before strict DTO generation.
|
|
107
|
+
|
|
108
|
+
## Callback Capabilities
|
|
109
|
+
|
|
110
|
+
- `/notify/orderStatus`
|
|
111
|
+
- Method: `POST`
|
|
112
|
+
- Order status push/callback. The receiver must be idempotent.
|
|
113
|
+
- `/notify/orderOperate`
|
|
114
|
+
- Method: `POST`
|
|
115
|
+
- Order operation push/callback. The receiver must be idempotent.
|
|
116
|
+
- `/notify/orderCheckout`
|
|
117
|
+
- Method: `POST`
|
|
118
|
+
- Checkout status push/callback. The receiver must be idempotent.
|
|
119
|
+
- `/notify/orderInvoice`
|
|
120
|
+
- Method: `POST`
|
|
121
|
+
- Invoice status push/callback. The receiver must be idempotent.
|
|
122
|
+
|
|
123
|
+
## Global Notes
|
|
124
|
+
|
|
125
|
+
- Current Glink swagger route count may include outbound request APIs and callback APIs; verify against `docs/swagger/glink-api.json`.
|
|
126
|
+
- Most Glink routes accept plain business JSON bodies with no wrapper objects.
|
|
127
|
+
- Platform error responses can return `401`, `403`, `404`, `500`, `502`, or `504`.
|
|
128
|
+
- Common auth-related `401` codes are `APP_KEY_INVALID`, `SIGN_ERROR`, `TIMESTAMP_EXPIRED`, and `NONCE_REPLAY`.
|
|
129
|
+
- Common `403` cause is `PRODUCT_FORBIDDEN`.
|
package/skills/glink-hotel-api/{glink-openapi-integration/scripts → scripts}/glink_signed_request.py
RENAMED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
Examples:
|
|
5
5
|
python scripts/glink_signed_request.py ^
|
|
6
6
|
--method POST ^
|
|
7
|
-
--path /
|
|
7
|
+
--path /region/businesses ^
|
|
8
8
|
--body-json "{\"language\":\"zh-CN\",\"cityCode\":\"1\"}" ^
|
|
9
9
|
--app-key open_app_xxx ^
|
|
10
10
|
--app-secret sk_xxx
|
|
11
11
|
|
|
12
12
|
python scripts/glink_signed_request.py ^
|
|
13
13
|
--method POST ^
|
|
14
|
-
--path /
|
|
14
|
+
--path /search/creditBalance ^
|
|
15
15
|
--body-json "{}" ^
|
|
16
16
|
--app-key open_app_xxx ^
|
|
17
17
|
--app-secret sk_xxx ^
|
|
@@ -32,11 +32,21 @@ import urllib.request
|
|
|
32
32
|
import uuid
|
|
33
33
|
from pathlib import Path
|
|
34
34
|
|
|
35
|
+
GATEWAY_PREFIX = "/openapi/v1/glink"
|
|
36
|
+
|
|
35
37
|
|
|
36
38
|
def sha256_hex(data: bytes) -> str:
|
|
37
39
|
return hashlib.sha256(data).hexdigest()
|
|
38
40
|
|
|
39
41
|
|
|
42
|
+
def normalize_path(path: str) -> str:
|
|
43
|
+
if not path.startswith("/"):
|
|
44
|
+
path = f"/{path}"
|
|
45
|
+
if path == GATEWAY_PREFIX or path.startswith(f"{GATEWAY_PREFIX}/"):
|
|
46
|
+
return path
|
|
47
|
+
return f"{GATEWAY_PREFIX}{path}"
|
|
48
|
+
|
|
49
|
+
|
|
40
50
|
def parse_query_items(items: list[str]) -> list[tuple[str, str]]:
|
|
41
51
|
pairs: list[tuple[str, str]] = []
|
|
42
52
|
for item in items:
|
|
@@ -124,7 +134,7 @@ def main() -> int:
|
|
|
124
134
|
parser = argparse.ArgumentParser(description="Generate or send a signed Glink open-platform request.")
|
|
125
135
|
parser.add_argument("--base-url", default=os.getenv("OPEN_PLATFORM_BASE_URL", "http://127.0.0.1:8671"))
|
|
126
136
|
parser.add_argument("--method", required=True)
|
|
127
|
-
parser.add_argument("--path", required=True)
|
|
137
|
+
parser.add_argument("--path", required=True, help="Short interface path, such as /search/destination; full gateway paths are also accepted")
|
|
128
138
|
parser.add_argument("--query", action="append", default=[], help="Repeatable key=value query parameter")
|
|
129
139
|
parser.add_argument("--body-json", help="JSON string request body")
|
|
130
140
|
parser.add_argument("--body-file", help="Path to a raw request body file")
|
|
@@ -143,6 +153,7 @@ def main() -> int:
|
|
|
143
153
|
try:
|
|
144
154
|
query_pairs = parse_query_items(args.query)
|
|
145
155
|
body_bytes = load_body(args)
|
|
156
|
+
runtime_path = normalize_path(args.path)
|
|
146
157
|
except Exception as exc:
|
|
147
158
|
print(str(exc), file=sys.stderr)
|
|
148
159
|
return 2
|
|
@@ -150,7 +161,7 @@ def main() -> int:
|
|
|
150
161
|
query_string = canonical_query(query_pairs)
|
|
151
162
|
payload = build_sign_payload(
|
|
152
163
|
method=args.method,
|
|
153
|
-
path=
|
|
164
|
+
path=runtime_path,
|
|
154
165
|
query_string=query_string,
|
|
155
166
|
body_bytes=body_bytes,
|
|
156
167
|
timestamp=args.timestamp,
|
|
@@ -159,7 +170,7 @@ def main() -> int:
|
|
|
159
170
|
)
|
|
160
171
|
signature = sign(args.app_secret, payload)
|
|
161
172
|
headers = build_headers(args.app_key, args.timestamp, args.nonce, signature, bool(body_bytes))
|
|
162
|
-
url = build_url(args.base_url,
|
|
173
|
+
url = build_url(args.base_url, runtime_path, query_string)
|
|
163
174
|
|
|
164
175
|
print("URL:")
|
|
165
176
|
print(url)
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: glink-openapi-integration
|
|
3
|
-
description: Integrate with the Glink hotel OpenAPI exposed through the Open Platform runtime gateway. Use when Codex needs to read, verify, explain, test, or implement against `docs/swagger/glink-api.json` or Glink route code; choose Glink hotel endpoints; generate or debug `X-OP-*` signatures; explain sandbox or production credential issuance/reset; or drive Chinese/English requests about Glink 酒店 static data, hotel search, hotel info, product detail, booking, payment, order, cancel, order status push/callback, checkout, invoice, and balance workflows.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Glink OpenAPI Integration
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
Use this skill when the task is "call Glink through the open platform".
|
|
11
|
-
|
|
12
|
-
Start with the smallest current source that answers the request:
|
|
13
|
-
|
|
14
|
-
- Prefer the repository source of truth when it exists: `docs/swagger/glink-api.json`, route handlers, DTOs, and tests.
|
|
15
|
-
- Read `references/auth-and-credentials.md` for signing, headers, key acquisition, reset, and auth troubleshooting.
|
|
16
|
-
- Read `references/api-workflows.md` for hotel search, booking, cancel, checkout, invoice, and balance workflows.
|
|
17
|
-
- Read `references/endpoint-index.md` for a compact endpoint map and platform-managed field caveats, then verify fragile fields against the current swagger or code.
|
|
18
|
-
- Use `scripts/glink_signed_request.py` to generate headers, inspect the canonical string, or send a signed request.
|
|
19
|
-
|
|
20
|
-
## Working Rules
|
|
21
|
-
|
|
22
|
-
Follow this workflow:
|
|
23
|
-
|
|
24
|
-
1. Confirm the environment: `sandbox` and `production` credentials are separate.
|
|
25
|
-
2. Confirm whether the user is asking for documentation, code changes, local smoke testing, or live API calls.
|
|
26
|
-
3. Confirm the public path under `/openapi/v1/glink/*`.
|
|
27
|
-
4. Build the minimum valid request body from swagger/code first, using `references/endpoint-index.md` as navigation.
|
|
28
|
-
5. Sign the exact public path, sorted query string, and raw body bytes with the platform secret.
|
|
29
|
-
6. Evaluate both HTTP status and response envelope `code`, not HTTP status alone.
|
|
30
|
-
|
|
31
|
-
When the user asks for the Open Platform Glink hotel onboarding or booking flow, apply this required sequence:
|
|
32
|
-
|
|
33
|
-
1. Static bootstrap: `queryCityList` -> `queryHotelIdList` by city -> `queryHotelInfo` for hotel/room static data, then persist mapping locally.
|
|
34
|
-
2. Static maintenance: run `queryHotelIncrement`, then call `queryHotelInfo` for changed hotel IDs and update or disconnect local mappings when needed.
|
|
35
|
-
3. List pricing: run `queryHotelLowestPrice` for mapped hotels, normally as a daily job after the Glink price refresh window, and use it as list-page display/reference data.
|
|
36
|
-
4. Detail pricing: before `queryProductDetail`, check the local saleable hotel ID cache; skip hotels not in the saleable list. Use `bookType=1` products as bookable candidates.
|
|
37
|
-
5. Booking: call `checkBooking` with the actual room count before entering or submitting the order flow; call it again before `createOrder` when the local order is ready.
|
|
38
|
-
6. Payment and confirmation: after `createOrder`, call `payOrder` only after local customer payment succeeds or the platform has decided the Glink order should be confirmed.
|
|
39
|
-
7. Confirmation result: treat Glink order operation push/callback as primary and idempotent; use `queryOrderDetail` only as low-frequency compensation before final confirmation or cancellation.
|
|
40
|
-
8. Cancellation: call `cancelOrder` for unpaid timeout such as 30 minutes or customer cancellation. If the cancellation API returns success, update the local order and do not keep polling for another status push.
|
|
41
|
-
|
|
42
|
-
Do not violate these rules:
|
|
43
|
-
|
|
44
|
-
- Always send `X-OP-App-Key`, `X-OP-Timestamp`, `X-OP-Nonce`, and `X-OP-Sign`.
|
|
45
|
-
- Never send Glink-side `partnerCode`, `signature`, `requestType`, or Glink-side `timestamp`.
|
|
46
|
-
- Never wrap the payload in Glink-style `header` or `businessRequest`; send only business fields.
|
|
47
|
-
- Never invent credentials or secrets. Use explicit user-provided values or environment variables.
|
|
48
|
-
- Treat `code=SUCCESS` as success. Treat `code=SUPPLIER_BIZ_ERROR` as a business failure even if HTTP status is `200`.
|
|
49
|
-
- Keep timestamp skew within `+-5` minutes.
|
|
50
|
-
- Reuse of the same nonce under the same app key can trigger `NONCE_REPLAY`.
|
|
51
|
-
- If a swagger schema still shows Glink-managed fields as required, follow the route description first and omit those platform-managed downstream fields from the client payload.
|
|
52
|
-
- Do not frequently poll order status. Stop polling once the order is confirmed or canceled; rely on idempotent push/callback handling as the source of truth for confirmation progress.
|
|
53
|
-
- Do not query real-time products for hotels outside the cached saleable hotel list; it wastes integration quota and usually returns no useful sellable data.
|
|
54
|
-
|
|
55
|
-
## Typical Requests
|
|
56
|
-
|
|
57
|
-
Use these patterns by default:
|
|
58
|
-
|
|
59
|
-
- Static data: city, country, district, business area, and brand lookup calls
|
|
60
|
-
- Catalog sync: `queryCityList` -> `queryHotelIdList` -> `queryHotelInfo`; maintain with `queryHotelIncrement` -> `queryHotelInfo`
|
|
61
|
-
- Search and booking: mapped saleable hotel IDs -> `queryHotelLowestPrice` for list display -> `queryProductDetail` for hotel detail -> `checkBooking` -> optional second `checkBooking` -> `createOrder` -> `payOrder` -> order push/callback primary, `queryOrderDetail` as compensation
|
|
62
|
-
- Order aftercare: `cancelOrder`, Glink order push/callback, `queryOrderDetail`, `queryOrderCheckDetailInfo`, `checkoutApply`, `queryCheckoutDetail`
|
|
63
|
-
- Finance: `createInvoice`, `queryCreditBalance`
|
|
64
|
-
|
|
65
|
-
## Output Expectations
|
|
66
|
-
|
|
67
|
-
When answering or coding with this skill:
|
|
68
|
-
|
|
69
|
-
- Prefer concrete request examples over abstract summaries.
|
|
70
|
-
- Name the source used when the current swagger/code and bundled references disagree.
|
|
71
|
-
- State which environment the credential belongs to.
|
|
72
|
-
- State whether the payload should contain only business fields.
|
|
73
|
-
- Call out Glink-managed field residue in the swagger when relevant.
|
|
74
|
-
- Call out auth failures with the likely root cause and the exact header or field to inspect.
|
|
75
|
-
- For code changes, keep Glink downstream auth and platform gateway auth clearly separated.
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# Glink API Workflows
|
|
2
|
-
|
|
3
|
-
## Static Data
|
|
4
|
-
|
|
5
|
-
Use these calls to build hotel search prerequisites:
|
|
6
|
-
|
|
7
|
-
- `glink.queryCountryList`
|
|
8
|
-
- `glink.queryCityList`
|
|
9
|
-
- `glink.queryHotCityList`
|
|
10
|
-
- `glink.queryDistrictList`
|
|
11
|
-
- `glink.queryDistrictAndBusiness`
|
|
12
|
-
- `glink.queryBusinessList`
|
|
13
|
-
- `glink.queryHotelPlateList`
|
|
14
|
-
- `glink.queryCityAndHotelByKeyword`
|
|
15
|
-
|
|
16
|
-
These APIs usually feed city selection, district filters, brand filters, and keyword suggestions.
|
|
17
|
-
|
|
18
|
-
For the required Open Platform Glink onboarding flow, build local hotel and room mapping in this order:
|
|
19
|
-
|
|
20
|
-
1. `glink.queryCityList`
|
|
21
|
-
- Get Glink city codes used by the platform hotel flow.
|
|
22
|
-
2. `glink.queryHotelIdList`
|
|
23
|
-
- Use the city code to fetch the account's saleable hotel ID list and cache it locally.
|
|
24
|
-
3. `glink.queryHotelInfo`
|
|
25
|
-
- Fetch hotel and room static data for the cached hotel IDs. Persist only the fields needed for local hotel and room mapping.
|
|
26
|
-
4. `glink.queryHotelIncrement`
|
|
27
|
-
- Periodically fetch changed hotel IDs, including added, updated, or deleted hotels.
|
|
28
|
-
5. `glink.queryHotelInfo`
|
|
29
|
-
- Rehydrate changed hotel IDs and decide whether local mappings should be updated or disconnected.
|
|
30
|
-
|
|
31
|
-
## Hotel Search And Product Selection
|
|
32
|
-
|
|
33
|
-
Use this sequence for discovery and pricing:
|
|
34
|
-
|
|
35
|
-
1. `glink.getDestination` or `glink.queryCityAndHotelByKeyword`
|
|
36
|
-
- Resolve the destination or keyword to a city or hotel scope.
|
|
37
|
-
2. `glink.getHotelSearch` or `glink.findHotelList`
|
|
38
|
-
- Search hotels using city, dates, room count, and optional filters.
|
|
39
|
-
3. `glink.queryHotelLowestPrice`
|
|
40
|
-
- Pull summary pricing for selected hotel IDs.
|
|
41
|
-
4. `glink.queryProductDetail`
|
|
42
|
-
- Read real-time sellable products for a selected hotel and stay range.
|
|
43
|
-
5. `glink.queryHotelInfo`, `glink.queryHotelImage`, or `glink.queryHotelMainInfoByHotelIds`
|
|
44
|
-
- Hydrate hotel details for display or validation.
|
|
45
|
-
|
|
46
|
-
Use `queryHotelAllList`, `queryHotelIdList`, and `queryHotelIncrement` when synchronizing hotel catalogs rather than serving live booking UX.
|
|
47
|
-
|
|
48
|
-
For the Open Platform Glink flow, prefer the local mapped catalog over broad live search during booking:
|
|
49
|
-
|
|
50
|
-
- Use `glink.queryHotelLowestPrice` for mapped hotels to refresh daily starting prices. It is list-page reference/display data and should normally be refreshed once daily after the Glink price refresh window, for example after 05:00.
|
|
51
|
-
- Before calling `glink.queryProductDetail`, verify that the hotel is still in the cached saleable hotel ID list. Do not query products for hotels outside the saleable list.
|
|
52
|
-
- Use `glink.queryProductDetail` when the customer enters a hotel detail or booking path. Treat products with `bookType=1` as bookable candidates, then confirm with `checkBooking`.
|
|
53
|
-
|
|
54
|
-
## Booking Flow
|
|
55
|
-
|
|
56
|
-
Use this sequence for a normal hotel booking flow:
|
|
57
|
-
|
|
58
|
-
1. `glink.queryProductDetail`
|
|
59
|
-
- Identify the exact sellable room and rate.
|
|
60
|
-
2. `glink.checkBooking`
|
|
61
|
-
- Perform pre-booking validation with the actual room count. Use this before showing or entering the final order submission path.
|
|
62
|
-
3. `glink.createOrder`
|
|
63
|
-
- Submit the order with guest, contact, amount, and price item details. When the local order has been created and is ready to submit, call `checkBooking` again first if there is any delay or state change risk.
|
|
64
|
-
4. `glink.payOrder`
|
|
65
|
-
- Notify Glink after local customer payment succeeds, or after the platform has decided the Glink order should be confirmed.
|
|
66
|
-
5. Glink order operation push/callback
|
|
67
|
-
- Treat the push/callback as the primary confirmation result channel. The receiver must be idempotent.
|
|
68
|
-
6. `glink.queryOrderDetail`
|
|
69
|
-
- Use as low-frequency compensation only before final confirmation or cancellation. Do not keep polling confirmed or canceled orders.
|
|
70
|
-
|
|
71
|
-
Key order identifiers:
|
|
72
|
-
|
|
73
|
-
- `coOrderCode`: your platform-side order number
|
|
74
|
-
- `fcOrderCode`: Glink-side order number when available
|
|
75
|
-
|
|
76
|
-
Prefer carrying both once they appear, because several aftercare APIs accept one or both.
|
|
77
|
-
|
|
78
|
-
## Order Aftercare
|
|
79
|
-
|
|
80
|
-
Use these calls after booking:
|
|
81
|
-
|
|
82
|
-
- `glink.cancelOrder`
|
|
83
|
-
- Cancel an order when policy permits, when the customer asks to cancel, or when the local unpaid timeout is reached, such as 30 minutes. If cancellation returns success, update the local order and do not continue polling for another push.
|
|
84
|
-
- Glink order operation push/callback
|
|
85
|
-
- This is required for order confirmation progress after `payOrder`. It may not appear as a public `/openapi/v1/glink/*` request route in swagger because it is an inbound callback capability; inspect platform callback route code before implementing.
|
|
86
|
-
- `glink.queryOrderCheckDetailInfo`
|
|
87
|
-
- Read extended order or check-in related detail.
|
|
88
|
-
- `glink.checkoutApply`
|
|
89
|
-
- Submit a checkout or refund-like aftercare request for an order.
|
|
90
|
-
- `glink.queryCheckoutDetail`
|
|
91
|
-
- Query the checkout task by `taskOrderCode`.
|
|
92
|
-
|
|
93
|
-
## Finance
|
|
94
|
-
|
|
95
|
-
Use these calls for financial follow-up:
|
|
96
|
-
|
|
97
|
-
- `glink.createInvoice`
|
|
98
|
-
- Submit invoice information using business fields only.
|
|
99
|
-
- Ignore Glink-managed `partnerCode` and `sign` even if they appear in the swagger schema.
|
|
100
|
-
- `glink.queryCreditBalance`
|
|
101
|
-
- Read remaining credit balance.
|
|
102
|
-
|
|
103
|
-
## Business Handling Rules
|
|
104
|
-
|
|
105
|
-
- Do not treat HTTP `200` as enough; inspect `code`.
|
|
106
|
-
- Do not rebuild Glink headers or wrapper payloads; the runtime gateway handles downstream authentication and wrapping.
|
|
107
|
-
- Preserve Glink order identifiers from earlier responses instead of recomputing them.
|
|
108
|
-
- Keep local saleable hotel ID cache and hotel/room mappings current before pricing and booking.
|
|
109
|
-
- Avoid integration quota waste: skip `queryProductDetail` for hotels not in the saleable hotel cache.
|
|
110
|
-
- Push/callback is primary for order confirmation; `queryOrderDetail` is only a compensation path and should not be frequent.
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Glink Endpoint Index
|
|
2
|
-
|
|
3
|
-
All routes are public gateway routes. Sign the public path, not the downstream Glink path.
|
|
4
|
-
|
|
5
|
-
## Static Data
|
|
6
|
-
|
|
7
|
-
- `glink.queryBusinessList`
|
|
8
|
-
- `POST /openapi/v1/glink/queryBusinessList`
|
|
9
|
-
- Required body fields: `cityCode`
|
|
10
|
-
- `glink.queryCountryList`
|
|
11
|
-
- `POST /openapi/v1/glink/queryCountryList`
|
|
12
|
-
- Required body fields: none
|
|
13
|
-
- `glink.queryHotelPlateList`
|
|
14
|
-
- `POST /openapi/v1/glink/queryHotelPlateList`
|
|
15
|
-
- Required body fields: none
|
|
16
|
-
- `glink.queryHotCityList`
|
|
17
|
-
- `POST /openapi/v1/glink/queryHotCityList`
|
|
18
|
-
- Required body fields: none
|
|
19
|
-
- `glink.queryDistrictList`
|
|
20
|
-
- `POST /openapi/v1/glink/queryDistrictList`
|
|
21
|
-
- Required body fields: `cityCode`
|
|
22
|
-
- `glink.queryDistrictAndBusiness`
|
|
23
|
-
- `POST /openapi/v1/glink/queryDistrictAndBusiness`
|
|
24
|
-
- Required body fields: `cityCode`
|
|
25
|
-
- `glink.queryCityList`
|
|
26
|
-
- `POST /openapi/v1/glink/queryCityList`
|
|
27
|
-
- Required body fields: `countryCode`
|
|
28
|
-
|
|
29
|
-
## Hotel Query
|
|
30
|
-
|
|
31
|
-
- `glink.queryCityAndHotelByKeyword`
|
|
32
|
-
- `POST /openapi/v1/glink/queryCityAndHotelByKeyword`
|
|
33
|
-
- Required body fields: `keyWord`
|
|
34
|
-
- `glink.getDestination`
|
|
35
|
-
- `POST /openapi/v1/glink/getDestination`
|
|
36
|
-
- Required body fields: `keyWord`
|
|
37
|
-
- Swagger example uses `keyword`; double-check the field naming against current backend behavior before coding around it.
|
|
38
|
-
- `glink.getHotelSearch`
|
|
39
|
-
- `POST /openapi/v1/glink/getHotelSearch`
|
|
40
|
-
- Required body fields: none
|
|
41
|
-
- Common fields: `cityCode`, `checkInDate`, `checkOutDate`, `roomNum`, `language`
|
|
42
|
-
- `glink.findHotelList`
|
|
43
|
-
- `POST /openapi/v1/glink/findHotelList`
|
|
44
|
-
- Required body fields from schema: `roomFacilityCodes`, `hotelFacilityCodes`, `checkInDate`, `checkOutDate`, `distance`
|
|
45
|
-
- Treat this as a high-friction route and inspect the real example payload before implementing.
|
|
46
|
-
- `glink.queryHotelAllList`
|
|
47
|
-
- `POST /openapi/v1/glink/queryHotelAllList`
|
|
48
|
-
- Required body fields: none
|
|
49
|
-
|
|
50
|
-
## Hotel Info
|
|
51
|
-
|
|
52
|
-
- `glink.queryHotelIdList`
|
|
53
|
-
- `POST /openapi/v1/glink/queryHotelIdList`
|
|
54
|
-
- Required body fields: none
|
|
55
|
-
- The Open Platform Glink onboarding flow commonly uses `cityCode` to fetch the account's saleable hotel IDs for that city; verify the current swagger/code example before generating strict DTOs.
|
|
56
|
-
- `glink.queryHotelInfo`
|
|
57
|
-
- `POST /openapi/v1/glink/queryHotelInfo`
|
|
58
|
-
- Required body fields: `hotelIds`
|
|
59
|
-
- `glink.queryHotelIncrement`
|
|
60
|
-
- `POST /openapi/v1/glink/queryHotelIncrement`
|
|
61
|
-
- Required body fields: `startTime`, `endTime`
|
|
62
|
-
- Swagger example uses `lastUpdateTime`; inspect schema versus example before generating code.
|
|
63
|
-
- `glink.queryHotelImage`
|
|
64
|
-
- `POST /openapi/v1/glink/queryHotelImage`
|
|
65
|
-
- Required body fields: `hotelIds`
|
|
66
|
-
- Swagger example uses `hotelId`; inspect schema versus example before generating code.
|
|
67
|
-
- `glink.queryHotelMainInfoByHotelIds`
|
|
68
|
-
- `POST /openapi/v1/glink/queryHotelMainInfoByHotelIds`
|
|
69
|
-
- Required body fields: `language`
|
|
70
|
-
|
|
71
|
-
## Product Info
|
|
72
|
-
|
|
73
|
-
- `glink.queryHotelLowestPrice`
|
|
74
|
-
- `POST /openapi/v1/glink/queryHotelLowestPrice`
|
|
75
|
-
- Required body fields: `hotelIds`
|
|
76
|
-
- `glink.queryProductDetail`
|
|
77
|
-
- `POST /openapi/v1/glink/queryProductDetail`
|
|
78
|
-
- Required body fields: `hotelId`, `checkInDate`, `checkOutDate`, `roomNum`
|
|
79
|
-
|
|
80
|
-
## Order Info
|
|
81
|
-
|
|
82
|
-
- `glink.checkBooking`
|
|
83
|
-
- `POST /openapi/v1/glink/checkBooking`
|
|
84
|
-
- Required body fields: `hotelId`, `checkInDate`, `checkOutDate`, `roomId`, `ratePlanId`, `roomNum`, `supplyCode`
|
|
85
|
-
- `glink.createOrder`
|
|
86
|
-
- `POST /openapi/v1/glink/createOrder`
|
|
87
|
-
- Required body fields: `hotelId`, `checkInDate`, `checkOutDate`, `roomId`, `ratePlanId`, `roomNum`, `supplyCode`, `totalAmount`, `coOrderCode`, `priceItems`, `guestInfos`, `linkMan`, `linkPhone`, `arriveTime`, `latestArriveTime`
|
|
88
|
-
- `glink.payOrder`
|
|
89
|
-
- `POST /openapi/v1/glink/payOrder`
|
|
90
|
-
- Required body fields: none
|
|
91
|
-
- Common fields: `coOrderCode`, `fcOrderCode`
|
|
92
|
-
- `glink.cancelOrder`
|
|
93
|
-
- `POST /openapi/v1/glink/cancelOrder`
|
|
94
|
-
- Required body fields: none
|
|
95
|
-
- Common fields: `coOrderCode`, `fcOrderCode`, `cancelReson`
|
|
96
|
-
- `glink.queryOrderDetail`
|
|
97
|
-
- `POST /openapi/v1/glink/queryOrderDetail`
|
|
98
|
-
- Required body fields: none
|
|
99
|
-
- Common fields: `coOrderCode`, `fcOrderCode`
|
|
100
|
-
- Glink order operation push/callback
|
|
101
|
-
- Required by the Open Platform Glink booking flow after `payOrder`.
|
|
102
|
-
- This is an inbound callback capability rather than a normal public `/openapi/v1/glink/*` request route in the current endpoint list. Before implementing, inspect route code or product requirements for the platform callback URL, signature/auth expectations, idempotency key, and retry handling.
|
|
103
|
-
- `glink.queryOrderCheckDetailInfo`
|
|
104
|
-
- `POST /openapi/v1/glink/queryOrderCheckDetailInfo`
|
|
105
|
-
- Required body fields: none
|
|
106
|
-
- Common fields: `coOrderCode`, `fcOrderCode`
|
|
107
|
-
- `glink.checkoutApply`
|
|
108
|
-
- `POST /openapi/v1/glink/checkoutApply`
|
|
109
|
-
- Required body fields: `fcOrderCode`, `checkoutReason`, `checkoutRoomInfoList`
|
|
110
|
-
- `glink.queryCheckoutDetail`
|
|
111
|
-
- `POST /openapi/v1/glink/queryCheckoutDetail`
|
|
112
|
-
- Required body fields: `taskOrderCode`
|
|
113
|
-
- Swagger example uses order codes instead of `taskOrderCode`; inspect the live contract before coding.
|
|
114
|
-
|
|
115
|
-
## Finance
|
|
116
|
-
|
|
117
|
-
- `glink.createInvoice`
|
|
118
|
-
- `POST /openapi/v1/glink/createInvoice`
|
|
119
|
-
- Business-required fields to focus on: `orderCode`, `invoiceTypeInteger`, `invoiceHeader`, `amount`, `applyId`, `invoiceTitleType`, `getMethod`
|
|
120
|
-
- Schema still marks `partnerCode` and `sign` as required, but route docs say the platform injects Glink auth fields. Do not send Glink-managed fields from the client.
|
|
121
|
-
- `glink.queryCreditBalance`
|
|
122
|
-
- `POST /openapi/v1/glink/queryCreditBalance`
|
|
123
|
-
- Required body fields: none
|
|
124
|
-
|
|
125
|
-
## Global Notes
|
|
126
|
-
|
|
127
|
-
- Most Glink routes accept plain business JSON bodies with no wrapper objects.
|
|
128
|
-
- Platform error responses can return `401`, `403`, `404`, `500`, `502`, or `504`.
|
|
129
|
-
- Common auth-related `401` codes are `APP_KEY_INVALID`, `SIGN_ERROR`, `TIMESTAMP_EXPIRED`, and `NONCE_REPLAY`.
|
|
130
|
-
- Common `403` cause is `PRODUCT_FORBIDDEN`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|