---
name: provision
description: Issues eSIMs from free inventory and assigns a starter package, returning the ICCID and activation QR/LPA in a copyable block. Use when the operator asks to provision, issue, create, or order eSIMs or SIMs for an account.
argument-hint: "[account/reseller] [country or package] [qty]"
---

# Provision eSIM

A developer adding one SIM to an app should use the `issue-esim` skill (`POST /v1/connectivity/intents`) instead of this operator path.

Issue free eSIM stock and assign a starter package so SIMs are ready to activate.

Inputs from `$ARGUMENTS` (ask for anything missing): target **account/reseller**, destination **country/region** or **package template**, and **quantity** (default 1).

## Preferred path — issue from inventory (Console parity)

Matches Console / API `POST /v1/subscribers/issue-from-inventory`: OCS auto-picks a free eSIM on the account and assigns the package in one call.

1. Confirm the account with `list_reseller_accounts` / `get_reseller_info` if not given (need numeric account id).
2. Pick the package with `list_package_templates` (and `pricing_plans` / `service_catalog` for cost). If none fits, propose `create_package_template`.
3. For each unit requested, call `assign_package` with **`account_for_subs` = account id** and **`packageTemplateId`** — **omit `iccid`**. Do not send both.
4. Surface returned **ICCID**, packageId, and **activation QR / LPA / smdp** fields in a copyable block.
5. Confirm stock with `esim_status_per_account` if the operator wants a fleet view.

If OCS reports no free inventory, stop and tell the operator to add stock SIMs (eSIMVault), then retry.

## Alternate paths

- **Existing free ICCID known** → `assign_package` with `iccid` + `packageTemplateId` (no `account_for_subs`).
- **Pro+ guided UI** → `provision_esim_wizard` (selects an existing subscriber, not raw inventory stock).
- **Monthly auto-renew** → after issue, `assign_recurring_package` on the returned ICCID (or use recurring template at issue time only if the one-shot path is not appropriate).

Never provision more than the requested quantity. If platform credit is low (`credit_balance`) or managed wallet is empty (`wallet_balance` via `/carrier:wallet`), warn before provisioning.
