Billing

From aicodedecode/awesome-muse-skills · View interactive version

Billing is an AI agent skill from the GitHub repository aicodedecode/awesome-muse-skills. Hostinger Billing API for catalog browsing, payment method management, and subscription control. Use when checking pricing, managing payment methods, viewing subscriptions, or toggling auto-renewal.

How to use this skill

Skill file

Hostinger Billing

The Billing API allows you to browse the Hostinger service catalog, manage payment methods, and control subscriptions programmatically. Orders are placed through resource-specific endpoints (e.g., domains and VPS), not a generic billing order endpoint.

Table of Contents

Core Concepts

Catalog

The catalog contains available products and pricing. Prices are displayed in cents (integer), e.g., 1799 means $17.99. Use the catalog to discover available services and their item_id values before placing orders.

Orders

Orders are placed through resource-specific endpoints (e.g., POST /api/domains/v1/portfolio, POST /api/vps/v1/virtual-machines) by referencing catalog item_id values and a payment method. There is no longer a generic billing order endpoint. Orders created via API are set for automatic renewal by default. Some credit_card payments may require additional verification.

Payment Methods

Payment methods must be added via hPanel. The API lets you list, set a default, or delete existing payment methods.

Subscriptions

Subscriptions represent active service plans. You can list subscriptions and toggle auto-renewal on or off.

Common Patterns

Browse Catalog and Place an Order

CLI (curl):

# Get available catalog items
curl -X GET "https://developers.hostinger.com/api/billing/v1/catalog" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN" \
  -H "Content-Type: application/json"

# Filter catalog by category
curl -X GET "https://developers.hostinger.com/api/billing/v1/catalog?category=vps" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

Python SDK:

from hostinger_api import Hostinger

client = Hostinger(api_token="YOUR_API_TOKEN")

# List catalog items
catalog = client.billing.catalog.get_catalog_item_list()
for item in catalog:
    print(f"{item.name}: {item.price / 100:.2f} USD")

TypeScript SDK:

import { Hostinger } from "hostinger-api-sdk";

const client = new Hostinger({ apiToken: "YOUR_API_TOKEN" });

const catalog = await client.billing.catalog.list();
for (const item of catalog) {
  console.log(`${item.name}: ${(item.price / 100).toFixed(2)} USD`);
}

PHP SDK:

use Hostinger\Api\HostingerApi;

$client = new HostingerApi('YOUR_API_TOKEN');

$catalog = $client->billing->catalog->list();
foreach ($catalog as $item) {
    echo $item->name . ': ' . number_format($item->price / 100, 2) . " USD\n";
}

Manage Payment Methods

# List payment methods
curl -X GET "https://developers.hostinger.com/api/billing/v1/payment-methods" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

# Set default payment method
curl -X POST "https://developers.hostinger.com/api/billing/v1/payment-methods/517244" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

# Delete a payment method
curl -X DELETE "https://developers.hostinger.com/api/billing/v1/payment-methods/517244" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

Manage Subscriptions

# List all subscriptions
curl -X GET "https://developers.hostinger.com/api/billing/v1/subscriptions" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

# Disable auto-renewal for a subscription
curl -X DELETE "https://developers.hostinger.com/api/billing/v1/subscriptions/12345/auto-renewal/disable" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

# Enable auto-renewal for a subscription
curl -X PATCH "https://developers.hostinger.com/api/billing/v1/subscriptions/12345/auto-renewal/enable" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"

API Reference

Catalog

| Method | Endpoint | Description |

|--------|----------|-------------|

| GET | /api/billing/v1/catalog | Get catalog items (filterable by category and name) |

Orders

Removed: the generic POST /api/billing/v1/orders endpoint is no longer part of the API. Place orders through the resource-specific endpoints instead — POST /api/domains/v1/portfolio for domains and POST /api/vps/v1/virtual-machines for VPS.

Payment Methods

| Method | Endpoint | Description |

|--------|----------|-------------|

| GET | /api/billing/v1/payment-methods | List payment methods |

| POST | /api/billing/v1/payment-methods/{id} | Set default payment method |

| DELETE | /api/billing/v1/payment-methods/{id} | Delete payment method |

Subscriptions

| Method | Endpoint | Description |

|--------|----------|-------------|

| GET | /api/billing/v1/subscriptions | List all subscriptions |

| DELETE | /api/billing/v1/subscriptions/{id}/auto-renewal/disable | Disable auto-renewal |

| PATCH | /api/billing/v1/subscriptions/{id}/auto-renewal/enable | Enable auto-renewal |

Best Practices

Pricing

Orders

Payment Methods

Subscriptions

Troubleshooting

401 Unauthorized

422 Unprocessable Content

429 Too Many Requests

Order Not Processing

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.