Skip to content

Latest commit

 

History

History
671 lines (507 loc) · 20.1 KB

File metadata and controls

671 lines (507 loc) · 20.1 KB

Flipdish.Api.VouchersApi

All URIs are relative to https://api.flipdish.co

Method HTTP request Description
CreateVoucher POST /api/v1.0/vouchers/{appId}
GetVoucherByCode GET /api/v1.0/{appId}/vouchers/code/{code}
GetVoucherById GET /api/v1.0/vouchers/{voucherId}
GetVoucherStatsById GET /api/v1.0/vouchers/stats/{voucherId}
GetVoucherValidityPeriods GET /api/v1.0/{appId}/vouchers/{voucherId}/validity-periods
GetVouchers GET /api/v1.0/{appId}/vouchers/summaries
GetVouchersByCustomerForApp GET /api/v1.0/vouchers/{appId}/customer/{customerId}
SetVoucherValidityPeriodsSimplified POST /api/v1.0/{appId}/vouchers/{voucherId}/validity-periods-simplified
UpdateVoucher POST /api/v1.0/vouchers/{voucherId}
UpdateVoucherUsage POST /api/v1.0/{appId}/vouchers/{voucherId}/usage

CreateVoucher

RestApiResultVoucherWithStats CreateVoucher (string appId, CreateVoucher voucher)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class CreateVoucherExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var voucher = new CreateVoucher(); // CreateVoucher | 

            try
            {
                RestApiResultVoucherWithStats result = apiInstance.CreateVoucher(appId, voucher);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.CreateVoucher: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
voucher CreateVoucher

Return type

RestApiResultVoucherWithStats

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVoucherByCode

RestApiResultVoucher GetVoucherByCode (string appId, string code)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVoucherByCodeExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var code = code_example;  // string | 

            try
            {
                RestApiResultVoucher result = apiInstance.GetVoucherByCode(appId, code);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVoucherByCode: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
code string

Return type

RestApiResultVoucher

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVoucherById

RestApiResultVoucherWithStats GetVoucherById (int? voucherId)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVoucherByIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var voucherId = 56;  // int? | 

            try
            {
                RestApiResultVoucherWithStats result = apiInstance.GetVoucherById(voucherId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVoucherById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
voucherId int?

Return type

RestApiResultVoucherWithStats

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVoucherStatsById

RestApiArrayResultVoucherDataPoint GetVoucherStatsById (int? voucherId, string aggregateDataBy, int? dataPointLimit = null)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVoucherStatsByIdExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var voucherId = 56;  // int? | 
            var aggregateDataBy = aggregateDataBy_example;  // string | 
            var dataPointLimit = 56;  // int? |  (optional) 

            try
            {
                RestApiArrayResultVoucherDataPoint result = apiInstance.GetVoucherStatsById(voucherId, aggregateDataBy, dataPointLimit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVoucherStatsById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
voucherId int?
aggregateDataBy string
dataPointLimit int? [optional]

Return type

RestApiArrayResultVoucherDataPoint

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVoucherValidityPeriods

void GetVoucherValidityPeriods (string appId, int? voucherId)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVoucherValidityPeriodsExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var voucherId = 56;  // int? | 

            try
            {
                apiInstance.GetVoucherValidityPeriods(appId, voucherId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVoucherValidityPeriods: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
voucherId int?

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVouchers

RestApiPaginationResultVoucherSummary GetVouchers (string appId, int? pageIndex = null, int? pageSize = null, List searchCodes = null, List statusSearch = null, List typeSearch = null, List subTypeSearch = null, List<int?> storeIds = null, List channelRestrictions = null)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVouchersExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var pageIndex = 56;  // int? |  (optional) 
            var pageSize = 56;  // int? |  (optional) 
            var searchCodes = new List<string>(); // List<string> |  (optional) 
            var statusSearch = statusSearch_example;  // List<string> |  (optional) 
            var typeSearch = typeSearch_example;  // List<string> |  (optional) 
            var subTypeSearch = subTypeSearch_example;  // List<string> |  (optional) 
            var storeIds = new List<int?>(); // List<int?> |  (optional) 
            var channelRestrictions = channelRestrictions_example;  // List<string> |  (optional) 

            try
            {
                RestApiPaginationResultVoucherSummary result = apiInstance.GetVouchers(appId, pageIndex, pageSize, searchCodes, statusSearch, typeSearch, subTypeSearch, storeIds, channelRestrictions);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVouchers: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
pageIndex int? [optional]
pageSize int? [optional]
searchCodes List<string> [optional]
statusSearch List<string> [optional]
typeSearch List<string> [optional]
subTypeSearch List<string> [optional]
storeIds List<int?> [optional]
channelRestrictions List<string> [optional]

Return type

RestApiPaginationResultVoucherSummary

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetVouchersByCustomerForApp

RestApiArrayResultVoucherSummary GetVouchersByCustomerForApp (string appId, int? customerId)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class GetVouchersByCustomerForAppExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var customerId = 56;  // int? | 

            try
            {
                RestApiArrayResultVoucherSummary result = apiInstance.GetVouchersByCustomerForApp(appId, customerId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.GetVouchersByCustomerForApp: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
customerId int?

Return type

RestApiArrayResultVoucherSummary

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SetVoucherValidityPeriodsSimplified

void SetVoucherValidityPeriodsSimplified (string appId, int? voucherId, SetVoucherValidityPeriodsSimplifiedRequest request)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class SetVoucherValidityPeriodsSimplifiedExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var voucherId = 56;  // int? | 
            var request = new SetVoucherValidityPeriodsSimplifiedRequest(); // SetVoucherValidityPeriodsSimplifiedRequest | 

            try
            {
                apiInstance.SetVoucherValidityPeriodsSimplified(appId, voucherId, request);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.SetVoucherValidityPeriodsSimplified: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
voucherId int?
request SetVoucherValidityPeriodsSimplifiedRequest

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateVoucher

RestApiResultVoucherWithStats UpdateVoucher (int? voucherId, UpdateVoucher voucher, List<int?> storeId = null, int? percentValue = null, double? lumpValue = null, double? maxDiscountAmount = null)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class UpdateVoucherExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var voucherId = 56;  // int? | 
            var voucher = new UpdateVoucher(); // UpdateVoucher | 
            var storeId = new List<int?>(); // List<int?> |  (optional) 
            var percentValue = 56;  // int? |  (optional) 
            var lumpValue = 1.2;  // double? |  (optional) 
            var maxDiscountAmount = 1.2;  // double? |  (optional) 

            try
            {
                RestApiResultVoucherWithStats result = apiInstance.UpdateVoucher(voucherId, voucher, storeId, percentValue, lumpValue, maxDiscountAmount);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.UpdateVoucher: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
voucherId int?
voucher UpdateVoucher
storeId List<int?> [optional]
percentValue int? [optional]
lumpValue double? [optional]
maxDiscountAmount double? [optional]

Return type

RestApiResultVoucherWithStats

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateVoucherUsage

void UpdateVoucherUsage (string appId, int? voucherId, UpdateVoucherUsage voucherUsage)

Example

using System;
using System.Diagnostics;
using Flipdish.Api;
using Flipdish.Client;
using Flipdish.Model;

namespace Example
{
    public class UpdateVoucherUsageExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new VouchersApi();
            var appId = appId_example;  // string | 
            var voucherId = 56;  // int? | 
            var voucherUsage = new UpdateVoucherUsage(); // UpdateVoucherUsage | 

            try
            {
                apiInstance.UpdateVoucherUsage(appId, voucherId, voucherUsage);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling VouchersApi.UpdateVoucherUsage: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
appId string
voucherId int?
voucherUsage UpdateVoucherUsage

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
  • Accept: application/json, text/json, application/xml, text/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]