Subscription Commands #
# List subscriptions
wp dmsi-api subscriptions list [--customer_id=<id>] [--product_id=<id>] [--status=<active|cancelled|expired>] [--format=json|table|csv]
# Create a new subscription (--customer_id and --product_id are required)
wp dmsi-api subscriptions create --customer_id=<id> --product_id=<id> [--billing_period=<monthly|yearly>] [--status=<status>]
# Renew a subscription
wp dmsi-api subscriptions renew <id>
# Cancel a subscription (prompts for confirmation unless --yes is passed)
wp dmsi-api subscriptions cancel <id> [--yes]
Example — renew a subscription:
wp dmsi-api subscriptions renew 7
{
"id": 7,
"status": "active",
"renewed_at": "2026-03-31T01:00:00Z",
"expires_at": "2027-03-31T01:00:00Z"
}
Output Format Reference #
| Format | Flag | Best For |
|---|---|---|
| JSON | --format=json (default) | Scripting, piping to jq, programmatic use |
| Table | --format=table | Interactive terminal review |
| CSV | --format=csv | Spreadsheet import, data migration |
All commands default to JSON when --format is omitted. JSON output matches the REST API response structure exactly, making it straightforward to verify CLI output against API documentation.
