@agenzo/merchant-cli 0.5.0 → 0.5.1
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/README.md +12 -10
- package/dist/index.js +172 -299
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
- **`services`** (capability discovery): list what's currently available and how to call it — run this first to learn the current capability set.
|
|
17
17
|
- **`ride-elife`** (ride-hailing): the full loop of quote → book → query/poll → cancel → list-orders.
|
|
18
|
-
- **`hotel-redaug`** (hotel booking): search, find-destination, hotel-filters, list-cities, hotel-detail, quote, create-order
|
|
18
|
+
- **`hotel-redaug`** (hotel booking): search, find-destination, hotel-filters, list-cities, hotel-detail, quote, create-order (locks the room AND settles payment inline), get (status/poll), cancel, checkout, get-checkout, list-orders. Supports both **monthly_settlement** (settlement-account deduction) and **pay_per_call** (the platform's own server-side EVO integration; optionally target a specific bound card via `--payment-method-id`) — the funds path is decided server-side by `billing_mode`, the CLI call is identical either way.
|
|
19
19
|
|
|
20
20
|
More fulfillment capabilities are added as new nouns over time; `services list` always reflects the current set.
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ More fulfillment capabilities are added as new nouns over time; `services list`
|
|
|
24
24
|
| Noun | Verb | Type | HTTP | Description |
|
|
25
25
|
|---|---|---|---|---|
|
|
26
26
|
| `services` | `list` | Read | — (local) | List available merchant-fulfillment capabilities |
|
|
27
|
-
| `services` | `get <service-id>` | Read | — (local) |
|
|
27
|
+
| `services` | `get <service-id>` | Read | — (local) | Service-layer view: `selection_hints` / `schema_ref` / `conventions` / `workflow` / `verbs_summary` (miss → `SERVICE_NOT_FOUND`); full per-verb flags/response schema is fetched separately via `schema_ref` |
|
|
28
28
|
| `ride-elife` | `quote` | Read | `POST /ride/quote` | Point-to-point quote (`vehicle_classes[]` + meet-and-greet) |
|
|
29
29
|
| `ride-elife` | `book` | Write/Y | `POST /ride/book` | Book against a quote (monthly_settlement-aware, see below) |
|
|
30
30
|
| `ride-elife` | `get` | Read | `GET /ride/<id>/status` | Query order status; `--watch` emits an NDJSON polling stream |
|
|
@@ -36,8 +36,8 @@ More fulfillment capabilities are added as new nouns over time; `services list`
|
|
|
36
36
|
| `hotel-redaug` | `list-cities` | Read | `POST /hotel/cities` | List cities for a country (destination_id + coordinates) |
|
|
37
37
|
| `hotel-redaug` | `hotel-detail` | Read | `POST /hotel/detail` | Hotel detail with facilities/images AND `rooms[]` (area/floor/beds/photos) — call before quote |
|
|
38
38
|
| `hotel-redaug` | `quote` | Read | `POST /hotel/quote` | Real-time rooms/rates for one hotel (`product_token` + `price_items`) |
|
|
39
|
-
| `hotel-redaug` | `create-order` | Write/Y | `POST /hotel/create-order` | Create a hotel order
|
|
40
|
-
| `hotel-redaug` | `pay-order` | Write/Y | `POST /hotel/{order_id}/pay` |
|
|
39
|
+
| `hotel-redaug` | `create-order` | Write/Y | `POST /hotel/create-order` | Create AND pay for a hotel order (locks the rate + settles payment inline; billing path chosen server-side by `billing_mode`); returns `order_id`, already `PAID` |
|
|
40
|
+
| `hotel-redaug` | `pay-order` | Write/Y | `POST /hotel/{order_id}/pay` | Trigger supplier confirmation (upstream payOrder) for a paid order; takes only `--order-id` — no payment params needed |
|
|
41
41
|
| `hotel-redaug` | `get` | Read | `GET /hotel/<id>/status` | Query order status; `--watch` emits an NDJSON polling stream |
|
|
42
42
|
| `hotel-redaug` | `cancel` | Write/Y | `POST /hotel/<id>/cancel` | Cancel a whole order (acceptance ≠ proof; poll `get`) |
|
|
43
43
|
| `hotel-redaug` | `checkout` | Write/Y | `POST /hotel/<id>/checkout` | Partial check-out / out-of-policy cancellation (async) |
|
|
@@ -76,7 +76,8 @@ A runtime-plane CLI that uses an **API Key** (`--api-key`, carried per command a
|
|
|
76
76
|
```bash
|
|
77
77
|
# 1. Discover capabilities
|
|
78
78
|
agenzo-merchant-cli services list
|
|
79
|
-
agenzo-merchant-cli services get ride-elife
|
|
79
|
+
agenzo-merchant-cli services get ride-elife # service-layer view: workflow + conventions + verbs_summary
|
|
80
|
+
agenzo-merchant-cli ride-elife book --help --format json # capability layer: this verb's full flags/response schema
|
|
80
81
|
|
|
81
82
|
# 2. Quote (produces quote_id)
|
|
82
83
|
agenzo-merchant-cli ride-elife quote --api-key "$API_KEY" \
|
|
@@ -103,11 +104,12 @@ agenzo-merchant-cli ride-elife cancel --api-key "$API_KEY" --yes \
|
|
|
103
104
|
|
|
104
105
|
### Hotel booking end-to-end example
|
|
105
106
|
|
|
106
|
-
The core Agent loop is `search → quote → create-order →
|
|
107
|
-
|
|
108
|
-
server-side by
|
|
109
|
-
|
|
110
|
-
- **
|
|
107
|
+
The core Agent loop is `search → quote → create-order → get`. `create-order` is a single write step
|
|
108
|
+
that BOTH locks the room AND settles payment inline — there is no separate settlement call. Amounts
|
|
109
|
+
are decimal currency units (e.g. `320.00` = 320.00 yuan). The billing path is chosen server-side by
|
|
110
|
+
the developer's `billing_mode`, but the CLI call is identical either way:
|
|
111
|
+
- **monthly_settlement**: `total_amount` is deducted from the developer's settlement-account balance inline.
|
|
112
|
+
- **pay_per_call**: `total_amount` is authorized + captured on the developer's bound card via the platform's own server-side EVO integration — no EVO parameters are ever passed through this CLI. Optionally pass `--payment-method-id` to charge a specific bound card instead of the auto-selected one.
|
|
111
113
|
|
|
112
114
|
```bash
|
|
113
115
|
# 1. Search hotels by coordinates + stay dates (or use --destination-id from find-destination).
|