Terminal
Terminal/Skill
Lets your agent list and create online stores on a Hostinger account, including the primary sales channel for each new store.
By Hostinger
Works with
npx skills add hostinger/hostinger-agent-skills --skill ecommerceThe Ecommerce API manages online stores associated with your Hostinger account. You can list existing stores and create new ones — creating a store also provisions a primary sales channel for it.
A store is the top-level ecommerce entity tied to your account. Each store carries company details (name, email, country) and a default language used for the storefront.
Every store has at least one sales channel — the surface through which products are sold. When you create a store, a primary sales channel is created alongside it. You can supply a sales_channel object (e.g., type: custom with an external_id) to link the store to an external system.
curl -X GET "https://developers.hostinger.com/api/ecommerce/v1/stores" \
-H "Authorization: Bearer $HOSTINGER_API_TOKEN"
# Paginate
curl -X GET "https://developers.hostinger.com/api/ecommerce/v1/stores?page=2" \
-H "Authorization: Bearer $HOSTINGER_API_TOKEN"
Python SDK:
from hostinger_api import Hostinger
client = Hostinger(api_token="YOUR_API_TOKEN")
stores = client.ecommerce.stores.list()
for store in stores:
print(store.name)
TypeScript SDK:
import { Hostinger } from "hostinger-api-sdk";
const client = new Hostinger({ apiToken: "YOUR_API_TOKEN" });
const stores = await client.ecommerce.stores.list();
for (const store of stores) {
console.log(store.name);
}
PHP SDK:
use Hostinger\Api\HostingerApi;
$client = new HostingerApi('YOUR_API_TOKEN');
$stores = $client->ecommerce->stores->list();
foreach ($stores as $store) {
echo $store->name . "\n";
}
curl -X POST "https://developers.hostinger.com/api/ecommerce/v1/stores" \
-H "Authorization: Bearer $HOSTINGER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Store",
"country_code": "us",
"company_email": "owner@example.com",
"company_name": "My Company",
"language": "en",
"sales_channel": {
"type": "custom",
"external_id": "ext-12345"
}
}'
A primary sales channel is created automatically with the store. The
sales_channelobject is optional — omit it to use the default.
| Method | Endpoint | Description |
|---|---|---|
GET | /api/ecommerce/v1/stores | Get stores (paginated via page) |
POST | /api/ecommerce/v1/stores | Create a store (also creates a primary sales channel) |
| Field | Type | Description |
|---|---|---|
name | string | Store name |
country_code | string | ISO country code (e.g., us) |
company_email | string | Company contact email |
company_name | string | Company name |
language | string | Default storefront language (e.g., en) |
sales_channel | object | Optional. { "type": "custom", "external_id": "..." } |
country_code and language to match your target market — they drive storefront defaultscompany_email — it receives store-related notificationssales_channel.external_id when integrating with an external system so you can reconcile records laterpage when an account has many stores rather than assuming a single pageAuthorization: Bearer <token> header formatcountry_code (use a valid ISO code like us) or malformed company_emailsales_channel object when one is provided