Getting started

billing

orc billing inspects the organization contract, credit balance, invoices, and monthly spending that apply to a Workspace. Configure JPY spending limits and automatic recharge, quote additional usage credits, and proceed to Stripe checkout.

Log in and verify the target Workspace before execution. Select it with --workspace; the contract and billing destination belong to the parent organization billing account. Changes to spending limits and automatic recharge, purchases, and access to the contract management portal require a human organization owner or admin. API keys and service accounts cannot perform these operations.

Usage

terminal
orc billing current --workspace wks_example

Inspect the target Workspace contract

terminal
orc billing monthly-spend get --workspace wks_example

Inspect spending this month

Reading results

OperationMain output
currentorganizationId, billingAccountId, workspaceId, planTier, seatCount, creditBalance, entitlements, usage, subscription state
monthly-spend getcurrency: JPY, used, reserved, limit, periodStart, periodEnd, timeZone, revision
invoices listInvoice IDs, issue timestamps, states, amounts, currencies, and URLs in invoices
purchase quoteJPY credit amount, discount, tax, tax-inclusive total, calculationId, and expiresAt

--json returns an envelope containing success, data, and metadata. Read field details in data. Credit balance, purchase price, and monthly spending have different purposes; do not treat them as the same value.

Subcommands

current

Returns a snapshot of the organization contract applied to the Workspace. Inspect the plan, seat count, API credit balance, entitlements and usage, Stripe subscription state, cancellation scheduled for period end, and contract period end. current_period_end is returned when available; it is not an expiry for each credit bucket.

terminal
orc billing current [options]

Examples

terminal
orc billing current --workspace wks_example

Inspect contract and balance

terminal
orc billing current --workspace wks_example --json

Receive the contract snapshot as JSON

invoices list

Returns the latest 12 invoices for the Workspace parent billing account. Includes invoice ID, issue timestamp, description, payment state, amount, currency, and invoice URL when available. Returns an empty list for an unregistered billing destination.

terminal
orc billing invoices list [options]

Examples

terminal
orc billing invoices list --workspace wks_example --json

List invoices

portal

Creates an administrator Stripe contract management session and opens the returned URL in the default browser. Use it to manage the registered billing destination, payment methods, and subscription. Check the outcome of actions in the browser.

terminal
orc billing portal [options]

Unique options

--no-browser

Return the billing URL without opening a browser

Type: boolean. Optional.

terminal
orc billing portal --no-browser

Examples

terminal
orc billing portal --workspace wks_example

Open contract management

monthly-spend get

Returns spending and the spending limit for the current month in Asia/Tokyo, in JPY. used is posted spending and reserved is reserved spending. Both become null when pricing cannot be calculated; do not treat them as zero spending. Also returns periodStart, periodEnd, revision, and canManage indicating whether settings can be changed.

terminal
orc billing monthly-spend get [options]

Examples

terminal
orc billing monthly-spend get --workspace wks_example --json

Inspect monthly spending and limit

monthly-spend update

Save the spending limit with limit and the most recently retrieved revision. limit is an integer in JPY from 0 to 1,000,000,000; null means no limit. Do not supply currency. This changes settings only and does not purchase credits. Supply all required input; omitted fields do not produce a partial update.

terminal
orc billing monthly-spend update [options]

Unique options

--revision

(required) Body field: revision

Type: number. Optional.

terminal
orc billing monthly-spend update --revision <value>

Examples

terminal
orc billing monthly-spend get --workspace wks_example --json

Read settings before changing the limit

terminal
orc billing monthly-spend update --workspace wks_example --stdin --dry-run < spending-limit.json

Review the limit update request

terminal
orc billing monthly-spend update --workspace wks_example --stdin < spending-limit.json

Save the limit

auto-recharge get

Returns automatic recharge enabled, JPY thresholdJpy and targetJpy, revision, management permission canManage, and saved payment method eligibility available and unavailableReason. Reading does not charge.

terminal
orc billing auto-recharge get [options]

Examples

terminal
orc billing auto-recharge get --workspace wks_example --json

Inspect automatic recharge state

auto-recharge update

Supply enabled, thresholdJpy, targetJpy, and the retrieved revision. The threshold is an integer from 0 to 99,999,999 JPY and the target balance from 1 to 99,999,999 JPY; the target must exceed the threshold by at least 50 JPY. Applies to the purchased JPY balance. When balance reaches or falls below the threshold, the setting purchases the shortfall to reach the target. Enabling requires a saved card or Link eligible for automatic payment. Changes require confirmation; pass --yes in non-interactive environments.

terminal
orc billing auto-recharge update [options]

Unique options

--enabled

(required) Body field: enabled

Type: string. Optional.

terminal
orc billing auto-recharge update --enabled <value>
--revision

(required) Body field: revision

Type: number. Optional.

terminal
orc billing auto-recharge update --revision <value>
--target-jpy

(required) Body field: targetJpy

Type: number. Optional.

terminal
orc billing auto-recharge update --target-jpy <value>
--threshold-jpy

(required) Body field: thresholdJpy

Type: number. Optional.

terminal
orc billing auto-recharge update --threshold-jpy <value>

Examples

terminal
orc billing auto-recharge update --workspace wks_example --stdin --dry-run < auto-recharge.json

Review changes in advance

terminal
orc billing auto-recharge update --workspace wks_example --stdin < auto-recharge.json

