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

Commit c558a0e

Browse files
authored
Merge pull request #4 from voucherifyio/pz/exports-fixes
pz/exports-fixes
2 parents 11a13d7 + cb10d23 commit c558a0e

23 files changed

+616
-11388
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Class | Method | HTTP request | Description
118118
*EventsApi* | [**trackCustomEventClientSide**](docs/Api/EventsApi.md#trackcustomeventclientside) | **POST** /client/v1/events | Track Custom Event (client-side)
119119
*ExportsApi* | [**createExport**](docs/Api/ExportsApi.md#createexport) | **POST** /v1/exports | Create Export
120120
*ExportsApi* | [**deleteExport**](docs/Api/ExportsApi.md#deleteexport) | **DELETE** /v1/exports/{exportId} | Delete Export
121+
*ExportsApi* | [**downloadExport**](docs/Api/ExportsApi.md#downloadexport) | **GET** /v1/exports/{export_Id} | Download Export
121122
*ExportsApi* | [**getExport**](docs/Api/ExportsApi.md#getexport) | **GET** /v1/exports/{exportId} | Get Export
122123
*ExportsApi* | [**listExports**](docs/Api/ExportsApi.md#listexports) | **GET** /v1/exports | List Exports
123124
*LoyaltiesApi* | [**createInBulkLoyaltyTiers**](docs/Api/LoyaltiesApi.md#createinbulkloyaltytiers) | **POST** /v1/loyalties/{campaignId}/tiers | Create loyalty tiers
@@ -171,7 +172,6 @@ Class | Method | HTTP request | Description
171172
*ProductsApi* | [**updateProductsInBulk**](docs/Api/ProductsApi.md#updateproductsinbulk) | **POST** /v1/products/bulk/async | Update Products in bulk
172173
*ProductsApi* | [**updateProductsMetadataInBulk**](docs/Api/ProductsApi.md#updateproductsmetadatainbulk) | **POST** /v1/products/metadata/async | Update Products' Metadata in bulk
173174
*ProductsApi* | [**updateSku**](docs/Api/ProductsApi.md#updatesku) | **PUT** /v1/products/{productId}/skus/{skuId} | Update SKU
174-
*PromotionsApi* | [**createCampaign**](docs/Api/PromotionsApi.md#createcampaign) | **POST** /v1/campaigns | Create Campaign
175175
*PromotionsApi* | [**createPromotionStack**](docs/Api/PromotionsApi.md#createpromotionstack) | **POST** /v1/promotions/{campaignId}/stacks | Create Promotion Stack
176176
*PromotionsApi* | [**deletePromotionStack**](docs/Api/PromotionsApi.md#deletepromotionstack) | **DELETE** /v1/promotions/{campaignId}/stacks/{stackId} | Delete Promotion Stack
177177
*PromotionsApi* | [**deletePromotionTier**](docs/Api/PromotionsApi.md#deletepromotiontier) | **DELETE** /v1/promotions/tiers/{promotionTierId} | Delete Promotion Tier
@@ -409,7 +409,6 @@ Class | Method | HTTP request | Description
409409
- [EventsCreateResponseBody](docs/Model/EventsCreateResponseBody.md)
410410
- [Export](docs/Model/Export.md)
411411
- [ExportOrderBase](docs/Model/ExportOrderBase.md)
412-
- [ExportOrderFilters](docs/Model/ExportOrderFilters.md)
413412
- [ExportParameters](docs/Model/ExportParameters.md)
414413
- [ExportParametersFilters](docs/Model/ExportParametersFilters.md)
415414
- [ExportResult](docs/Model/ExportResult.md)

docs/Api/ExportsApi.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All URIs are relative to https://api.voucherify.io, except if the operation defi
66
| ------------- | ------------- | ------------- |
77
| [**createExport()**](ExportsApi.md#createExport) | **POST** /v1/exports | Create Export |
88
| [**deleteExport()**](ExportsApi.md#deleteExport) | **DELETE** /v1/exports/{exportId} | Delete Export |
9+
| [**downloadExport()**](ExportsApi.md#downloadExport) | **GET** /v1/exports/{export_Id} | Download Export |
910
| [**getExport()**](ExportsApi.md#getExport) | **GET** /v1/exports/{exportId} | Get Export |
1011
| [**listExports()**](ExportsApi.md#listExports) | **GET** /v1/exports | List Exports |
1112

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

147+
## `downloadExport()`
148+
149+
```php
150+
downloadExport($export_id, $token): string
151+
```
152+
153+
Download Export
154+
155+
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.
156+
157+
### Example
158+
159+
```php
160+
<?php
161+
require_once(__DIR__ . '/vendor/autoload.php');
162+
163+
164+
165+
$apiInstance = new OpenAPI\Client\Api\ExportsApi(
166+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
167+
// This is optional, `GuzzleHttp\Client` will be used as default.
168+
new GuzzleHttp\Client()
169+
);
170+
$export_id = exp_ex6zq0x0EEa9S0N68QcqhxcQ; // string | Unique export object ID.
171+
$token = 'token_example'; // string | Token that was issued to the export, to get this token, get the export first
172+
173+
try {
174+
$result = $apiInstance->downloadExport($export_id, $token);
175+
print_r($result);
176+
} catch (Exception $e) {
177+
echo 'Exception when calling ExportsApi->downloadExport: ', $e->getMessage(), PHP_EOL;
178+
}
179+
```
180+
181+
### Parameters
182+
183+
| Name | Type | Description | Notes |
184+
| ------------- | ------------- | ------------- | ------------- |
185+
| **export_id** | **string**| Unique export object ID. | |
186+
| **token** | **string**| Token that was issued to the export, to get this token, get the export first | [optional] |
187+
188+
### Return type
189+
190+
**string**
191+
192+
### Authorization
193+
194+
No authorization required
195+
196+
### HTTP request headers
197+
198+
- **Content-Type**: Not defined
199+
- **Accept**: `text/plain`
200+
201+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
202+
[[Back to Model list]](../../README.md#models)
203+
[[Back to README]](../../README.md)
204+
146205
## `getExport()`
147206

148207
```php

docs/Api/PromotionsApi.md

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ All URIs are relative to https://api.voucherify.io, except if the operation defi
44

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

2019

21-
## `createCampaign()`
22-
23-
```php
24-
createCampaign($campaigns_create_request_body): \OpenAPI\Client\Model\CampaignsCreateResponseBody
25-
```
26-
27-
Create Campaign
28-
29-
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.
30-
31-
### Example
32-
33-
```php
34-
<?php
35-
require_once(__DIR__ . '/vendor/autoload.php');
36-
37-
38-
// Configure API key authorization: X-App-Id
39-
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
40-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
41-
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
42-
43-
// Configure API key authorization: X-App-Token
44-
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
45-
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
46-
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
47-
48-
49-
$apiInstance = new OpenAPI\Client\Api\PromotionsApi(
50-
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
51-
// This is optional, `GuzzleHttp\Client` will be used as default.
52-
new GuzzleHttp\Client(),
53-
$config
54-
);
55-
$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.
56-
57-
try {
58-
$result = $apiInstance->createCampaign($campaigns_create_request_body);
59-
print_r($result);
60-
} catch (Exception $e) {
61-
echo 'Exception when calling PromotionsApi->createCampaign: ', $e->getMessage(), PHP_EOL;
62-
}
63-
```
64-
65-
### Parameters
66-
67-
| Name | Type | Description | Notes |
68-
| ------------- | ------------- | ------------- | ------------- |
69-
| **campaigns_create_request_body** | [**\OpenAPI\Client\Model\CampaignsCreateRequestBody**](../Model/CampaignsCreateRequestBody.md)| Specify the details of the campaign that you would like to create. | [optional] |
70-
71-
### Return type
72-
73-
[**\OpenAPI\Client\Model\CampaignsCreateResponseBody**](../Model/CampaignsCreateResponseBody.md)
74-
75-
### Authorization
76-
77-
[X-App-Id](../../README.md#X-App-Id), [X-App-Token](../../README.md#X-App-Token)
78-
79-
### HTTP request headers
80-
81-
- **Content-Type**: `application/json`
82-
- **Accept**: `application/json`
83-
84-
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
85-
[[Back to Model list]](../../README.md#models)
86-
[[Back to README]](../../README.md)
87-
8820
## `createPromotionStack()`
8921

9022
```php

docs/Api/RedemptionsApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ $limit = 56; // int | A limit on the number of objects to be returned. Limit can
182182
$page = 56; // int | Which page of results to return.
183183
$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.
184184
$campaign = 'campaign_example'; // string | A filter by the campaign **name** that the redemption resources originate from.
185-
$customer = 'customer_example'; // string | Return redemptions performed by the customer with given `id`.
185+
$customer = 'customer_example'; // string | Return redemptions performed by the customer with given `id` or `source_id`.
186186
$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.
187187
$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`
188188
$filters = new \OpenAPI\Client\Model\ParameterFiltersListRedemptions(); // ParameterFiltersListRedemptions | Filters for listing responses.
@@ -203,7 +203,7 @@ try {
203203
| **page** | **int**| Which page of results to return. | [optional] |
204204
| **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] |
205205
| **campaign** | **string**| A filter by the campaign **name** that the redemption resources originate from. | [optional] |
206-
| **customer** | **string**| Return redemptions performed by the customer with given &#x60;id&#x60;. | [optional] |
206+
| **customer** | **string**| Return redemptions performed by the customer with given &#x60;id&#x60; or &#x60;source_id&#x60;. | [optional] |
207207
| **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] |
208208
| **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] |
209209
| **filters** | [**ParameterFiltersListRedemptions**](../Model/.md)| Filters for listing responses. | [optional] |

0 commit comments

Comments
 (0)