All URIs are relative to https://api.voucherify.io
| Method | HTTP request | Description |
|---|---|---|
| CreateProductCollection | POST /v1/product-collections | Create Product Collection |
| DeleteProductCollection | DELETE /v1/product-collections/{productCollectionId} | Delete Product Collection |
| GetProductCollection | GET /v1/product-collections/{productCollectionId} | Get Product Collection |
| ListProductCollections | GET /v1/product-collections | List Product Collections |
| ListProductsInCollection | GET /v1/product-collections/{productCollectionId}/products | List Products in Collection |
ProductCollectionsCreateResponseBody CreateProductCollection (ProductCollectionsCreateRequestBody productCollectionsCreateRequestBody)
Create Product Collection
This method creates a new product collection.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class CreateProductCollectionExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProductCollectionsApi(config);
var productCollectionsCreateRequestBody = new ProductCollectionsCreateRequestBody(); // ProductCollectionsCreateRequestBody |
try
{
// Create Product Collection
ProductCollectionsCreateResponseBody result = apiInstance.CreateProductCollection(productCollectionsCreateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.CreateProductCollection: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Create Product Collection
ApiResponse<ProductCollectionsCreateResponseBody> response = apiInstance.CreateProductCollectionWithHttpInfo(productCollectionsCreateRequestBody);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.CreateProductCollectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| productCollectionsCreateRequestBody | ProductCollectionsCreateRequestBody |
ProductCollectionsCreateResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns information about the newly created collection, as well as an array containing the products. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteProductCollection (string productCollectionId)
Delete Product Collection
This method deletes a product collection.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class DeleteProductCollectionExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProductCollectionsApi(config);
var productCollectionId = "productCollectionId_example"; // string | A unique product collection ID.
try
{
// Delete Product Collection
apiInstance.DeleteProductCollection(productCollectionId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.DeleteProductCollection: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete Product Collection
apiInstance.DeleteProductCollectionWithHttpInfo(productCollectionId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.DeleteProductCollectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| productCollectionId | string | A unique product collection ID. |
void (empty response body)
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Returns no content if deletion is successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProductCollectionsGetResponseBody GetProductCollection (string productCollectionId)
Get Product Collection
Retrieves the product collection.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class GetProductCollectionExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProductCollectionsApi(config);
var productCollectionId = "productCollectionId_example"; // string | A unique product collection ID.
try
{
// Get Product Collection
ProductCollectionsGetResponseBody result = apiInstance.GetProductCollection(productCollectionId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.GetProductCollection: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get Product Collection
ApiResponse<ProductCollectionsGetResponseBody> response = apiInstance.GetProductCollectionWithHttpInfo(productCollectionId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.GetProductCollectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| productCollectionId | string | A unique product collection ID. |
ProductCollectionsGetResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a product collection object if a valid identifier was provided in the path. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProductCollectionsListResponseBody ListProductCollections (int? limit = null, int? page = null, ParameterOrder? order = null)
List Product Collections
This method returns a list of product collections.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ListProductCollectionsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProductCollectionsApi(config);
var limit = 56; // int? | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)
var page = 56; // int? | Which page of results to return. The lowest value is 1. (optional)
var order = (ParameterOrder) "created_at"; // ParameterOrder? | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)
try
{
// List Product Collections
ProductCollectionsListResponseBody result = apiInstance.ListProductCollections(limit, page, order);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.ListProductCollections: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// List Product Collections
ApiResponse<ProductCollectionsListResponseBody> response = apiInstance.ListProductCollectionsWithHttpInfo(limit, page, order);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.ListProductCollectionsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int? | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| page | int? | Which page of results to return. The lowest value is 1. | [optional] |
| order | ParameterOrder? | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
ProductCollectionsListResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a dictionary containing a list of product collections and details about each product collection. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProductCollectionsProductsListResponseBody ListProductsInCollection (string productCollectionId, int? limit = null, int? page = null, ParameterOrder? order = null, DateTimeOffset? startingAfter = null)
List Products in Collection
Retrieves list of products from a product collection; works for both dynamic and static product collections.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ListProductsInCollectionExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.voucherify.io";
// Configure API key authorization: X-App-Id
config.AddApiKey("X-App-Id", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Id", "Bearer");
// Configure API key authorization: X-App-Token
config.AddApiKey("X-App-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-App-Token", "Bearer");
// Configure OAuth2 access token for authorization: X-Voucherify-OAuth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new ProductCollectionsApi(config);
var productCollectionId = "productCollectionId_example"; // string | Unique product collection ID.
var limit = 56; // int? | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)
var page = 56; // int? | Which page of results to return. The lowest value is 1. (optional)
var order = (ParameterOrder) "created_at"; // ParameterOrder? | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)
var startingAfter = DateTimeOffset.Parse("2013-10-20T19:20:30+01:00"); // DateTimeOffset? | Timestamp representing the date and time to use in starting_after cursor to get more data. Represented in ISO 8601 format. (optional)
try
{
// List Products in Collection
ProductCollectionsProductsListResponseBody result = apiInstance.ListProductsInCollection(productCollectionId, limit, page, order, startingAfter);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.ListProductsInCollection: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// List Products in Collection
ApiResponse<ProductCollectionsProductsListResponseBody> response = apiInstance.ListProductsInCollectionWithHttpInfo(productCollectionId, limit, page, order, startingAfter);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ProductCollectionsApi.ListProductsInCollectionWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| productCollectionId | string | Unique product collection ID. | |
| limit | int? | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| page | int? | Which page of results to return. The lowest value is 1. | [optional] |
| order | ParameterOrder? | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| startingAfter | DateTimeOffset? | Timestamp representing the date and time to use in starting_after cursor to get more data. Represented in ISO 8601 format. | [optional] |
ProductCollectionsProductsListResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a dictionary of products and/or SKUs grouped in the collection with each product's/SKU's details. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]