|
| 1 | +# hostinger_api.EcommerceSalesChannelsApi |
| 2 | + |
| 3 | +All URIs are relative to *https://developers.hostinger.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**create_a_custom_sales_channel_v1**](EcommerceSalesChannelsApi.md#create_a_custom_sales_channel_v1) | **POST** /api/ecommerce/v1/stores/{store_id}/sales-channels | Create a custom sales channel |
| 8 | +[**list_sales_channels_v1**](EcommerceSalesChannelsApi.md#list_sales_channels_v1) | **GET** /api/ecommerce/v1/stores/{store_id}/sales-channels | List sales channels |
| 9 | + |
| 10 | + |
| 11 | +# **create_a_custom_sales_channel_v1** |
| 12 | +> EcommerceV1SalesChannelSalesChannelCreationResource create_a_custom_sales_channel_v1(store_id, ecommerce_v1_sales_channel_store_request) |
| 13 | +
|
| 14 | +Create a custom sales channel |
| 15 | + |
| 16 | +Create a custom sales channel for a store. Build your own frontend and keep your catalog, |
| 17 | +orders, shipping and payments in sync through the Ecommerce API. |
| 18 | + |
| 19 | +### Example |
| 20 | + |
| 21 | +* Bearer Authentication (apiToken): |
| 22 | + |
| 23 | +```python |
| 24 | +import hostinger_api |
| 25 | +from hostinger_api.models.ecommerce_v1_sales_channel_sales_channel_creation_resource import EcommerceV1SalesChannelSalesChannelCreationResource |
| 26 | +from hostinger_api.models.ecommerce_v1_sales_channel_store_request import EcommerceV1SalesChannelStoreRequest |
| 27 | +from hostinger_api.rest import ApiException |
| 28 | +from pprint import pprint |
| 29 | + |
| 30 | + |
| 31 | +# Configure Bearer authorization: apiToken |
| 32 | +configuration = hostinger_api.Configuration( |
| 33 | + access_token = os.environ["BEARER_TOKEN"] |
| 34 | +) |
| 35 | + |
| 36 | +# Enter a context with an instance of the API client |
| 37 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 38 | + # Create an instance of the API class |
| 39 | + api_instance = hostinger_api.EcommerceSalesChannelsApi(api_client) |
| 40 | + store_id = 'store_01J8Z5F8W9K8M4A7B3C2D1E0FG' # str | The ID of the store to create the sales channel for. |
| 41 | + ecommerce_v1_sales_channel_store_request = hostinger_api.EcommerceV1SalesChannelStoreRequest() # EcommerceV1SalesChannelStoreRequest | |
| 42 | + |
| 43 | + try: |
| 44 | + # Create a custom sales channel |
| 45 | + api_response = api_instance.create_a_custom_sales_channel_v1(store_id, ecommerce_v1_sales_channel_store_request) |
| 46 | + print("The response of EcommerceSalesChannelsApi->create_a_custom_sales_channel_v1:\n") |
| 47 | + pprint(api_response) |
| 48 | + except Exception as e: |
| 49 | + print("Exception when calling EcommerceSalesChannelsApi->create_a_custom_sales_channel_v1: %s\n" % e) |
| 50 | +``` |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +### Parameters |
| 55 | + |
| 56 | + |
| 57 | +Name | Type | Description | Notes |
| 58 | +------------- | ------------- | ------------- | ------------- |
| 59 | + **store_id** | **str**| The ID of the store to create the sales channel for. | |
| 60 | + **ecommerce_v1_sales_channel_store_request** | [**EcommerceV1SalesChannelStoreRequest**](EcommerceV1SalesChannelStoreRequest.md)| | |
| 61 | + |
| 62 | +### Return type |
| 63 | + |
| 64 | +[**EcommerceV1SalesChannelSalesChannelCreationResource**](EcommerceV1SalesChannelSalesChannelCreationResource.md) |
| 65 | + |
| 66 | +### Authorization |
| 67 | + |
| 68 | +[apiToken](../README.md#apiToken) |
| 69 | + |
| 70 | +### HTTP request headers |
| 71 | + |
| 72 | + - **Content-Type**: application/json |
| 73 | + - **Accept**: application/json |
| 74 | + |
| 75 | +### HTTP response details |
| 76 | + |
| 77 | +| Status code | Description | Response headers | |
| 78 | +|-------------|-------------|------------------| |
| 79 | +**201** | Created response | - | |
| 80 | +**422** | Validation error response | - | |
| 81 | +**401** | Unauthenticated response | - | |
| 82 | +**500** | Error response | - | |
| 83 | + |
| 84 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 85 | + |
| 86 | +# **list_sales_channels_v1** |
| 87 | +> EcommerceV1SalesChannelSalesChannelListResource list_sales_channels_v1(store_id) |
| 88 | +
|
| 89 | +List sales channels |
| 90 | + |
| 91 | +List a store's active sales channels with their full metadata. |
| 92 | + |
| 93 | +### Example |
| 94 | + |
| 95 | +* Bearer Authentication (apiToken): |
| 96 | + |
| 97 | +```python |
| 98 | +import hostinger_api |
| 99 | +from hostinger_api.models.ecommerce_v1_sales_channel_sales_channel_list_resource import EcommerceV1SalesChannelSalesChannelListResource |
| 100 | +from hostinger_api.rest import ApiException |
| 101 | +from pprint import pprint |
| 102 | + |
| 103 | + |
| 104 | +# Configure Bearer authorization: apiToken |
| 105 | +configuration = hostinger_api.Configuration( |
| 106 | + access_token = os.environ["BEARER_TOKEN"] |
| 107 | +) |
| 108 | + |
| 109 | +# Enter a context with an instance of the API client |
| 110 | +with hostinger_api.ApiClient(configuration) as api_client: |
| 111 | + # Create an instance of the API class |
| 112 | + api_instance = hostinger_api.EcommerceSalesChannelsApi(api_client) |
| 113 | + store_id = 'store_01J8Z5F8W9K8M4A7B3C2D1E0FG' # str | The ID of the store to list sales channels for. |
| 114 | + |
| 115 | + try: |
| 116 | + # List sales channels |
| 117 | + api_response = api_instance.list_sales_channels_v1(store_id) |
| 118 | + print("The response of EcommerceSalesChannelsApi->list_sales_channels_v1:\n") |
| 119 | + pprint(api_response) |
| 120 | + except Exception as e: |
| 121 | + print("Exception when calling EcommerceSalesChannelsApi->list_sales_channels_v1: %s\n" % e) |
| 122 | +``` |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | +### Parameters |
| 127 | + |
| 128 | + |
| 129 | +Name | Type | Description | Notes |
| 130 | +------------- | ------------- | ------------- | ------------- |
| 131 | + **store_id** | **str**| The ID of the store to list sales channels for. | |
| 132 | + |
| 133 | +### Return type |
| 134 | + |
| 135 | +[**EcommerceV1SalesChannelSalesChannelListResource**](EcommerceV1SalesChannelSalesChannelListResource.md) |
| 136 | + |
| 137 | +### Authorization |
| 138 | + |
| 139 | +[apiToken](../README.md#apiToken) |
| 140 | + |
| 141 | +### HTTP request headers |
| 142 | + |
| 143 | + - **Content-Type**: Not defined |
| 144 | + - **Accept**: application/json |
| 145 | + |
| 146 | +### HTTP response details |
| 147 | + |
| 148 | +| Status code | Description | Response headers | |
| 149 | +|-------------|-------------|------------------| |
| 150 | +**200** | Success response | - | |
| 151 | +**401** | Unauthenticated response | - | |
| 152 | +**500** | Error response | - | |
| 153 | + |
| 154 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 155 | + |
0 commit comments