All URIs are relative to https://developers.hostinger.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createStoreV1() | POST /api/ecommerce/v1/stores | Create store |
| deleteStoreV1() | DELETE /api/ecommerce/v1/stores/{store_id} | Delete store |
| getStoreMetadataV1() | GET /api/ecommerce/v1/stores/{store_id}/metadata | Get store metadata |
| getStoresV1() | GET /api/ecommerce/v1/stores | Get stores |
createStoreV1($ecommerceV1StoreStoreRequest): \Hostinger\Model\EcommerceV1StoreStoreCreationResourceCreate store
Create a new store for your account. A primary sales channel is created alongside the store.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\EcommerceStoresApi(config: $config);
$ecommerceV1StoreStoreRequest = new \Hostinger\Model\EcommerceV1StoreStoreRequest(); // \Hostinger\Model\EcommerceV1StoreStoreRequest
try {
$result = $apiInstance->createStoreV1($ecommerceV1StoreStoreRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EcommerceStoresApi->createStoreV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| ecommerceV1StoreStoreRequest | \Hostinger\Model\EcommerceV1StoreStoreRequest |
\Hostinger\Model\EcommerceV1StoreStoreCreationResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteStoreV1($storeId): \Hostinger\Model\EcommerceV1StoreStoreDeleteResourceDelete store
Soft-delete a store owned by your account. The underlying store data is preserved; only the store is marked as deleted.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\EcommerceStoresApi(config: $config);
$storeId = store_01J8Z5F8W9K8M4A7B3C2D1E0FG; // string | The ID of the store to delete.
try {
$result = $apiInstance->deleteStoreV1($storeId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EcommerceStoresApi->deleteStoreV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| storeId | string | The ID of the store to delete. |
\Hostinger\Model\EcommerceV1StoreStoreDeleteResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getStoreMetadataV1($storeId): \Hostinger\Model\EcommerceV1StoreStoreMetadataResourceGet store metadata
Get a store's readiness metadata: whether payment methods and shipping are configured, plus its default currency. Useful to verify prerequisites before building a storefront.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\EcommerceStoresApi(config: $config);
$storeId = store_01J8Z5F8W9K8M4A7B3C2D1E0FG; // string | The ID of the store to read metadata for.
try {
$result = $apiInstance->getStoreMetadataV1($storeId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EcommerceStoresApi->getStoreMetadataV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| storeId | string | The ID of the store to read metadata for. |
\Hostinger\Model\EcommerceV1StoreStoreMetadataResource
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getStoresV1($page): \Hostinger\Model\EcommerceGetStoresV1200ResponseGet stores
Retrieve the stores associated with your account.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: apiToken
$config = Hostinger\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Hostinger\Api\EcommerceStoresApi(config: $config);
$page = 1; // int | Page number
try {
$result = $apiInstance->getStoresV1($page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling EcommerceStoresApi->getStoresV1: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| page | int | Page number | [optional] |
\Hostinger\Model\EcommerceGetStoresV1200Response
[Back to top] [Back to API list] [Back to Model list] [Back to README]