commerce: add CLI and checkout session lifecycle\n\n🤖 Generated with Codebuff\nCo-Authored-By: Codebuff <noreply@codebuff.com>

This commit is contained in:
mats committed 2026-08-28 09:48:35 +02:00
1 parent 8627f0a26f
commit cb7967e419
4 files changed
+378

No files matched your search

+9
View File
@@ -69,6 +69,12 @@ Usage:
cmsctl finder save-trigger Ask reader to persist state
cmsctl finder import [file|-] Import inventory items (JSON/JSONL)
cmsctl commerce promotions {list|get|upsert|status|delete} ...
cmsctl commerce value-codes definitions {get|replace} ...
cmsctl commerce carts {get|add|set|remove} ...
cmsctl commerce checkout create <cart-id> ...
cmsctl commerce orders {get|value-codes} ...
All commands accept --config, --base-url, --finder-url, --api-key, --token,
and --timeout before the command. A missing --finder-url uses <base-url>/find
for reads. Finder administration always uses <base-url>/catalog/admin.
@@ -153,6 +159,9 @@ func runWithStdin(args []string, stdin io.Reader, stdout, stderr io.Writer) erro
case "finder", "inventory":
client := newClient(cfg, global.token, global.apiKey, global.timeout)
return runFinder(ctx, client, rest[1:], stdin, stdout)
case "commerce":
client := newClient(cfg, global.token, global.apiKey, global.timeout)
return runCommerce(ctx, client, rest[1:], stdin, stdout)
default:
return fmt.Errorf("unknown command %q (use --help)", rest[0])
}