@stripe/link-cli 0.8.0 → 0.8.2

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.
Files changed (3) hide show
  1. package/README.md +21 -2
  2. package/dist/cli.js +2 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -105,7 +105,7 @@ Returns the shipping addresses saved to your Link account. The response preserve
105
105
 
106
106
  ### Create a spend request
107
107
 
108
- Create a spend request with a payment method, merchant details, line items, and amounts:
108
+ Create a spend request with merchant details, line items, and amounts. If `--payment-method-id` is omitted, your default payment method will be used, or the first eligible one if no default is set:
109
109
 
110
110
  ```bash
111
111
  link-cli spend-request create \
@@ -214,7 +214,7 @@ All commands accept `--auth <path>` to store auth credentials in a specific file
214
214
 
215
215
  A spend request moves through: **create** → **request approval** → **approved** (with credentials).
216
216
 
217
- **Required fields for create:** `payment_method_id`, `merchant_name`, `merchant_url`, `context`, `amount`
217
+ **Required fields for create:** `merchant_name`, `merchant_url`, `context`, `amount`. `payment_method_id` is optional — if omitted, your default payment method will be used, or the first eligible one if no default is set.
218
218
 
219
219
  **Constraints:** `context` must be at least 100 characters; `amount` must not exceed 500000 (cents); `currency` must be a 3-letter ISO code. The user has 10 minutes from when approval is requested to approve. Approved credentials (card or SPT) are valid for 12 hours from spend request creation.
220
220
  **Test mode:** Pass `--test` to create testmode credentials (uses test card `4242424242424242`), useful for development and integration testing without real payment methods.
@@ -267,6 +267,25 @@ link-cli mpp decode \
267
267
  --challenge 'Payment id="ch_001", realm="merchant.example", method="stripe", intent="charge", request="..."'
268
268
  ```
269
269
 
270
+ ### Report outcomes
271
+
272
+ Use `report` to record the outcome of a purchase attempt. Reporting is optional, but calling it after attempts — success or failure — helps Stripe improve checkout for agents.
273
+
274
+ ```bash
275
+ # Successful purchase
276
+ link-cli report --domain shop.example.com --outcome success --spend-request-id lsrq_abc123
277
+
278
+ # Blocked by captcha
279
+ link-cli report --domain shop.example.com --outcome blocked --spend-request-id lsrq_abc123 \
280
+ --tag captcha --step "checkout page" --freeform-context "Turnstile challenge appeared"
281
+
282
+ # Abandoned due to timeout
283
+ link-cli report --domain shop.example.com --outcome abandoned --spend-request-id lsrq_abc123 \
284
+ --tag timeout
285
+ ```
286
+
287
+ Outcomes: `success`, `blocked`, `abandoned`. Tags: `stripe_checkout`, `captcha`, `anti_bot_script`, `cdn_block`, `waf_block`, `dns_block`, `rate_limited`, `login_required`, `3ds_challenge`, `page_inaccessible`, `timeout`, `site_error`, `payment_declined`, `other`.
288
+
270
289
  ### Environment variables
271
290
 
272
291
  | Variable | Effect |
package/dist/cli.js CHANGED
@@ -15631,7 +15631,7 @@ var RetrieveSpendRequest = ({
15631
15631
  // src/commands/spend-request/schema.ts
15632
15632
  import { z as z8 } from "incur";
15633
15633
  var createOptions = z8.object({
15634
- paymentMethodId: z8.string().describe("Payment method ID"),
15634
+ paymentMethodId: z8.string().optional().describe("Payment method ID"),
15635
15635
  credentialType: z8.enum(["shared_payment_token", "card"]).default("card").describe(
15636
15636
  '"card" for checkout forms/Stripe Elements; "shared_payment_token" for HTTP 402/machine payment flows'
15637
15637
  ),
@@ -16703,7 +16703,7 @@ function cacheUpdateInfo(value, ttlMs = UPDATE_CACHE_TTL_MS) {
16703
16703
  }
16704
16704
 
16705
16705
  // src/cli.tsx
16706
- var cliVersion = "0.8.0";
16706
+ var cliVersion = "0.8.2";
16707
16707
  var cliName = "@stripe/link-cli";
16708
16708
  var defaultHeaders = {
16709
16709
  "User-Agent": `link-cli/${cliVersion}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/link-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "link-cli": "./dist/cli.js"