All URIs are relative to https://api.voucherify.io
| Method | HTTP request | Description |
|---|---|---|
| createProduct | POST /v1/products | Create Product |
| createSku | POST /v1/products/{productId}/skus | Create SKU |
| deleteProduct | DELETE /v1/products/{productId} | Delete Product |
| deleteSku | DELETE /v1/products/{productId}/skus/{skuId} | Delete SKU |
| getProduct | GET /v1/products/{productId} | Get Product |
| getSku | GET /v1/skus/{skuId} | Get SKU |
| importProductsUsingCsv | POST /v1/products/importCSV | Import Products using CSV |
| importSkusUsingCsv | POST /v1/skus/importCSV | Import SKUs using CSV |
| listProducts | GET /v1/products | List Products |
| listSkusInProduct | GET /v1/products/{productId}/skus | List SKUs in Product |
| updateProduct | PUT /v1/products/{productId} | Update Product |
| updateProductsInBulk | POST /v1/products/bulk/async | Update Products in Bulk |
| updateProductsMetadataInBulk | POST /v1/products/metadata/async | Update Products' Metadata in Bulk |
| updateSku | PUT /v1/products/{productId}/skus/{skuId} | Update SKU |
ProductsCreateResponseBody createProduct(productsCreateRequestBody)
Create Product
Creates a product object. 📘 Upsert Mode If you pass an id or a source_id that already exists in the product database, Voucherify will return a related product object with updated fields.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
ProductsCreateRequestBody productsCreateRequestBody = new ProductsCreateRequestBody(); // ProductsCreateRequestBody | Specify the product parameters.
try {
ProductsCreateResponseBody result = apiInstance.createProduct(productsCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#createProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productsCreateRequestBody | ProductsCreateRequestBody | Specify the product parameters. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a product object if the operation succeeded. | - |
ProductsSkusCreateResponseBody createSku(productId, productsSkusCreateRequestBody)
Create SKU
This method adds product variants to a created product. 📘 Upsert Mode If you pass an id or a source_id that already exists in the sku database, Voucherify will return a related sku object with updated fields.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A Voucherify [product](/api-reference/products/get-product) ID or product source ID.
ProductsSkusCreateRequestBody productsSkusCreateRequestBody = new ProductsSkusCreateRequestBody(); // ProductsSkusCreateRequestBody | Specify the SKU parameters to be created.
try {
ProductsSkusCreateResponseBody result = apiInstance.createSku(productId, productsSkusCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#createSku");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A Voucherify product ID or product source ID. |
| productsSkusCreateRequestBody | ProductsSkusCreateRequestBody | Specify the SKU parameters to be created. |
ProductsSkusCreateResponseBody
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the created SKU object. | - |
deleteProduct(productId, force)
Delete Product
Deletes a product and all related SKUs. This operation cannot be undone. If the force parameter is set to false or not set at all, the product and all related SKUs will be moved to the bin.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A Voucherify product ID or source ID.
Boolean force = true; // Boolean | If this flag is set to true, the product and all related SKUs will be removed permanently. If it is set to false or not set at all, the product and all related SKUs will be moved to the bin. Going forward, the user will be able to create another product with exactly the same source_id.
try {
apiInstance.deleteProduct(productId, force);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#deleteProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A Voucherify product ID or source ID. |
| force | Boolean | If this flag is set to true, the product and all related SKUs will be removed permanently. If it is set to false or not set at all, the product and all related SKUs will be moved to the bin. Going forward, the user will be able to create another product with exactly the same source_id. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Returns no content if deletion is successful. | - |
deleteSku(productId, skuId, force)
Delete SKU
Deletes a product SKU. This operation cannot be undone. If the force parameter is set to false or not set at all, the SKU will be moved to the bin.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A unique Voucherify [product](/api-reference/products/get-product) ID or product source ID.
String skuId = "skuId_example"; // String | A Voucherify [SKU ID](/api-reference/products/get-sku) or SKU source ID.
Boolean force = true; // Boolean | If this flag is set to true, the SKU will be removed permanently. If it is set to false or not set at all, the SKU will be moved to the bin. Going forward, the user will be able to create another SKU with exactly the same source_id.
try {
apiInstance.deleteSku(productId, skuId, force);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#deleteSku");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A unique Voucherify product ID or product source ID. |
| skuId | String | A Voucherify SKU ID or SKU source ID. |
| force | Boolean | If this flag is set to true, the SKU will be removed permanently. If it is set to false or not set at all, the SKU will be moved to the bin. Going forward, the user will be able to create another SKU with exactly the same source_id. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
| Status code | Description | Response headers |
|---|---|---|
| 204 | Returns no content if deletion is successful. | - |
ProductsGetResponseBody getProduct(productId)
Get Product
Retrieve details of a given product and its SKUs, if any.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A Voucherify product ID or source ID.
try {
ProductsGetResponseBody result = apiInstance.getProduct(productId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#getProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A Voucherify product ID or source ID. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a product object if a valid identifier was provided. | - |
SkusGetResponseBody getSku(skuId)
Get SKU
Retrieve details of a SKU.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String skuId = "skuId_example"; // String | A Voucherify SKU identifier or SKU source ID.
try {
SkusGetResponseBody result = apiInstance.getSku(skuId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#getSku");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| skuId | String | A Voucherify SKU identifier or SKU source ID. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns requested SKU object. | - |
ProductsImportCsvCreateResponseBody importProductsUsingCsv(_file)
Import Products using CSV
Import products into the repository using a CSV file. The CSV file has to include headers in the first line. 📘 Standard product fields mapping - Create a comma separated value (CSV) file or download our CSV import template. You can find an example template here. - Supported CSV file headers: name,source_id,price,attributes,image_url,Metadata_property_name - Name is a required field. The remaining fields in the CSV template are optional. - Override/Update products names in Voucherify using this method. Data will be updated for each product included in the CSV file whose source_id matches a source ID in Voucherify. No other data can be updated other than the product name. - Note that dates and date-time attributes need to be provided in compliance with the ISO 8601 standard. For example, 2022-03-11T09:00:00.000Z or 2022-03-11 - YYYY-MM-DD - YYYY-MM-DDTHH - YYYY-MM-DDTHH:mm - YYYY-MM-DDTHH:mm:ss - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ssZ - YYYY-MM-DDTHH:mm:ss.SSSZ - Columns that cannot be mapped to standard fields, will be mapped to Custom attributes and added as products metadata. There is no limit on the number of custom attributes that you can import as metadata. - To provide the proper data type, you need to add all custom attributes to the metadata schema before importing the file. Read more here. - Product attributes (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e attribute1,attribute2. - Headers with metadata names cant contain white-space characters. - If you import metadata defined in the schema as arrays (multiple), you need to separate each value using a comma, for example: - array of strings: subscribed,premium - array of numbers: 123,234. - array of dates: 2000-01-01,2000-01-02 This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
File _file = new File("/path/to/file"); // File | File path.
try {
ProductsImportCsvCreateResponseBody result = apiInstance.importProductsUsingCsv(_file);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#importProductsUsingCsv");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| _file | File | File path. |
ProductsImportCsvCreateResponseBody
- Content-Type: multipart/form-data
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the Get Async Action endpoint. | - |
SkusImportCsvCreateResponseBody importSkusUsingCsv(_file)
Import SKUs using CSV
Import SKUs into the repository using a CSV file. The CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template here. 🚧 Import sequence First import products using the dedicated endpoint, then import SKUs using this endpoint to properly match SKUs to products. 📘 Standard SKU fields mapping - Required fields are source_id and product_id. - Supported CSV file headers: product_id,sku,source_id,price,image_url,attributes - SKU source_id must be unique in the entire product catalog, no duplicates are allowed. - SKU attributes need to be in the form of a stringy-fied json, i.e.{color:blue}. These attributes must be defined in the product beforehand so you can import them to the SKU. - You can use this method to update the following parameters in bulk: sku and the sku price. - Columns that cannot be mapped to standard fields will be mapped to Custom attributes and added as product metadata. There is no limit on the number of custom attributes that you can import as metadata. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
File _file = new File("/path/to/file"); // File | File path.
try {
SkusImportCsvCreateResponseBody result = apiInstance.importSkusUsingCsv(_file);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#importSkusUsingCsv");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| _file | File | File path. |
SkusImportCsvCreateResponseBody
- Content-Type: multipart/form-data
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the Get Async Action endpoint. | - |
ProductsListResponseBody listProducts(limit, page, order, startDate, endDate)
List Products
Retrieve a list of products.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(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.
OffsetDateTime startDate = OffsetDateTime.now(); // OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.
OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.
try {
ProductsListResponseBody result = apiInstance.listProducts(limit, page, order, startDate, endDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#listProducts");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| 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. |
| page | Integer | Which page of results to return. The lowest value is 1. |
| order | ParameterOrder | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. |
| startDate | OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format. |
| endDate | OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter. | - |
ProductsSkusListResponseBody listSkusInProduct(productId, limit, page, order, startDate, endDate)
List SKUs in Product
Retrieve all SKUs for a given product.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A Voucherify [product](/api-reference/products/get-product) ID or product source 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 startDate = OffsetDateTime.now(); // OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.
OffsetDateTime endDate = OffsetDateTime.now(); // OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.
try {
ProductsSkusListResponseBody result = apiInstance.listSkusInProduct(productId, limit, page, order, startDate, endDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#listSkusInProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A Voucherify product ID or product source 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. |
| page | Integer | Which page of results to return. The lowest value is 1. |
| order | ParameterOrder | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. |
| startDate | OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format. |
| endDate | OffsetDateTime | Timestamp representing the date and time which results must end on. Represented in ISO 8601 format. |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns a dictionary of SKUs. | - |
ProductsUpdateResponseBody updateProduct(productId, productsUpdateRequestBody)
Update Product
Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A Voucherify product ID or source ID.
ProductsUpdateRequestBody productsUpdateRequestBody = new ProductsUpdateRequestBody(); // ProductsUpdateRequestBody | Specify the parameters of the product that are to be updated.
try {
ProductsUpdateResponseBody result = apiInstance.updateProduct(productId, productsUpdateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#updateProduct");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A Voucherify product ID or source ID. |
| productsUpdateRequestBody | ProductsUpdateRequestBody | Specify the parameters of the product that are to be updated. |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns an updated product object. | - |
ProductsUpdateInBulkResponseBody updateProductsInBulk(productsUpdateInBulkRequestBody)
Update Products in Bulk
Update products in one asynchronous operation. The request can include up to 10 MB of data. The response returns a unique asynchronous action ID. Use this ID in the query paramater of the GET Async Action endpoint to check, e.g.: - The status of your request (in queue, in progress, done, or failed) - Resources that failed to be updated - The report file with details about the update If a product object is not found, it is upserted. This is shown in the report file in the GET Async Action endpoint. The upserted resources have value false in the found column and true in the updated column. This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
List<ProductsUpdateInBulkRequestBody> productsUpdateInBulkRequestBody = Arrays.asList(); // List<ProductsUpdateInBulkRequestBody> | List the product fields to be updated in each product object.
try {
ProductsUpdateInBulkResponseBody result = apiInstance.updateProductsInBulk(productsUpdateInBulkRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#updateProductsInBulk");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productsUpdateInBulkRequestBody | List<ProductsUpdateInBulkRequestBody> | List the product fields to be updated in each product object. |
ProductsUpdateInBulkResponseBody
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 202 | Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the GET Async Action endpoint. | - |
ProductsMetadataUpdateInBulkResponseBody updateProductsMetadataInBulk(productsMetadataUpdateInBulkRequestBody)
Update Products' Metadata in Bulk
Updates metadata parameters for a list of products. Every resource in the list will receive the metadata defined in the request. The request can include up to 10 MB of data. The response returns a unique asynchronous action ID. Use this ID in the query paramater of the GET Async Action endpoint to check, e.g.: - The status of your request (in queue, in progress, done, or failed) - Resources that failed to be updated - The report file with details about the update If a product object is not found, it is upserted. This is shown in the report file in the GET Async Action endpoint. The upserted resources have value false in the found column and true in the updated column. This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
ProductsMetadataUpdateInBulkRequestBody productsMetadataUpdateInBulkRequestBody = new ProductsMetadataUpdateInBulkRequestBody(); // ProductsMetadataUpdateInBulkRequestBody | List the source_ids of the products you would like to update with the metadata key/value pairs.
try {
ProductsMetadataUpdateInBulkResponseBody result = apiInstance.updateProductsMetadataInBulk(productsMetadataUpdateInBulkRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#updateProductsMetadataInBulk");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productsMetadataUpdateInBulkRequestBody | ProductsMetadataUpdateInBulkRequestBody | List the source_ids of the products you would like to update with the metadata key/value pairs. |
ProductsMetadataUpdateInBulkResponseBody
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 202 | Returns the ID of the scheduled asynchronous action. The response informs you that the request has been accepted and the resources will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and use it as a query parameter in the GET Async Action endpoint. | - |
ProductsSkusUpdateResponseBody updateSku(productId, skuId, productsSkusUpdateRequestBody)
Update SKU
Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. Fields other than the ones listed in the request body schema wont be modified. Even if provided, they will be silently skipped.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.ProductsApi;
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
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
ProductsApi apiInstance = new ProductsApi(defaultClient);
String productId = "productId_example"; // String | A unique Voucherify [product](/api-reference/products/get-product) ID or product source ID.
String skuId = "skuId_example"; // String | A Voucherify [SKU ID](/api-reference/products/get-sku) or SKU source ID.
ProductsSkusUpdateRequestBody productsSkusUpdateRequestBody = new ProductsSkusUpdateRequestBody(); // ProductsSkusUpdateRequestBody | Specify the parameters to be updated.
try {
ProductsSkusUpdateResponseBody result = apiInstance.updateSku(productId, skuId, productsSkusUpdateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ProductsApi#updateSku");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description |
|---|---|---|
| productId | String | A unique Voucherify product ID or product source ID. |
| skuId | String | A Voucherify SKU ID or SKU source ID. |
| productsSkusUpdateRequestBody | ProductsSkusUpdateRequestBody | Specify the parameters to be updated. |
ProductsSkusUpdateResponseBody
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Returns the SKU object with the updated parameters. | - |