All URIs are relative to https://api.builtbybit.com, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| getV2ResourcesCreatorCoupons() | GET /v2/resources/creator/coupons | Fetch a list of your coupons |
| getV2ResourcesCreatorCouponsEntries() | GET /v2/resources/creator/coupons/entries | Fetch a list of your coupon entries |
| postV2ResourcesCreatorCoupons() | POST /v2/resources/creator/coupons | Create a new coupon |
getV2ResourcesCreatorCoupons($coupon_ids): \OpenAPI\Client\Model\GetV2ResourcesCreatorCoupons200ResponseFetch a list of your coupons
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$coupon_ids = NULL; // array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty.
try {
$result = $apiInstance->getV2ResourcesCreatorCoupons($coupon_ids);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourcesCreatorCouponsApi->getV2ResourcesCreatorCoupons: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| coupon_ids | array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty. | [optional] |
\OpenAPI\Client\Model\GetV2ResourcesCreatorCoupons200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getV2ResourcesCreatorCouponsEntries($coupon_ids): \OpenAPI\Client\Model\GetV2ResourcesCreatorCouponsEntries200ResponseFetch a list of your coupon entries
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$coupon_ids = NULL; // array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty.
try {
$result = $apiInstance->getV2ResourcesCreatorCouponsEntries($coupon_ids);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourcesCreatorCouponsApi->getV2ResourcesCreatorCouponsEntries: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| coupon_ids | array | A comma-separated list of coupon IDs to filter on. No filter is applied if empty. | [optional] |
\OpenAPI\Client\Model\GetV2ResourcesCreatorCouponsEntries200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request): \OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200ResponseCreate a new coupon
This endpoint is currently limited to percent-based coupons with a maximum discount of 50%.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\ResourcesCreatorCouponsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$post_v2_resources_creator_coupons_request = new \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest(); // \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest
try {
$result = $apiInstance->postV2ResourcesCreatorCoupons($post_v2_resources_creator_coupons_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ResourcesCreatorCouponsApi->postV2ResourcesCreatorCoupons: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| post_v2_resources_creator_coupons_request | \OpenAPI\Client\Model\PostV2ResourcesCreatorCouponsRequest | [optional] |
\OpenAPI\Client\Model\PostV2ResourcesCreatorCoupons200Response
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]