| POST | /v1/voucher/validate | Validates a voucher code for a campaign |
|---|
import 'package:servicestack/servicestack.dart';
class VoucherCodeValidationResponse implements IConvertible
{
bool IsValid;
String Message = "";
VoucherCodeValidationResponse({this.IsValid,this.Message});
VoucherCodeValidationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
IsValid = json['IsValid'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'IsValid': IsValid,
'Message': Message
};
getTypeName() => "VoucherCodeValidationResponse";
TypeContext? context = _ctx;
}
class ValidateVoucherCodeRequest implements IPost, IConvertible
{
int CampaignId = 0;
String VoucherCode = "";
String? OrderGuid;
String Vin = "";
ValidateVoucherCodeRequest({this.CampaignId,this.VoucherCode,this.OrderGuid,this.Vin});
ValidateVoucherCodeRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CampaignId = json['CampaignId'];
VoucherCode = json['VoucherCode'];
OrderGuid = json['OrderGuid'];
Vin = json['Vin'];
return this;
}
Map<String, dynamic> toJson() => {
'CampaignId': CampaignId,
'VoucherCode': VoucherCode,
'OrderGuid': OrderGuid,
'Vin': Vin
};
getTypeName() => "ValidateVoucherCodeRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'prod_api_agency_orch_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'VoucherCodeValidationResponse': TypeInfo(TypeOf.Class, create:() => VoucherCodeValidationResponse()),
'ValidateVoucherCodeRequest': TypeInfo(TypeOf.Class, create:() => ValidateVoucherCodeRequest()),
});
Dart ValidateVoucherCodeRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/voucher/validate HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CampaignId":0,"VoucherCode":"String","OrderGuid":"00000000000000000000000000000000","Vin":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"IsValid":false,"Message":"String"}