BokaMera.API.Host

<back to all web services

CreateRebateCodeTransaction

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/rebatecodes/transactionsCreate transaction for the rebate codeCreate transaction for the rebate code
import java.math.*
import java.util.*
import net.servicestack.client.*


@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
@ValidateRequest(Validator="IsAuthenticated")
open class CreateRebateCodeTransaction
{
    /**
    * 
    */
    @ApiMember(Description="", IsRequired=true)
    var CompanyId:UUID? = null

    /**
    * Rebate code id to which you wish to add transaction
    */
    @ApiMember(Description="Rebate code id to which you wish to add transaction", IsRequired=true)
    var RebateCodeId:Int? = null

    @ApiMember(IsRequired=true)
    var Amount:Double? = null

    @ApiMember(IsRequired=true)
    var Usage:Int? = null

    @ApiMember()
    var BookingId:Int? = null

    /**
    * If you want to Increase = 0 or Decrease = 1 the value
    */
    @ApiMember(Description="If you want to Increase = 0 or Decrease = 1 the value", IsRequired=true)
    var ChangeType:AmountChangeType? = null
}

enum class AmountChangeType
{
    Increase,
    Decrease,
}

open class RebateCodeTransactionResponse
{
    var ResponseStatus:ResponseStatus? = null
    var RebateCodeTransactionItem:RebateCodeTransactionQueryResponse? = null
}

open class RebateCodeTransactionQueryResponse
{
    var Id:Int? = null
    var CompanyId:UUID? = null
    var Note:String? = null
    var RebateCodeId:Int? = null
    var RebateCodeSign:String? = null
    var RebateCodeTypeId:Int? = null
    var RebateCodeTypeName:String? = null
    var Amount:Double? = null
    var BookingId:Int? = null
    var UpdatedDate:Date? = null
    var CreatedDate:Date? = null
    var Service:RebateCodeServiceResponse? = null
    var Customer:RebateCodeCustomerResponse? = null
    var PriceSign:String? = null
}

open class RebateCodeServiceResponse
{
    var Id:Int? = null
    var Name:String? = null
    var Description:String? = null
    var Active:Boolean? = null
}

open class RebateCodeCustomerResponse
{
    var Id:UUID? = null
    var Firstname:String? = null
    var Lastname:String? = null
    var Email:String? = null
    var Phone:String? = null
    var ImageUrl:String? = null
}

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

POST /rebatecodes/transactions HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	RebateCodeId: 0,
	Amount: 0,
	Usage: 0,
	BookingId: 0,
	ChangeType: Increase
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	RebateCodeTransactionItem: 
	{
		Id: 0,
		Note: String,
		RebateCodeId: 0,
		RebateCodeSign: String,
		RebateCodeTypeId: 0,
		RebateCodeTypeName: String,
		Amount: 0,
		BookingId: 0,
		Service: 
		{
			Id: 0,
			Name: String,
			Description: String,
			Active: False
		},
		Customer: 
		{
			Firstname: String,
			Lastname: String,
			Email: String,
			Phone: String,
			ImageUrl: String
		},
		PriceSign: String
	}
}