Billhighway Cloud API

<back to all web services

SubscriptionCreateRq

The following routes are available for this service:
POST/signup/api/nat/{natID}/group/{groupID}/subscription
POST/signup/api/nat/{natID}/group/{groupID}/{userType}/user/{userID}/subscription
import 'package:servicestack/servicestack.dart';

class SubscriberFormField implements IConvertible
{
    String? Name;
    String? Value;

    SubscriberFormField({this.Name,this.Value});
    SubscriberFormField.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class SubscriberFormData implements IConvertible
{
    int? FormTemplateID;
    int? SignupTypeID;
    List<SubscriberFormField>? FormFields;

    SubscriberFormData({this.FormTemplateID,this.SignupTypeID,this.FormFields});
    SubscriberFormData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FormTemplateID = json['FormTemplateID'];
        SignupTypeID = json['SignupTypeID'];
        FormFields = JsonConverters.fromJson(json['FormFields'],'List<SubscriberFormField>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FormTemplateID': FormTemplateID,
        'SignupTypeID': SignupTypeID,
        'FormFields': JsonConverters.toJson(FormFields,'List<SubscriberFormField>',context!)
    };

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

class SubscriptionInformation implements IConvertible
{
    int? FrequencyID;
    int? SubscriptionInvoiceID;
    bool? AutoRenew;
    bool? HasAgreedToTerms;
    String? ClientSubscriberId;
    int? RenewedMemberSubscriptionInvID;

    SubscriptionInformation({this.FrequencyID,this.SubscriptionInvoiceID,this.AutoRenew,this.HasAgreedToTerms,this.ClientSubscriberId,this.RenewedMemberSubscriptionInvID});
    SubscriptionInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FrequencyID = json['FrequencyID'];
        SubscriptionInvoiceID = json['SubscriptionInvoiceID'];
        AutoRenew = json['AutoRenew'];
        HasAgreedToTerms = json['HasAgreedToTerms'];
        ClientSubscriberId = json['ClientSubscriberId'];
        RenewedMemberSubscriptionInvID = json['RenewedMemberSubscriptionInvID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FrequencyID': FrequencyID,
        'SubscriptionInvoiceID': SubscriptionInvoiceID,
        'AutoRenew': AutoRenew,
        'HasAgreedToTerms': HasAgreedToTerms,
        'ClientSubscriberId': ClientSubscriberId,
        'RenewedMemberSubscriptionInvID': RenewedMemberSubscriptionInvID
    };

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

class ClientVerification implements IConvertible
{
    String? Provider;
    String? VerificationCode;

    ClientVerification({this.Provider,this.VerificationCode});
    ClientVerification.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CcPaymentInformation implements IConvertible
{
    String? CardNumber;
    String? Cvv;
    int? ExpMonth;
    int? ExpYear;
    String? CardholderName;
    String? Country;
    String? BillingAddress;
    String? Address1;
    String? Address2;
    String? City;
    String? StateProvince;
    String? PostalCode;

    CcPaymentInformation({this.CardNumber,this.Cvv,this.ExpMonth,this.ExpYear,this.CardholderName,this.Country,this.BillingAddress,this.Address1,this.Address2,this.City,this.StateProvince,this.PostalCode});
    CcPaymentInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CardNumber = json['CardNumber'];
        Cvv = json['Cvv'];
        ExpMonth = json['ExpMonth'];
        ExpYear = json['ExpYear'];
        CardholderName = json['CardholderName'];
        Country = json['Country'];
        BillingAddress = json['BillingAddress'];
        Address1 = json['Address1'];
        Address2 = json['Address2'];
        City = json['City'];
        StateProvince = json['StateProvince'];
        PostalCode = json['PostalCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CardNumber': CardNumber,
        'Cvv': Cvv,
        'ExpMonth': ExpMonth,
        'ExpYear': ExpYear,
        'CardholderName': CardholderName,
        'Country': Country,
        'BillingAddress': BillingAddress,
        'Address1': Address1,
        'Address2': Address2,
        'City': City,
        'StateProvince': StateProvince,
        'PostalCode': PostalCode
    };

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

class AchPaymentInformation implements IConvertible
{
    String? AccountHolderName;
    String? CheckNumber;
    String? RoutingNumber;
    String? AccountNumber;
    String? AccountType;

    AchPaymentInformation({this.AccountHolderName,this.CheckNumber,this.RoutingNumber,this.AccountNumber,this.AccountType});
    AchPaymentInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        AccountHolderName = json['AccountHolderName'];
        CheckNumber = json['CheckNumber'];
        RoutingNumber = json['RoutingNumber'];
        AccountNumber = json['AccountNumber'];
        AccountType = json['AccountType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'AccountHolderName': AccountHolderName,
        'CheckNumber': CheckNumber,
        'RoutingNumber': RoutingNumber,
        'AccountNumber': AccountNumber,
        'AccountType': AccountType
    };

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

class CampaignInformation implements IConvertible
{
    int? CampaignId;
    String? CampaignName;
    double? Amount;
    String? ChapPayID;

    CampaignInformation({this.CampaignId,this.CampaignName,this.Amount,this.ChapPayID});
    CampaignInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CampaignId = json['CampaignId'];
        CampaignName = json['CampaignName'];
        Amount = JsonConverters.toDouble(json['Amount']);
        ChapPayID = json['ChapPayID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CampaignId': CampaignId,
        'CampaignName': CampaignName,
        'Amount': Amount,
        'ChapPayID': ChapPayID
    };

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

class BillMeLaterInformation implements IConvertible
{
    bool? IsBillMeLaterPayment;
    bool? IsBillMeLaterSubscription;
    int? MemberSubscriptionInvId;
    List<CampaignInformation>? Campaigns;

    BillMeLaterInformation({this.IsBillMeLaterPayment,this.IsBillMeLaterSubscription,this.MemberSubscriptionInvId,this.Campaigns});
    BillMeLaterInformation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        IsBillMeLaterPayment = json['IsBillMeLaterPayment'];
        IsBillMeLaterSubscription = json['IsBillMeLaterSubscription'];
        MemberSubscriptionInvId = json['MemberSubscriptionInvId'];
        Campaigns = JsonConverters.fromJson(json['Campaigns'],'List<CampaignInformation>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'IsBillMeLaterPayment': IsBillMeLaterPayment,
        'IsBillMeLaterSubscription': IsBillMeLaterSubscription,
        'MemberSubscriptionInvId': MemberSubscriptionInvId,
        'Campaigns': JsonConverters.toJson(Campaigns,'List<CampaignInformation>',context!)
    };

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

class SubscriptionCreateRq implements IConvertible
{
    int? NatID;
    int? GroupID;
    String? ClientGroupID;
    String? UserType;
    String? UserID;
    SubscriberFormData? FormData;
    SubscriptionInformation? SubscriptionInfo;
    ClientVerification? VerificationInfo;
    CcPaymentInformation? CcPaymentInfo;
    AchPaymentInformation? AchPaymentInfo;
    BillMeLaterInformation? BillMeLater;
    List<CampaignInformation>? Campaigns;

    SubscriptionCreateRq({this.NatID,this.GroupID,this.ClientGroupID,this.UserType,this.UserID,this.FormData,this.SubscriptionInfo,this.VerificationInfo,this.CcPaymentInfo,this.AchPaymentInfo,this.BillMeLater,this.Campaigns});
    SubscriptionCreateRq.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        NatID = json['NatID'];
        GroupID = json['GroupID'];
        ClientGroupID = json['ClientGroupID'];
        UserType = json['UserType'];
        UserID = json['UserID'];
        FormData = JsonConverters.fromJson(json['FormData'],'SubscriberFormData',context!);
        SubscriptionInfo = JsonConverters.fromJson(json['SubscriptionInfo'],'SubscriptionInformation',context!);
        VerificationInfo = JsonConverters.fromJson(json['VerificationInfo'],'ClientVerification',context!);
        CcPaymentInfo = JsonConverters.fromJson(json['CcPaymentInfo'],'CcPaymentInformation',context!);
        AchPaymentInfo = JsonConverters.fromJson(json['AchPaymentInfo'],'AchPaymentInformation',context!);
        BillMeLater = JsonConverters.fromJson(json['BillMeLater'],'BillMeLaterInformation',context!);
        Campaigns = JsonConverters.fromJson(json['Campaigns'],'List<CampaignInformation>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'NatID': NatID,
        'GroupID': GroupID,
        'ClientGroupID': ClientGroupID,
        'UserType': UserType,
        'UserID': UserID,
        'FormData': JsonConverters.toJson(FormData,'SubscriberFormData',context!),
        'SubscriptionInfo': JsonConverters.toJson(SubscriptionInfo,'SubscriptionInformation',context!),
        'VerificationInfo': JsonConverters.toJson(VerificationInfo,'ClientVerification',context!),
        'CcPaymentInfo': JsonConverters.toJson(CcPaymentInfo,'CcPaymentInformation',context!),
        'AchPaymentInfo': JsonConverters.toJson(AchPaymentInfo,'AchPaymentInformation',context!),
        'BillMeLater': JsonConverters.toJson(BillMeLater,'BillMeLaterInformation',context!),
        'Campaigns': JsonConverters.toJson(Campaigns,'List<CampaignInformation>',context!)
    };

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

class SubscriptionCreateRs implements IConvertible
{
    bool? IsSuccess;
    String? UniqueId;
    DateTime? CreatedDateTime;
    int? ClientId;
    int? BillhighwayUserId;
    String? ConfirmationNumber;
    int? PaymentConfirmationNumber;
    int? SubscriptionConfirmationNumber;
    String? ErrorCode;
    String? Message;
    String? FriendlyMessage;

    SubscriptionCreateRs({this.IsSuccess,this.UniqueId,this.CreatedDateTime,this.ClientId,this.BillhighwayUserId,this.ConfirmationNumber,this.PaymentConfirmationNumber,this.SubscriptionConfirmationNumber,this.ErrorCode,this.Message,this.FriendlyMessage});
    SubscriptionCreateRs.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        IsSuccess = json['IsSuccess'];
        UniqueId = json['UniqueId'];
        CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
        ClientId = json['ClientId'];
        BillhighwayUserId = json['BillhighwayUserId'];
        ConfirmationNumber = json['ConfirmationNumber'];
        PaymentConfirmationNumber = json['PaymentConfirmationNumber'];
        SubscriptionConfirmationNumber = json['SubscriptionConfirmationNumber'];
        ErrorCode = json['ErrorCode'];
        Message = json['Message'];
        FriendlyMessage = json['FriendlyMessage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'IsSuccess': IsSuccess,
        'UniqueId': UniqueId,
        'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
        'ClientId': ClientId,
        'BillhighwayUserId': BillhighwayUserId,
        'ConfirmationNumber': ConfirmationNumber,
        'PaymentConfirmationNumber': PaymentConfirmationNumber,
        'SubscriptionConfirmationNumber': SubscriptionConfirmationNumber,
        'ErrorCode': ErrorCode,
        'Message': Message,
        'FriendlyMessage': FriendlyMessage
    };

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

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'SubscriberFormField': TypeInfo(TypeOf.Class, create:() => SubscriberFormField()),
    'SubscriberFormData': TypeInfo(TypeOf.Class, create:() => SubscriberFormData()),
    'List<SubscriberFormField>': TypeInfo(TypeOf.Class, create:() => <SubscriberFormField>[]),
    'SubscriptionInformation': TypeInfo(TypeOf.Class, create:() => SubscriptionInformation()),
    'ClientVerification': TypeInfo(TypeOf.Class, create:() => ClientVerification()),
    'CcPaymentInformation': TypeInfo(TypeOf.Class, create:() => CcPaymentInformation()),
    'AchPaymentInformation': TypeInfo(TypeOf.Class, create:() => AchPaymentInformation()),
    'CampaignInformation': TypeInfo(TypeOf.Class, create:() => CampaignInformation()),
    'BillMeLaterInformation': TypeInfo(TypeOf.Class, create:() => BillMeLaterInformation()),
    'List<CampaignInformation>': TypeInfo(TypeOf.Class, create:() => <CampaignInformation>[]),
    'SubscriptionCreateRq': TypeInfo(TypeOf.Class, create:() => SubscriptionCreateRq()),
    'SubscriptionCreateRs': TypeInfo(TypeOf.Class, create:() => SubscriptionCreateRs()),
});

Dart SubscriptionCreateRq 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 /signup/api/nat/{natID}/group/{groupID}/subscription HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	NatID: 0,
	GroupID: 0,
	ClientGroupID: String,
	UserType: String,
	UserID: String,
	FormData: 
	{
		FormTemplateID: 0,
		SignupTypeID: 0,
		FormFields: 
		[
			{
				FormTemplateFieldID: 0,
				Name: String,
				Value: String
			}
		]
	},
	SubscriptionInfo: 
	{
		FrequencyID: 0,
		SubscriptionInvoiceID: 0,
		AutoRenew: False,
		HasAgreedToTerms: False,
		ClientSubscriberId: String,
		RenewedMemberSubscriptionInvID: 0
	},
	VerificationInfo: 
	{
		Provider: String,
		VerificationCode: String
	},
	CcPaymentInfo: 
	{
		CardNumber: String,
		Cvv: String,
		ExpMonth: 0,
		ExpYear: 0,
		CardholderName: String,
		Country: String,
		BillingAddress: String,
		Address1: String,
		Address2: String,
		City: String,
		StateProvince: String,
		PostalCode: String
	},
	AchPaymentInfo: 
	{
		AccountHolderName: String,
		CheckNumber: String,
		RoutingNumber: String,
		AccountNumber: String,
		AccountType: String
	},
	BillMeLater: 
	{
		IsBillMeLaterPayment: False,
		IsBillMeLaterSubscription: False,
		MemberSubscriptionInvId: 0,
		Campaigns: 
		[
			{
				CampaignId: 0,
				CampaignName: String,
				Amount: 0,
				ChapPayID: String
			}
		]
	},
	Campaigns: 
	[
		{
			CampaignId: 0,
			CampaignName: String,
			Amount: 0,
			ChapPayID: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	IsSuccess: False,
	UniqueId: String,
	CreatedDateTime: 0001-01-01,
	ClientId: 0,
	BillhighwayUserId: 0,
	ConfirmationNumber: String,
	PaymentConfirmationNumber: 0,
	SubscriptionConfirmationNumber: 0,
	ErrorCode: String,
	Message: String,
	FriendlyMessage: String
}