Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from voucherifyio/pz/exports-fixes
Browse files Browse the repository at this point in the history
pz/exports-fixes
  • Loading branch information
p-zielinski authored Jan 23, 2024
2 parents 11a13d7 + cb10d23 commit c558a0e
Show file tree
Hide file tree
Showing 23 changed files with 616 additions and 11,388 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Class | Method | HTTP request | Description
*EventsApi* | [**trackCustomEventClientSide**](docs/Api/EventsApi.md#trackcustomeventclientside) | **POST** /client/v1/events | Track Custom Event (client-side)
*ExportsApi* | [**createExport**](docs/Api/ExportsApi.md#createexport) | **POST** /v1/exports | Create Export
*ExportsApi* | [**deleteExport**](docs/Api/ExportsApi.md#deleteexport) | **DELETE** /v1/exports/{exportId} | Delete Export
*ExportsApi* | [**downloadExport**](docs/Api/ExportsApi.md#downloadexport) | **GET** /v1/exports/{export_Id} | Download Export
*ExportsApi* | [**getExport**](docs/Api/ExportsApi.md#getexport) | **GET** /v1/exports/{exportId} | Get Export
*ExportsApi* | [**listExports**](docs/Api/ExportsApi.md#listexports) | **GET** /v1/exports | List Exports
*LoyaltiesApi* | [**createInBulkLoyaltyTiers**](docs/Api/LoyaltiesApi.md#createinbulkloyaltytiers) | **POST** /v1/loyalties/{campaignId}/tiers | Create loyalty tiers
Expand Down Expand Up @@ -171,7 +172,6 @@ Class | Method | HTTP request | Description
*ProductsApi* | [**updateProductsInBulk**](docs/Api/ProductsApi.md#updateproductsinbulk) | **POST** /v1/products/bulk/async | Update Products in bulk
*ProductsApi* | [**updateProductsMetadataInBulk**](docs/Api/ProductsApi.md#updateproductsmetadatainbulk) | **POST** /v1/products/metadata/async | Update Products' Metadata in bulk
*ProductsApi* | [**updateSku**](docs/Api/ProductsApi.md#updatesku) | **PUT** /v1/products/{productId}/skus/{skuId} | Update SKU
*PromotionsApi* | [**createCampaign**](docs/Api/PromotionsApi.md#createcampaign) | **POST** /v1/campaigns | Create Campaign
*PromotionsApi* | [**createPromotionStack**](docs/Api/PromotionsApi.md#createpromotionstack) | **POST** /v1/promotions/{campaignId}/stacks | Create Promotion Stack
*PromotionsApi* | [**deletePromotionStack**](docs/Api/PromotionsApi.md#deletepromotionstack) | **DELETE** /v1/promotions/{campaignId}/stacks/{stackId} | Delete Promotion Stack
*PromotionsApi* | [**deletePromotionTier**](docs/Api/PromotionsApi.md#deletepromotiontier) | **DELETE** /v1/promotions/tiers/{promotionTierId} | Delete Promotion Tier
Expand Down Expand Up @@ -409,7 +409,6 @@ Class | Method | HTTP request | Description
- [EventsCreateResponseBody](docs/Model/EventsCreateResponseBody.md)
- [Export](docs/Model/Export.md)
- [ExportOrderBase](docs/Model/ExportOrderBase.md)
- [ExportOrderFilters](docs/Model/ExportOrderFilters.md)
- [ExportParameters](docs/Model/ExportParameters.md)
- [ExportParametersFilters](docs/Model/ExportParametersFilters.md)
- [ExportResult](docs/Model/ExportResult.md)
Expand Down
59 changes: 59 additions & 0 deletions docs/Api/ExportsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All URIs are relative to https://api.voucherify.io, except if the operation defi
| ------------- | ------------- | ------------- |
| [**createExport()**](ExportsApi.md#createExport) | **POST** /v1/exports | Create Export |
| [**deleteExport()**](ExportsApi.md#deleteExport) | **DELETE** /v1/exports/{exportId} | Delete Export |
| [**downloadExport()**](ExportsApi.md#downloadExport) | **GET** /v1/exports/{export_Id} | Download Export |
| [**getExport()**](ExportsApi.md#getExport) | **GET** /v1/exports/{exportId} | Get Export |
| [**listExports()**](ExportsApi.md#listExports) | **GET** /v1/exports | List Exports |

Expand Down Expand Up @@ -143,6 +144,64 @@ void (empty response body)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `downloadExport()`

```php
downloadExport($export_id, $token): string
```

Download Export

Download the contents of the exported CSV file. <!-- theme: info --> > 📘 Important notes > > **Base URL:** > - `https://download.voucherify.io` (Europe) > - `https://us1.download.voucherify.io` (US) > - `https://as1.download.voucherify.io` (Asia) > > **Token:** Can be found within the `result` parameter of the <!-- [Get Export](OpenAPI.json/paths/~1exports~1{exportId}/get) -->[Get Export](ref:get-export) method response.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new OpenAPI\Client\Api\ExportsApi(
// 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()
);
$export_id = exp_ex6zq0x0EEa9S0N68QcqhxcQ; // string | Unique export object ID.
$token = 'token_example'; // string | Token that was issued to the export, to get this token, get the export first

try {
$result = $apiInstance->downloadExport($export_id, $token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ExportsApi->downloadExport: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **export_id** | **string**| Unique export object ID. | |
| **token** | **string**| Token that was issued to the export, to get this token, get the export first | [optional] |

### Return type

**string**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `text/plain`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getExport()`

```php
Expand Down
68 changes: 0 additions & 68 deletions docs/Api/PromotionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ All URIs are relative to https://api.voucherify.io, except if the operation defi

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**createCampaign()**](PromotionsApi.md#createCampaign) | **POST** /v1/campaigns | Create Campaign |
| [**createPromotionStack()**](PromotionsApi.md#createPromotionStack) | **POST** /v1/promotions/{campaignId}/stacks | Create Promotion Stack |
| [**deletePromotionStack()**](PromotionsApi.md#deletePromotionStack) | **DELETE** /v1/promotions/{campaignId}/stacks/{stackId} | Delete Promotion Stack |
| [**deletePromotionTier()**](PromotionsApi.md#deletePromotionTier) | **DELETE** /v1/promotions/tiers/{promotionTierId} | Delete Promotion Tier |
Expand All @@ -18,73 +17,6 @@ All URIs are relative to https://api.voucherify.io, except if the operation defi
| [**updatePromotionStack()**](PromotionsApi.md#updatePromotionStack) | **PUT** /v1/promotions/{campaignId}/stacks/{stackId} | Update Promotion Stack |


## `createCampaign()`

```php
createCampaign($campaigns_create_request_body): \OpenAPI\Client\Model\CampaignsCreateResponseBody
```

Create Campaign

Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes. <!-- theme: info --> > 📘 Global uniqueness > > All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code. <!-- theme: warning --> > 🚧 Code generation status > > This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the <!-- [campaign object](OpenAPI.json/components/schemas/Campaign) -->[campaign object](ref:get-campaign) description.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');

// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\PromotionsApi(
// 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
);
$campaigns_create_request_body = {"name":"Discount Campaign 4","campaign_type":"DISCOUNT_COUPONS","join_once":true,"type":"AUTO_UPDATE","category_id":"cat_0bb343dee3cdb5ec0c","start_date":"2020-08-16T00:00:00Z","expiration_date":"2023-12-26T00:00:00Z","vouchers_count":3,"voucher":{"type":"DISCOUNT_VOUCHER","discount":{"percent_off":10,"type":"PERCENT"},"redemption":{"quantity":10},"code_config":{"pattern":"10OFF-#######"}},"validity_timeframe":{"interval":"P2D","duration":"P1D"},"validity_day_of_week":[0,1,2],"activity_duration_after_publishing":"P24D","use_voucher_metadata_schema":false,"metadata":{"region":"AMER"}}; // \OpenAPI\Client\Model\CampaignsCreateRequestBody | Specify the details of the campaign that you would like to create.

try {
$result = $apiInstance->createCampaign($campaigns_create_request_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PromotionsApi->createCampaign: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **campaigns_create_request_body** | [**\OpenAPI\Client\Model\CampaignsCreateRequestBody**](../Model/CampaignsCreateRequestBody.md)| Specify the details of the campaign that you would like to create. | [optional] |

### Return type

[**\OpenAPI\Client\Model\CampaignsCreateResponseBody**](../Model/CampaignsCreateResponseBody.md)

### Authorization

[X-App-Id](../../README.md#X-App-Id), [X-App-Token](../../README.md#X-App-Token)

### HTTP request headers

- **Content-Type**: `application/json`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `createPromotionStack()`

```php
Expand Down
4 changes: 2 additions & 2 deletions docs/Api/RedemptionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ $limit = 56; // int | A limit on the number of objects to be returned. Limit can
$page = 56; // int | Which page of results to return.
$result = 'result_example'; // string | A filter on the list based on the redemption result. Available options are: `SUCCESS`, `FAILURE`. You can provide multiple values by repeating the param.
$campaign = 'campaign_example'; // string | A filter by the campaign **name** that the redemption resources originate from.
$customer = 'customer_example'; // string | Return redemptions performed by the customer with given `id`.
$customer = 'customer_example'; // string | Return redemptions performed by the customer with given `id` or `source_id`.
$order = new \OpenAPI\Client\Model\ParameterOrderListRedemptions(); // ParameterOrderListRedemptions | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
$created_at = new \OpenAPI\Client\Model\ParameterCreatedBeforeAfter(); // ParameterCreatedBeforeAfter | A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`
$filters = new \OpenAPI\Client\Model\ParameterFiltersListRedemptions(); // ParameterFiltersListRedemptions | Filters for listing responses.
Expand All @@ -203,7 +203,7 @@ try {
| **page** | **int**| Which page of results to return. | [optional] |
| **result** | **string**| A filter on the list based on the redemption result. Available options are: &#x60;SUCCESS&#x60;, &#x60;FAILURE&#x60;. You can provide multiple values by repeating the param. | [optional] |
| **campaign** | **string**| A filter by the campaign **name** that the redemption resources originate from. | [optional] |
| **customer** | **string**| Return redemptions performed by the customer with given &#x60;id&#x60;. | [optional] |
| **customer** | **string**| Return redemptions performed by the customer with given &#x60;id&#x60; or &#x60;source_id&#x60;. | [optional] |
| **order** | [**ParameterOrderListRedemptions**](../Model/.md)| Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **created_at** | [**ParameterCreatedBeforeAfter**](../Model/.md)| A filter on the list based on the object &#x60;created_at&#x60; field. The value is a dictionary with the following options: &#x60;before&#x60;, &#x60;after&#x60;. A date value must be presented in ISO 8601 format (&#x60;2016-11-16T14:14:31Z&#x60; or &#x60;2016-11-16&#x60;). An example: &#x60;[created_at][before]&#x3D;2017-09-08T13:52:18.227Z&#x60; | [optional] |
| **filters** | [**ParameterFiltersListRedemptions**](../Model/.md)| Filters for listing responses. | [optional] |
Expand Down
Loading

0 comments on commit c558a0e

Please sign in to comment.