All URIs are relative to https://api.voucherify.io
| Method | HTTP request | Description |
|---|---|---|
| ValidateStackedDiscounts | POST /v1/validations | Validate Stackable Discounts |
ValidationsValidateResponseBody ValidateStackedDiscounts (ValidationsValidateRequestBody validationsValidateRequestBody)
Validate Stackable Discounts
Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys. API keys with a Merchant role cant use this endpoint.
using System.Collections.Generic;
using System.Diagnostics;
using Voucherify.Api;
using Voucherify.Client;
using Voucherify.Model;
namespace Example
{
public class ValidateStackedDiscountsExample
{
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 ValidationsApi(config);
var validationsValidateRequestBody = new ValidationsValidateRequestBody(); // ValidationsValidateRequestBody |
try
{
// Validate Stackable Discounts
ValidationsValidateResponseBody result = apiInstance.ValidateStackedDiscounts(validationsValidateRequestBody);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling ValidationsApi.ValidateStackedDiscounts: " + 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
{
// Validate Stackable Discounts
ApiResponse<ValidationsValidateResponseBody> response = apiInstance.ValidateStackedDiscountsWithHttpInfo(validationsValidateRequestBody);
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 ValidationsApi.ValidateStackedDiscountsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}| Name | Type | Description | Notes |
|---|---|---|---|
| validationsValidateRequestBody | ValidationsValidateRequestBody |
ValidationsValidateResponseBody
X-App-Id, X-App-Token, X-Voucherify-OAuth
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Depending on your project settings: all redeemables must be valid or just one must be valid to result as valid validation. Read more in the Stacking Rule Documentation. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]