Hmx Accounts

<back to all web services

ValidateCoupon

The following routes are available for this service:
GET/api/coupons/validate/{code}Validate coupon
import 'package:servicestack/servicestack.dart';

class ValidateCouponResonse implements IConvertible
{
    bool? isValid;
    String? message;
    HttpStatusCode? status;

    ValidateCouponResonse({this.isValid,this.message,this.status});
    ValidateCouponResonse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        isValid = json['isValid'];
        message = json['message'];
        status = JsonConverters.fromJson(json['status'],'HttpStatusCode',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'isValid': isValid,
        'message': message,
        'status': JsonConverters.toJson(status,'HttpStatusCode',context!)
    };

    getTypeName() => "ValidateCouponResonse";
    TypeContext? context = _ctx;
}

class ValidateCoupon implements IConvertible
{
    String? code;

    ValidateCoupon({this.code});
    ValidateCoupon.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code
    };

    getTypeName() => "ValidateCoupon";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'accounts.dev.healthmonix.com', types: <String, TypeInfo> {
    'ValidateCouponResonse': TypeInfo(TypeOf.Class, create:() => ValidateCouponResonse()),
    'HttpStatusCode': TypeInfo(TypeOf.Class, create:() => HttpStatusCode()),
    'ValidateCoupon': TypeInfo(TypeOf.Class, create:() => ValidateCoupon()),
});

Dart ValidateCoupon DTOs

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

HTTP + CSV

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

GET /api/coupons/validate/{code} HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"isValid":false,"message":"String","status":"Continue"}