Skip to content

Document accepted keys for spend-request --line-item #54

@pejmanjohn

Description

@pejmanjohn

Summary

link-cli spend-request create --help documents --line-item as "Line item (repeatable, key:value format)", but it does not show which keys are accepted. As an agent integrating against the CLI, I tried a natural key (amount) and got a runtime validation error.

Repro

link-cli spend-request create \
  --payment-method-id '<payment-method-id>' \
  --credential-type card \
  --amount 2644 \
  --currency usd \
  --merchant-name 'Olympia Coffee Roasting Company' \
  --merchant-url 'https://www.olympiacoffee.com/products/big-truck' \
  --context 'Purchase one 12 oz bag of Olympia Coffee Big Truck whole bean coffee for Pejman Pour-Moezzi, including USPS Ground Advantage shipping to the Mercer Island home address.' \
  --line-item 'name:Big Truck whole bean coffee,quantity:1,amount:1950' \
  --format json

Actual result

{
  "code": "UNKNOWN",
  "message": "Line item: Unrecognized key: \"amount\""
}

Expected / request

Please make the accepted line-item schema discoverable from the CLI. A few options that would help agents:

  • Include allowed keys directly in spend-request create --help
  • Include at least one valid --line-item example
  • Improve the validation error to say something like: Unrecognized key "amount". Allowed keys: ...
  • Expose the schema through --schema in a way that clearly shows allowed line-item keys

Why this matters

Agents will infer common ecommerce field names (amount, price, unit_amount, etc.) unless the CLI tells them otherwise. Runtime trial-and-error is avoidable here, and it makes an otherwise clean flow feel brittle.

Environment

link-cli 0.4.0 (build 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions