Skip to content

[FEATURE] Add CLI commands for billing catalog, payment methods, subscriptions, and order creation #30

@coygeek

Description

@coygeek

Feature Description

Please expose the billing endpoints already present in the OpenAPI spec and generated Go client as first-class hapi commands.

The generated client includes methods for:

  • GET /api/billing/v1/catalog
  • GET /api/billing/v1/payment-methods
  • POST /api/billing/v1/payment-methods/{paymentMethodId}
  • DELETE /api/billing/v1/payment-methods/{paymentMethodId}
  • GET /api/billing/v1/subscriptions
  • DELETE /api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/disable
  • PATCH /api/billing/v1/subscriptions/{subscriptionId}/auto-renewal/enable
  • POST /api/billing/v1/orders

But the shipped CLI currently appears to expose only the vps command group.

Problem Statement

Agentic and automated workflows need a safe, scriptable way to discover purchasable item IDs, inspect default payment methods, and verify subscription state before and after provisioning.

Without billing/catalog commands, users can list VPS templates and data centers with the CLI, but cannot use the same CLI to discover the priced catalog item ID needed for VPS purchase, such as:

hostingercom-vps-kvm2-usd-1m

This pushes automation back to ad hoc API calls or dashboard/manual lookup.

Proposed Solution

Add command groups such as:

hapi billing catalog list --category VPS --format json
hapi billing payment-methods list --format json
hapi billing payment-methods set-default <payment-method-id>
hapi billing subscriptions list --format json
hapi billing subscriptions disable-auto-renewal <subscription-id>
hapi billing subscriptions enable-auto-renewal <subscription-id>
hapi billing orders create --item-id <price-item-id> --quantity 1 --payment-method-id <id>

For agentic workflows, --format json should produce stable JSON suitable for jq.

Use Cases

  • Discover the correct VPS price item ID without dashboard lookup.
  • Verify that a default payment method exists before a purchase attempt.
  • Inspect subscription status after creating or stopping a VPS.
  • Disable auto-renewal for intentionally short-lived resources.
  • Build future-proof scripts that use one official Hostinger CLI instead of mixed dashboard/API/manual steps.

Additional Context

The OpenAPI spec already describes these operations, and the generated Go client already contains the corresponding methods. This request is primarily about exposing that existing API surface through the official CLI.

Are you willing to contribute?

  • Yes, I'd like to implement this feature
  • Yes, but I need guidance
  • No, but I'm available for testing
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions