BokaMera.API.Host

<back to all web services

DeleteRebateCode

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
DELETE/rebatecodes/{Id}Delete RebateCode.Delete RebateCode.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;

namespace BokaMera.API.ServiceModel.Dtos
{
    public partial class DaysOfWeekResponse
    {
        public virtual int Id { get; set; }
        public virtual string DayOfWeek { get; set; }
        public virtual string DayOfWeekTranslation { get; set; }
        public virtual bool? DayOfWeekActive { get; set; }
        public virtual short? DayOfWeekSortOrder { get; set; }
    }

    [ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
    [ValidateRequest("IsAuthenticated")]
    public partial class DeleteRebateCode
        : ICompany
    {
        ///<summary>
        ///
        ///</summary>
        [ApiMember(Description="")]
        public virtual Guid? CompanyId { get; set; }

        ///<summary>
        ///Id of the rebate code
        ///</summary>
        [ApiMember(Description="Id of the rebate code", IsRequired=true, ParameterType="path")]
        public virtual int? Id { get; set; }

        public virtual bool ForceDelete { get; set; }
    }

    public partial class RebateCodeCustomerResponse
    {
        public virtual Guid Id { get; set; }
        public virtual string Firstname { get; set; }
        public virtual string Lastname { get; set; }
        public virtual string Email { get; set; }
        public virtual string Phone { get; set; }
        public virtual string ImageUrl { get; set; }
    }

    public partial class RebateCodeResponse
    {
        public RebateCodeResponse()
        {
            DaysOfWeek = new List<DaysOfWeekResponse>{};
            Services = new List<RebateCodeServiceResponse>{};
            Customers = new List<RebateCodeCustomerResponse>{};
            RebateCodeTypesOptions = new List<RebateCodeTypeResponse>{};
            RebateCodeStatusOptions = new List<RebateCodeStatusResponse>{};
        }

        public virtual int Id { get; set; }
        public virtual Guid? CompanyId { get; set; }
        public virtual DateTime ValidFrom { get; set; }
        public virtual DateTime ValidTo { get; set; }
        ///<summary>
        ///If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.
        ///</summary>
        [ApiMember(Description="If the price is only valid for specific days in week add a comma separated list of which days this day price belongs to, 1 = Monday .. 7 = Sunday. All old days connected will be removed on update.")]
        public virtual TimeSpan FromTime { get; set; }

        ///<summary>
        ///If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.
        ///</summary>
        [ApiMember(Description="If the price is only valid for a specific time span during a time of day enter the FromTime and ToTime parameters.")]
        public virtual TimeSpan ToTime { get; set; }

        public virtual string CreatedBy { get; set; }
        public virtual DateTime Created { get; set; }
        public virtual string UpdatedBy { get; set; }
        public virtual DateTime Updated { get; set; }
        public virtual string PersonalNote { get; set; }
        public virtual string RebateCodeSign { get; set; }
        public virtual int RebateCodeValue { get; set; }
        public virtual int RebateCodeTypeId { get; set; }
        public virtual string Name { get; set; }
        public virtual int RebateCodeStatusId { get; set; }
        public virtual string StatusName { get; set; }
        public virtual int MaxNumberOfUses { get; set; }
        public virtual int MaxNumberOfUsesPerCustomer { get; set; }
        public virtual int NumberOfUsesUsed { get; set; }
        public virtual int NumberOfUsesPerCustomerUsed { get; set; }
        public virtual List<DaysOfWeekResponse> DaysOfWeek { get; set; }
        public virtual List<RebateCodeServiceResponse> Services { get; set; }
        public virtual List<RebateCodeCustomerResponse> Customers { get; set; }
        public virtual List<RebateCodeTypeResponse> RebateCodeTypesOptions { get; set; }
        public virtual List<RebateCodeStatusResponse> RebateCodeStatusOptions { get; set; }
        public virtual ResponseStatus ResponseStatus { get; set; }
    }

    public partial class RebateCodeServiceResponse
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
        public virtual bool Active { get; set; }
    }

    public partial class RebateCodeStatusItem
    {
        public virtual int Id { get; set; }
        public virtual string RebateCodeStatusName { get; set; }
        public virtual string RebateCodeStatusDescription { get; set; }
    }

    public partial class RebateCodeStatusResponse
    {
        public RebateCodeStatusResponse()
        {
            RebateCodeStatusItems = new List<RebateCodeStatusItem>{};
        }

        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual List<RebateCodeStatusItem> RebateCodeStatusItems { get; set; }
    }

    public partial class RebateCodeTypeItem
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }
        public virtual string Description { get; set; }
    }

    public partial class RebateCodeTypeResponse
    {
        public RebateCodeTypeResponse()
        {
            RebateCodeTypeItems = new List<RebateCodeTypeItem>{};
        }

        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual List<RebateCodeTypeItem> RebateCodeTypeItems { get; set; }
    }

}

C# DeleteRebateCode DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

DELETE /rebatecodes/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	CompanyId: 00000000-0000-0000-0000-000000000000,
	FromTime: PT0S,
	ToTime: PT0S,
	CreatedBy: String,
	UpdatedBy: String,
	PersonalNote: String,
	RebateCodeSign: String,
	RebateCodeValue: 0,
	RebateCodeTypeId: 0,
	Name: String,
	RebateCodeStatusId: 0,
	StatusName: String,
	MaxNumberOfUses: 0,
	MaxNumberOfUsesPerCustomer: 0,
	NumberOfUsesUsed: 0,
	NumberOfUsesPerCustomerUsed: 0,
	DaysOfWeek: 
	[
		{
			Id: 0,
			DayOfWeek: String,
			DayOfWeekTranslation: String,
			DayOfWeekActive: False,
			DayOfWeekSortOrder: 0
		}
	],
	Services: 
	[
		{
			Id: 0,
			Name: String,
			Description: String,
			Active: False
		}
	],
	Customers: 
	[
		{
			Firstname: String,
			Lastname: String,
			Email: String,
			Phone: String,
			ImageUrl: String
		}
	],
	RebateCodeTypesOptions: 
	[
		{
			ResponseStatus: 
			{
				ErrorCode: String,
				Message: String,
				StackTrace: String,
				Errors: 
				[
					{
						ErrorCode: String,
						FieldName: String,
						Message: String,
						Meta: 
						{
							String: String
						}
					}
				],
				Meta: 
				{
					String: String
				}
			},
			RebateCodeTypeItems: 
			[
				{
					Id: 0,
					Name: String,
					Description: String
				}
			]
		}
	],
	RebateCodeStatusOptions: 
	[
		{
			ResponseStatus: 
			{
				ErrorCode: String,
				Message: String,
				StackTrace: String,
				Errors: 
				[
					{
						ErrorCode: String,
						FieldName: String,
						Message: String,
						Meta: 
						{
							String: String
						}
					}
				],
				Meta: 
				{
					String: String
				}
			},
			RebateCodeStatusItems: 
			[
				{
					Id: 0,
					RebateCodeStatusName: String,
					RebateCodeStatusDescription: String
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}