Confirm and save settings

purchase create

Start Stripe Checkout with amountJpy, UUID attemptId, and Unix millisecond attemptAt. This operation does not take calculationId. After CLI confirmation, open checkout, verify the billing destination and final tax-inclusive total in Stripe, and pay. Non-interactive execution requires --yes. A successful url response means checkout was created, not that payment or a credit grant completed.

terminal
orc billing purchase create [options]

Unique options

--amount-jpy

(required) Body field: amountJpy

Type: number. Optional.

terminal
orc billing purchase create --amount-jpy <value>
--attempt-at

(required) Body field: attemptAt

Type: number. Optional.

terminal
orc billing purchase create --attempt-at <value>
--attempt-id

(required) Body field: attemptId

Type: string. Optional.

terminal
orc billing purchase create --attempt-id <value>
--no-browser

Return the billing URL without opening a browser

Type: boolean. Optional.

terminal
orc billing purchase create --no-browser

Examples

terminal
orc billing purchase create --workspace wks_example --stdin --dry-run < purchase-attempt.json

Review the purchase attempt request

terminal
orc billing purchase create --workspace wks_example --stdin < purchase-attempt.json

Proceed to checkout after confirmation

Use the same file when retrying. Check payment state before creating a new attempt.

terminal
orc billing purchase create --workspace wks_example --stdin < purchase-attempt.json

Resend the same purchase attempt

purchase quote

Supply the JPY value of usage credits to purchase as amountJpy, an integer from 1 to 99,999,999. Returns creditAmountJpy, discount amount and rate, tax, total including tax, Stripe tax calculation ID calculationId, and expiresAt in Unix seconds. This quotes using the billing destination; it does not purchase or grant credits.

terminal
orc billing purchase quote [options]

Unique options

--amount-jpy

(required) Body field: amountJpy

Type: number. Optional.

terminal
orc billing purchase quote --amount-jpy <value>

Examples

terminal
orc billing purchase quote --workspace wks_example --amount-jpy 15000 --json

Quote 15,000 JPY of usage credits

Examples

Monthly spending limit input

revision is an example. Replace it with the latest get response for the target Workspace. Set limit to null for no limit.

spending-limit.json
{
  "limit": 10000,
  "revision": 0
}

Monthly spending limit input

Automatic recharge settings input

Use the latest revision. Once enabled, the saved payment method is charged when the configured conditions are met.

auto-recharge.json
{
  "enabled": true,
  "thresholdJpy": 1000,
  "targetJpy": 5000,
  "revision": 0
}

Automatic recharge settings input

Prepare a purchase attempt from a quote

After checking the quote amount, discount, tax, and expiry, create an attempt file once per purchase. Retain that saved file when retrying the same purchase.

terminal
orc billing purchase quote --workspace wks_example --amount-jpy 15000 --json
node --input-type=module -e 'import { randomUUID } from "node:crypto"; console.log(JSON.stringify({ amountJpy: 15000, attemptId: randomUUID(), attemptAt: Date.now() }))' > purchase-attempt.json

Prepare a purchase attempt from a quote

Check state after payment

Do not consider a purchase complete just because the browser opened. Check the checkout result and its reflection in the contract and invoices.

terminal
orc billing current --workspace wks_example --json
orc billing invoices list --workspace wks_example --json

Check state after payment

Purchase and settings workflow

Before purchasing, check amount and tax with purchase quote, and prepare an attempt for the same amountJpy. purchase create requests confirmation and opens the returned Stripe Checkout URL. Final tax and billing destination review and payment take place in Stripe. The quote calculationId identifies a tax calculation; it is not a purchase authorization ID.

attemptAt is the creation time in Unix milliseconds. The server rejects attempts older than 23 hours or more than 60 seconds in the future. On communication failure, retain attemptId and attemptAt when retrying; check payment state first for old attempts.

For spending limits and automatic recharge, pass the revision retrieved by get to update. The confirmation-required purchase create and auto-recharge update operations need --yes when execution cannot be interactive. --dry-run reviews the planned request; it does not guarantee server authorization, billing destination checks, or amount calculation will succeed.

Permissions

Reads also require authentication and access to the target Workspace. Run monthly-spend update, auto-recharge update, purchase create, and portal in a human organization owner or admin session. If permissions are insufficient, ask an organization administrator rather than retrying credentials to bypass the restriction.

Global Options

The following global options can be used with orc billing:

For details and examples, see global options.

Troubleshooting

Permission denied

Check the target Workspace and logged-in organization. Billing changes require a human owner/admin session. Expanding API key permissions does not remove this restriction.

Settings changed elsewhere

For a revision conflict, run get again, inspect current settings, and rebuild the needed change. Do not repeatedly send an old revision.

Missing billing destination or payment method

Quotes require a billing destination. Enabling automatic recharge also requires a payment method eligible for automatic payment. Check available and unavailableReason from auto-recharge get; an administrator can configure billing information in billing portal.

Unknown purchase or automatic recharge result

Do not treat Checkout URL creation as payment completion. Check Stripe, current, and invoices. Retain the attempt while retrying the same purchase. If an incomplete previous automatic charge prevents settings changes, follow the displayed guidance instead of changing amounts to bypass it.

Monthly spending is null

Pricing cannot be calculated. Do not replace used and reserved with zero; check the pricing state. When handling API or network failures in scripts, use exit codes rather than stderr wording.