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

export class RebateCodeServiceResponse
{
    public Id: number;
    public Name: string;
    public Description: string;
    public Active: boolean;

    public constructor(init?: Partial<RebateCodeServiceResponse>) { (Object as any).assign(this, init); }
}

export class RebateCodeCustomerResponse
{
    public Id: string;
    public Firstname: string;
    public Lastname: string;
    public Email: string;
    public Phone: string;
    public ImageUrl: string;

    public constructor(init?: Partial<RebateCodeCustomerResponse>) { (Object as any).assign(this, init); }
}

export class RebateCodeTransactionQueryResponse
{
    public Id: number;
    public CompanyId: string;
    public Note: string;
    public RebateCodeId: number;
    public RebateCodeSign: string;
    public RebateCodeTypeId?: number;
    public RebateCodeTypeName: string;
    public Amount: number;
    public BookingId?: number;
    public UpdatedDate: string;
    public CreatedDate: string;
    public Service: RebateCodeServiceResponse;
    public Customer: RebateCodeCustomerResponse;
    public PriceSign: string;

    public constructor(init?: Partial<RebateCodeTransactionQueryResponse>) { (Object as any).assign(this, init); }
}

export class RebateCodeTransactionResponse
{
    public ResponseStatus: ResponseStatus;
    public RebateCodeTransactionItem: RebateCodeTransactionQueryResponse;

    public constructor(init?: Partial<RebateCodeTransactionResponse>) { (Object as any).assign(this, init); }
}

export enum AmountChangeType
{
    Increase = 'Increase',
    Decrease = 'Decrease',
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
export class CreateRebateCodeTransaction
{
    /** @description  */
    // @ApiMember(Description="", IsRequired=true)
    public CompanyId: string;

    /** @description Rebate code id to which you wish to add transaction */
    // @ApiMember(Description="Rebate code id to which you wish to add transaction", IsRequired=true)
    public RebateCodeId: number;

    // @ApiMember(IsRequired=true)
    public Amount: number;

    // @ApiMember(IsRequired=true)
    public Usage: number;

    // @ApiMember()
    public BookingId?: number;

    /** @description 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)
    public ChangeType: AmountChangeType;

    public constructor(init?: Partial<CreateRebateCodeTransaction>) { (Object as any).assign(this, init); }
}

TypeScript 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
	}
}