|
| 1 | +# OpenAPI\Client\ResourcesCreatorCouponsApi |
| 2 | + |
| 3 | +All URIs are relative to https://api.builtbybit.com, except if the operation defines another base path. |
| 4 | + |
| 5 | +| Method | HTTP request | Description | |
| 6 | +| ------------- | ------------- | ------------- | |
| 7 | +| [**getV2ResourcesCreatorCoupons()**](ResourcesCreatorCouponsApi.md#getV2ResourcesCreatorCoupons) | **GET** /v2/resources/creator/coupons | Fetch a list of your coupons | |
| 8 | +| [**getV2ResourcesCreatorCouponsEntries()**](ResourcesCreatorCouponsApi.md#getV2ResourcesCreatorCouponsEntries) | **GET** /v2/resources/creator/coupons/entries | Fetch a list of your coupon entries | |
| 9 | +| [**postV2ResourcesCreatorCoupons()**](ResourcesCreatorCouponsApi.md#postV2ResourcesCreatorCoupons) | **POST** /v2/resources/creator/coupons | Create a new coupon | |
| 10 | + |
| 11 | + |
| 12 | +## `getV2ResourcesCreatorCoupons()` |
| 13 | + |
| 14 | +```php |
| 15 | +getV2ResourcesCreatorCoupons($coupon_ids): \OpenAPI\Client\Model\GetV2ResourcesCreatorCoupons200Response |
| 16 | +``` |
| 17 | + |
| 18 | +Fetch a list of your coupons |
| 19 | + |
| 20 | +### Example |
| 21 | + |
| 22 | +```php |
| 23 | +<?php |
| 24 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 25 | + |
| 26 | + |
| 27 | +// Configure API key authorization: token |
| 28 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 29 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 30 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 31 | + |
| 32 | + |
| 33 | +$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi( |
| 34 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 35 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 36 | + new GuzzleHttp\Client(), |
| 37 | + $config |
| 38 | +); |
| 39 | +$coupon_ids = NULL; // array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty. |
| 40 | + |
| 41 | +try { |
| 42 | + $result = $apiInstance->getV2ResourcesCreatorCoupons($coupon_ids); |
| 43 | + print_r($result); |
| 44 | +} catch (Exception $e) { |
| 45 | + echo 'Exception when calling ResourcesCreatorCouponsApi->getV2ResourcesCreatorCoupons: ', $e->getMessage(), PHP_EOL; |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### Parameters |
| 50 | + |
| 51 | +| Name | Type | Description | Notes | |
| 52 | +| ------------- | ------------- | ------------- | ------------- | |
| 53 | +| **coupon_ids** | [**array**](../Model/.md)| A comma-separated list of coupon IDs to filter on. No filter is applied if empty. | [optional] | |
| 54 | + |
| 55 | +### Return type |
| 56 | + |
| 57 | +[**\OpenAPI\Client\Model\GetV2ResourcesCreatorCoupons200Response**](../Model/GetV2ResourcesCreatorCoupons200Response.md) |
| 58 | + |
| 59 | +### Authorization |
| 60 | + |
| 61 | +[token](../../README.md#token) |
| 62 | + |
| 63 | +### HTTP request headers |
| 64 | + |
| 65 | +- **Content-Type**: Not defined |
| 66 | +- **Accept**: `application/json` |
| 67 | + |
| 68 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 69 | +[[Back to Model list]](../../README.md#models) |
| 70 | +[[Back to README]](../../README.md) |
| 71 | + |
| 72 | +## `getV2ResourcesCreatorCouponsEntries()` |
| 73 | + |
| 74 | +```php |
| 75 | +getV2ResourcesCreatorCouponsEntries($coupon_ids): \OpenAPI\Client\Model\GetV2ResourcesCreatorCouponsEntries200Response |
| 76 | +``` |
| 77 | + |
| 78 | +Fetch a list of your coupon entries |
| 79 | + |
| 80 | +### Example |
| 81 | + |
| 82 | +```php |
| 83 | +<?php |
| 84 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 85 | + |
| 86 | + |
| 87 | +// Configure API key authorization: token |
| 88 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 89 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 90 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 91 | + |
| 92 | + |
| 93 | +$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi( |
| 94 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 95 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 96 | + new GuzzleHttp\Client(), |
| 97 | + $config |
| 98 | +); |
| 99 | +$coupon_ids = NULL; // array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty. |
| 100 | + |
| 101 | +try { |
| 102 | + $result = $apiInstance->getV2ResourcesCreatorCouponsEntries($coupon_ids); |
| 103 | + print_r($result); |
| 104 | +} catch (Exception $e) { |
| 105 | + echo 'Exception when calling ResourcesCreatorCouponsApi->getV2ResourcesCreatorCouponsEntries: ', $e->getMessage(), PHP_EOL; |
| 106 | +} |
| 107 | +``` |
| 108 | + |
| 109 | +### Parameters |
| 110 | + |
| 111 | +| Name | Type | Description | Notes | |
| 112 | +| ------------- | ------------- | ------------- | ------------- | |
| 113 | +| **coupon_ids** | [**array**](../Model/.md)| A comma-separated list of coupon IDs to filter on. No filter is applied if empty. | [optional] | |
| 114 | + |
| 115 | +### Return type |
| 116 | + |
| 117 | +[**\OpenAPI\Client\Model\GetV2ResourcesCreatorCouponsEntries200Response**](../Model/GetV2ResourcesCreatorCouponsEntries200Response.md) |
| 118 | + |
| 119 | +### Authorization |
| 120 | + |
| 121 | +[token](../../README.md#token) |
| 122 | + |
| 123 | +### HTTP request headers |
| 124 | + |
| 125 | +- **Content-Type**: Not defined |
| 126 | +- **Accept**: `application/json` |
| 127 | + |
| 128 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 129 | +[[Back to Model list]](../../README.md#models) |
| 130 | +[[Back to README]](../../README.md) |
| 131 | + |
| 132 | +## `postV2ResourcesCreatorCoupons()` |
| 133 | + |
| 134 | +```php |
| 135 | +postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request): \OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200Response |
| 136 | +``` |
| 137 | + |
| 138 | +Create a new coupon |
| 139 | + |
| 140 | +This endpoint is currently limited to percent-based coupons with a maximum discount of 50%. |
| 141 | + |
| 142 | +### Example |
| 143 | + |
| 144 | +```php |
| 145 | +<?php |
| 146 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 147 | + |
| 148 | + |
| 149 | +// Configure API key authorization: token |
| 150 | +$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY'); |
| 151 | +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 152 | +// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer'); |
| 153 | + |
| 154 | + |
| 155 | +$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi( |
| 156 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 157 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 158 | + new GuzzleHttp\Client(), |
| 159 | + $config |
| 160 | +); |
| 161 | +$post_v2_resources_creator_coupons_request = new \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest(); // \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest |
| 162 | + |
| 163 | +try { |
| 164 | + $result = $apiInstance->postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request); |
| 165 | + print_r($result); |
| 166 | +} catch (Exception $e) { |
| 167 | + echo 'Exception when calling ResourcesCreatorCouponsApi->postV2ResourcesCreatorCoupons: ', $e->getMessage(), PHP_EOL; |
| 168 | +} |
| 169 | +``` |
| 170 | + |
| 171 | +### Parameters |
| 172 | + |
| 173 | +| Name | Type | Description | Notes | |
| 174 | +| ------------- | ------------- | ------------- | ------------- | |
| 175 | +| **post_v2_resources_creator_coupons_request** | [**\OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest**](../Model/PostV2ResourcesCreatorCouponsRequest.md)| | [optional] | |
| 176 | + |
| 177 | +### Return type |
| 178 | + |
| 179 | +[**\OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200Response**](../Model/PostV2ResourcesCreatorCoupons200Response.md) |
| 180 | + |
| 181 | +### Authorization |
| 182 | + |
| 183 | +[token](../../README.md#token) |
| 184 | + |
| 185 | +### HTTP request headers |
| 186 | + |
| 187 | +- **Content-Type**: `application/json` |
| 188 | +- **Accept**: `application/json` |
| 189 | + |
| 190 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 191 | +[[Back to Model list]](../../README.md#models) |
| 192 | +[[Back to README]](../../README.md) |
0 commit comments