ServiceStack Home (Live)

<back to all web services

PurchaseSubscription

The following routes are available for this service:
POST/PurchaseSubscription
import 'package:servicestack/servicestack.dart';

class Subscriptions implements IConvertible
{
    String? section;
    bool? success;
    bool? activated;
    int? purchasedOrderId;

    Subscriptions({this.section,this.success,this.activated,this.purchasedOrderId});
    Subscriptions.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        section = json['section'];
        success = json['success'];
        activated = json['activated'];
        purchasedOrderId = json['purchasedOrderId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'section': section,
        'success': success,
        'activated': activated,
        'purchasedOrderId': purchasedOrderId
    };

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

class PurchaseSubscription implements ICardInfo, IAddress, IConvertible
{
    String? code;
    String? coupon;
    String? renewalRef;
    String? upgradeRef;
    int? quantity;
    String? userAuthId;
    int? skuId;
    bool? isSmallCompany;
    bool? isNonProfit;
    bool? agreeTerms;
    String? firstName;
    String? lastName;
    String? email;
    String? password;
    String? company;
    String? phoneNumber;
    String? addressLine1;
    String? addressLine2;
    String? addressCity;
    String? addressZip;
    String? addressState;
    String? addressCountry;
    String? licenseName;
    String? licenseEmail;
    String? licenseAddress;
    String? cardNumber;
    String? cvc;
    int? expMonth;
    int? expYear;
    String? notes;

    PurchaseSubscription({this.code,this.coupon,this.renewalRef,this.upgradeRef,this.quantity,this.userAuthId,this.skuId,this.isSmallCompany,this.isNonProfit,this.agreeTerms,this.firstName,this.lastName,this.email,this.password,this.company,this.phoneNumber,this.addressLine1,this.addressLine2,this.addressCity,this.addressZip,this.addressState,this.addressCountry,this.licenseName,this.licenseEmail,this.licenseAddress,this.cardNumber,this.cvc,this.expMonth,this.expYear,this.notes});
    PurchaseSubscription.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        coupon = json['coupon'];
        renewalRef = json['renewalRef'];
        upgradeRef = json['upgradeRef'];
        quantity = json['quantity'];
        userAuthId = json['userAuthId'];
        skuId = json['skuId'];
        isSmallCompany = json['isSmallCompany'];
        isNonProfit = json['isNonProfit'];
        agreeTerms = json['agreeTerms'];
        firstName = json['firstName'];
        lastName = json['lastName'];
        email = json['email'];
        password = json['password'];
        company = json['company'];
        phoneNumber = json['phoneNumber'];
        addressLine1 = json['addressLine1'];
        addressLine2 = json['addressLine2'];
        addressCity = json['addressCity'];
        addressZip = json['addressZip'];
        addressState = json['addressState'];
        addressCountry = json['addressCountry'];
        licenseName = json['licenseName'];
        licenseEmail = json['licenseEmail'];
        licenseAddress = json['licenseAddress'];
        cardNumber = json['cardNumber'];
        cvc = json['cvc'];
        expMonth = json['expMonth'];
        expYear = json['expYear'];
        notes = json['notes'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'coupon': coupon,
        'renewalRef': renewalRef,
        'upgradeRef': upgradeRef,
        'quantity': quantity,
        'userAuthId': userAuthId,
        'skuId': skuId,
        'isSmallCompany': isSmallCompany,
        'isNonProfit': isNonProfit,
        'agreeTerms': agreeTerms,
        'firstName': firstName,
        'lastName': lastName,
        'email': email,
        'password': password,
        'company': company,
        'phoneNumber': phoneNumber,
        'addressLine1': addressLine1,
        'addressLine2': addressLine2,
        'addressCity': addressCity,
        'addressZip': addressZip,
        'addressState': addressState,
        'addressCountry': addressCountry,
        'licenseName': licenseName,
        'licenseEmail': licenseEmail,
        'licenseAddress': licenseAddress,
        'cardNumber': cardNumber,
        'cvc': cvc,
        'expMonth': expMonth,
        'expYear': expYear,
        'notes': notes
    };

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

TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
    'Subscriptions': TypeInfo(TypeOf.Class, create:() => Subscriptions()),
    'PurchaseSubscription': TypeInfo(TypeOf.Class, create:() => PurchaseSubscription()),
});

Dart PurchaseSubscription 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 /PurchaseSubscription HTTP/1.1 
Host: account.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	code: String,
	coupon: String,
	renewalRef: String,
	upgradeRef: String,
	quantity: 0,
	userAuthId: String,
	skuId: 0,
	isSmallCompany: False,
	isNonProfit: False,
	agreeTerms: False,
	firstName: String,
	lastName: String,
	email: String,
	password: String,
	company: String,
	phoneNumber: String,
	addressLine1: String,
	addressLine2: String,
	addressCity: String,
	addressZip: String,
	addressState: String,
	addressCountry: String,
	licenseName: String,
	licenseEmail: String,
	licenseAddress: String,
	cardNumber: String,
	cvc: String,
	expMonth: 0,
	expYear: 0,
	notes: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	section: String,
	success: False,
	activated: False,
	purchasedOrderId: 0
}