Mercedes.Agency.Orchestration.API

<back to all web services

ValidateVoucherCodeRequest

Voucher
Requires Authentication
The following routes are available for this service:
POST/v1/voucher/validateValidates 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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: application/json
Content-Type: application/json
Content-Length: length

{"CampaignId":0,"VoucherCode":"String","OrderGuid":"00000000000000000000000000000000","Vin":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"IsValid":false,"Message":"String"}