CLI investigation recipes

Use bounded REST reads from the CLI to inspect usage and billing.

These recipes use the raw api command. Configure staging and sign in with the documented authentication flow. Browser sign-in does not grant meter or usage access, so use a secret API key with read access for these recipes.

revkeen config set environment staging
revkeen api GET '/v2/meters?limit=10' --agent
revkeen api GET '/v2/usage-events?limit=10' --agent
revkeen api GET '/v2/customer-meters' --agent

Add customer and meter filters from the operation reference to keep investigations bounded. Set the following IDs from records returned for your own merchant:

revkeen api GET "/v2/meters/$REVKEEN_METER_ID/quantities?start_timestamp=2026-08-01T00:00:00Z&end_timestamp=2026-08-08T00:00:00Z&interval=day" --agent
revkeen api GET "/v2/usage-events/$REVKEEN_EVENT_ID" --agent
revkeen api GET "/v2/invoice-line-items/$REVKEEN_INVOICE_LINE_ID/usage-events?limit=10" --agent
revkeen api GET "/v2/invoices/$REVKEEN_INVOICE_ID" --agent

Machine-readable output

--agent emits the response body as JSON on stdout. Keep stderr separate and inspect the process exit status before consuming data. A response body on stdout is not evidence of success. Avoid logging customer records in shared CI output.

Purchases, portal sessions, and exports

Creating a checkout session, invoice payment request, customer portal session, or export is a state-changing operation. Use the exact request schema from the API reference and an authorised server integration. Do not paste secret session responses into a terminal transcript. The raw api command does not provide a general custom-header flag for caller-owned idempotency: use a client that supports the required header for safely retried financial mutations.

To test webhook handling locally, use listen and trigger. To set up a Cart integration, use the cart and doctor commands.

Owner: david · Reviewed 30 Sep 2026 · Next review 30 Oct 2026

On this page