Skip to content

Latest commit

 

History

History
399 lines (310 loc) · 16.9 KB

ProductCollectionsApi.md

File metadata and controls

399 lines (310 loc) · 16.9 KB

ProductCollectionsApi

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

createProductCollection

ProductCollectionsCreateResponseBody createProductCollection(productCollectionsCreateRequestBody)

Create Product Collection

This method creates a new product collection.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.ProductCollectionsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    ProductCollectionsApi apiInstance = new ProductCollectionsApi(defaultClient);
    ProductCollectionsCreateRequestBody productCollectionsCreateRequestBody = new ProductCollectionsCreateRequestBody(); // ProductCollectionsCreateRequestBody | 
    try {
      ProductCollectionsCreateResponseBody result = apiInstance.createProductCollection(productCollectionsCreateRequestBody);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ProductCollectionsApi#createProductCollection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
productCollectionsCreateRequestBody ProductCollectionsCreateRequestBody [optional]

Return type

ProductCollectionsCreateResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns information about the newly created collection, as well as an array containing the products. -

deleteProductCollection

deleteProductCollection(productCollectionId)

Delete Product Collection

This method deletes a product collection.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.ProductCollectionsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    ProductCollectionsApi apiInstance = new ProductCollectionsApi(defaultClient);
    String productCollectionId = "productCollectionId_example"; // String | A unique product collection ID.
    try {
      apiInstance.deleteProductCollection(productCollectionId);
    } catch (ApiException e) {
      System.err.println("Exception when calling ProductCollectionsApi#deleteProductCollection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
productCollectionId String A unique product collection ID.

Return type

null (empty response body)

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 Returns no content if deletion is successful. -

getProductCollection

ProductCollectionsGetResponseBody getProductCollection(productCollectionId)

Get Product Collection

Retrieves the product collection.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.ProductCollectionsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    ProductCollectionsApi apiInstance = new ProductCollectionsApi(defaultClient);
    String productCollectionId = "productCollectionId_example"; // String | A unique product collection ID.
    try {
      ProductCollectionsGetResponseBody result = apiInstance.getProductCollection(productCollectionId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ProductCollectionsApi#getProductCollection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
productCollectionId String A unique product collection ID.

Return type

ProductCollectionsGetResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a product collection object if a valid identifier was provided in the path. -

listProductCollections

ProductCollectionsListResponseBody listProductCollections(limit, page, order)

List Product Collections

This method returns a list of product collections.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.ProductCollectionsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    ProductCollectionsApi apiInstance = new ProductCollectionsApi(defaultClient);
    Integer limit = 56; // Integer | 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.
    Integer page = 56; // Integer | Which page of results to return. The lowest value is `1`.
    ParameterOrder order = ParameterOrder.fromValue("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.
    try {
      ProductCollectionsListResponseBody result = apiInstance.listProductCollections(limit, page, order);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ProductCollectionsApi#listProductCollections");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
limit Integer 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 Integer 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] [enum: created_at, -created_at, updated_at, -updated_at, type, -type, code, -code, campaign, -campaign, category, -category]

Return type

ProductCollectionsListResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a dictionary containing a list of product collections and details about each product collection. -

listProductsInCollection

ProductCollectionsProductsListResponseBody listProductsInCollection(productCollectionId, limit, page, order, startingAfter)

List Products in Collection

Retrieves list of products from a product collection; works for both dynamic and static product collections.

Example

// Import classes:
import voucherify.client.ApiClient;
import voucherify.client.ApiException;
import voucherify.client.Configuration;
import voucherify.client.auth.*;
import voucherify.client.models.*;
import voucherify.client.api.ProductCollectionsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.voucherify.io");
    
    // Configure API key authorization: X-App-Id
    ApiKeyAuth X-App-Id = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Id");
    X-App-Id.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Id.setApiKeyPrefix("Token");

    // Configure API key authorization: X-App-Token
    ApiKeyAuth X-App-Token = (ApiKeyAuth) defaultClient.getAuthentication("X-App-Token");
    X-App-Token.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //X-App-Token.setApiKeyPrefix("Token");

    ProductCollectionsApi apiInstance = new ProductCollectionsApi(defaultClient);
    String productCollectionId = "productCollectionId_example"; // String | Unique product collection ID.
    Integer limit = 56; // Integer | 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.
    Integer page = 56; // Integer | Which page of results to return. The lowest value is `1`.
    ParameterOrder order = ParameterOrder.fromValue("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.
    OffsetDateTime startingAfter = OffsetDateTime.now(); // OffsetDateTime | Timestamp representing the date and time to use in starting_after cursor to get more data. Represented in ISO 8601 format.
    try {
      ProductCollectionsProductsListResponseBody result = apiInstance.listProductsInCollection(productCollectionId, limit, page, order, startingAfter);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ProductCollectionsApi#listProductsInCollection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
productCollectionId String Unique product collection ID.
limit Integer 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 Integer 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] [enum: created_at, -created_at, updated_at, -updated_at, type, -type, code, -code, campaign, -campaign, category, -category]
startingAfter OffsetDateTime Timestamp representing the date and time to use in starting_after cursor to get more data. Represented in ISO 8601 format. [optional]

Return type

ProductCollectionsProductsListResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

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. -