ServiceStack Home (Live)

<back to all web services

Subscriptions

Requires Authentication
The following routes are available for this service:
All Verbs/account/subscription
GET/Subscriptions
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class Subscriptions
    {
        public String section = null;
        public Boolean success = null;
        public Boolean activated = null;
        public Integer purchasedOrderId = null;
        
        public String getSection() { return section; }
        public Subscriptions setSection(String value) { this.section = value; return this; }
        public Boolean isSuccess() { return success; }
        public Subscriptions setSuccess(Boolean value) { this.success = value; return this; }
        public Boolean isActivated() { return activated; }
        public Subscriptions setActivated(Boolean value) { this.activated = value; return this; }
        public Integer getPurchasedOrderId() { return purchasedOrderId; }
        public Subscriptions setPurchasedOrderId(Integer value) { this.purchasedOrderId = value; return this; }
    }

    public static class SubscriptionsResponse
    {
        public String section = null;
        public Integer supportQuantity = null;
        public Sku activeSku = null;
        public Subscription activeSubscription = null;
        public ArrayList<Subscription> inActiveSubscriptions = null;
        public OrderAnalyticData purchasedOrder = null;
        public ResponseStatus responseStatus = null;
        
        public String getSection() { return section; }
        public SubscriptionsResponse setSection(String value) { this.section = value; return this; }
        public Integer getSupportQuantity() { return supportQuantity; }
        public SubscriptionsResponse setSupportQuantity(Integer value) { this.supportQuantity = value; return this; }
        public Sku getActiveSku() { return activeSku; }
        public SubscriptionsResponse setActiveSku(Sku value) { this.activeSku = value; return this; }
        public Subscription getActiveSubscription() { return activeSubscription; }
        public SubscriptionsResponse setActiveSubscription(Subscription value) { this.activeSubscription = value; return this; }
        public ArrayList<Subscription> getInActiveSubscriptions() { return inActiveSubscriptions; }
        public SubscriptionsResponse setInActiveSubscriptions(ArrayList<Subscription> value) { this.inActiveSubscriptions = value; return this; }
        public OrderAnalyticData getPurchasedOrder() { return purchasedOrder; }
        public SubscriptionsResponse setPurchasedOrder(OrderAnalyticData value) { this.purchasedOrder = value; return this; }
        public ResponseStatus getResponseStatus() { return responseStatus; }
        public SubscriptionsResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
    }

    public static class Sku
    {
        public Integer id = null;
        public Integer productId = null;
        public SkuType type = null;
        public LicenseFeature feature = null;
        public String code = null;
        public String name = null;
        public String notes = null;
        @Ignore()
        public Integer minQty = null;

        public Integer maxQty = null;
        public Integer price = null;
        public String plan = null;
        public Integer discountOff = null;
        public String discountLabelOff = null;
        public Integer actualPrice = null;
        public Boolean isPlan = null;
        public Boolean isRenewal = null;
        public Integer subscriptionDurationDays = null;
        public Integer expiryDurationDays = null;
        public Integer trialPeriodDays = null;
        public Integer supportQty = null;
        public Integer coresQty = null;
        public Date createdDate = null;
        public Date modifiedDate = null;
        public LicenseType licenseType = null;
        public Boolean active = null;
        
        public Integer getId() { return id; }
        public Sku setId(Integer value) { this.id = value; return this; }
        public Integer getProductId() { return productId; }
        public Sku setProductId(Integer value) { this.productId = value; return this; }
        public SkuType getType() { return type; }
        public Sku setType(SkuType value) { this.type = value; return this; }
        public LicenseFeature getFeature() { return feature; }
        public Sku setFeature(LicenseFeature value) { this.feature = value; return this; }
        public String getCode() { return code; }
        public Sku setCode(String value) { this.code = value; return this; }
        public String getName() { return name; }
        public Sku setName(String value) { this.name = value; return this; }
        public String getNotes() { return notes; }
        public Sku setNotes(String value) { this.notes = value; return this; }
        public Integer getMinQty() { return minQty; }
        public Sku setMinQty(Integer value) { this.minQty = value; return this; }
        public Integer getMaxQty() { return maxQty; }
        public Sku setMaxQty(Integer value) { this.maxQty = value; return this; }
        public Integer getPrice() { return price; }
        public Sku setPrice(Integer value) { this.price = value; return this; }
        public String getPlan() { return plan; }
        public Sku setPlan(String value) { this.plan = value; return this; }
        public Integer getDiscountOff() { return discountOff; }
        public Sku setDiscountOff(Integer value) { this.discountOff = value; return this; }
        public String getDiscountLabelOff() { return discountLabelOff; }
        public Sku setDiscountLabelOff(String value) { this.discountLabelOff = value; return this; }
        public Integer getActualPrice() { return actualPrice; }
        public Sku setActualPrice(Integer value) { this.actualPrice = value; return this; }
        public Boolean getIsPlan() { return isPlan; }
        public Sku setIsPlan(Boolean value) { this.isPlan = value; return this; }
        public Boolean getIsRenewal() { return isRenewal; }
        public Sku setIsRenewal(Boolean value) { this.isRenewal = value; return this; }
        public Integer getSubscriptionDurationDays() { return subscriptionDurationDays; }
        public Sku setSubscriptionDurationDays(Integer value) { this.subscriptionDurationDays = value; return this; }
        public Integer getExpiryDurationDays() { return expiryDurationDays; }
        public Sku setExpiryDurationDays(Integer value) { this.expiryDurationDays = value; return this; }
        public Integer getTrialPeriodDays() { return trialPeriodDays; }
        public Sku setTrialPeriodDays(Integer value) { this.trialPeriodDays = value; return this; }
        public Integer getSupportQty() { return supportQty; }
        public Sku setSupportQty(Integer value) { this.supportQty = value; return this; }
        public Integer getCoresQty() { return coresQty; }
        public Sku setCoresQty(Integer value) { this.coresQty = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public Sku setCreatedDate(Date value) { this.createdDate = value; return this; }
        public Date getModifiedDate() { return modifiedDate; }
        public Sku setModifiedDate(Date value) { this.modifiedDate = value; return this; }
        public LicenseType getLicenseType() { return licenseType; }
        public Sku setLicenseType(LicenseType value) { this.licenseType = value; return this; }
        public Boolean isActive() { return active; }
        public Sku setActive(Boolean value) { this.active = value; return this; }
    }

    public static enum SkuType
    {
        Product,
        PerDev,
        PerCore,
        Site,
        Support,
        Training,
        Register,
        Payment;
    }

    @Flags()
    public static enum LicenseFeature
    {
        @SerializedName("0") None(0),
        @SerializedName("0") Free(0),
        @SerializedName("1") Premium(1),
        @SerializedName("2") Text(2),
        @SerializedName("4") Client(4),
        @SerializedName("8") Common(8),
        @SerializedName("16") Redis(16),
        @SerializedName("18") RedisSku(18),
        @SerializedName("32") OrmLite(32),
        @SerializedName("34") OrmLiteSku(34),
        @SerializedName("64") ServiceStack(64),
        @SerializedName("128") Server(128),
        @SerializedName("256") Razor(256),
        @SerializedName("512") Admin(512),
        @SerializedName("1024") Aws(1024),
        @SerializedName("1026") AwsSku(1026),
        @SerializedName("2047") All(2047);

        private final int value;
        LicenseFeature(final int intValue) { value = intValue; }
        public int getValue() { return value; }
    }

    public static enum LicenseType
    {
        Free,
        FreeIndividual,
        FreeOpenSource,
        Indie,
        Business,
        Enterprise,
        TextIndie,
        TextBusiness,
        OrmLiteIndie,
        OrmLiteBusiness,
        RedisIndie,
        RedisBusiness,
        AwsIndie,
        AwsBusiness,
        Trial,
        Site,
        TextSite,
        RedisSite,
        OrmLiteSite;
    }

    public static class Subscription
    {
        public Integer id = null;
        public Integer customerId = null;
        public String email = null;
        public Integer skuId = null;
        public String skuName = null;
        public SkuType skuType = null;
        public String code = null;
        public Integer quantity = null;
        public Integer supportQuantity = null;
        public Integer total = null;
        public Boolean isPlan = null;
        public Boolean isRenewal = null;
        public Integer subscriptionDurationDays = null;
        public Date renewalDate = null;
        public String licenseRef = null;
        public String licenseName = null;
        public String licenseAddress = null;
        public LicenseType licenseType = null;
        public Date expiryDate = null;
        public LicenseKey licenseKey = null;
        public String licenseKeyText = null;
        public Date createdDate = null;
        public Date modifiedDate = null;
        public Date cancelledDate = null;
        public String stripeSubscriptionId = null;
        public Integer emailId = null;
        public Integer emailRenewalId = null;
        public Integer emailExpiredId = null;
        public Integer renewalSubscriptionId = null;
        public String externalRef = null;
        public String notes = null;
        public String error = null;
        
        public Integer getId() { return id; }
        public Subscription setId(Integer value) { this.id = value; return this; }
        public Integer getCustomerId() { return customerId; }
        public Subscription setCustomerId(Integer value) { this.customerId = value; return this; }
        public String getEmail() { return email; }
        public Subscription setEmail(String value) { this.email = value; return this; }
        public Integer getSkuId() { return skuId; }
        public Subscription setSkuId(Integer value) { this.skuId = value; return this; }
        public String getSkuName() { return skuName; }
        public Subscription setSkuName(String value) { this.skuName = value; return this; }
        public SkuType getSkuType() { return skuType; }
        public Subscription setSkuType(SkuType value) { this.skuType = value; return this; }
        public String getCode() { return code; }
        public Subscription setCode(String value) { this.code = value; return this; }
        public Integer getQuantity() { return quantity; }
        public Subscription setQuantity(Integer value) { this.quantity = value; return this; }
        public Integer getSupportQuantity() { return supportQuantity; }
        public Subscription setSupportQuantity(Integer value) { this.supportQuantity = value; return this; }
        public Integer getTotal() { return total; }
        public Subscription setTotal(Integer value) { this.total = value; return this; }
        public Boolean getIsPlan() { return isPlan; }
        public Subscription setIsPlan(Boolean value) { this.isPlan = value; return this; }
        public Boolean getIsRenewal() { return isRenewal; }
        public Subscription setIsRenewal(Boolean value) { this.isRenewal = value; return this; }
        public Integer getSubscriptionDurationDays() { return subscriptionDurationDays; }
        public Subscription setSubscriptionDurationDays(Integer value) { this.subscriptionDurationDays = value; return this; }
        public Date getRenewalDate() { return renewalDate; }
        public Subscription setRenewalDate(Date value) { this.renewalDate = value; return this; }
        public String getLicenseRef() { return licenseRef; }
        public Subscription setLicenseRef(String value) { this.licenseRef = value; return this; }
        public String getLicenseName() { return licenseName; }
        public Subscription setLicenseName(String value) { this.licenseName = value; return this; }
        public String getLicenseAddress() { return licenseAddress; }
        public Subscription setLicenseAddress(String value) { this.licenseAddress = value; return this; }
        public LicenseType getLicenseType() { return licenseType; }
        public Subscription setLicenseType(LicenseType value) { this.licenseType = value; return this; }
        public Date getExpiryDate() { return expiryDate; }
        public Subscription setExpiryDate(Date value) { this.expiryDate = value; return this; }
        public LicenseKey getLicenseKey() { return licenseKey; }
        public Subscription setLicenseKey(LicenseKey value) { this.licenseKey = value; return this; }
        public String getLicenseKeyText() { return licenseKeyText; }
        public Subscription setLicenseKeyText(String value) { this.licenseKeyText = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public Subscription setCreatedDate(Date value) { this.createdDate = value; return this; }
        public Date getModifiedDate() { return modifiedDate; }
        public Subscription setModifiedDate(Date value) { this.modifiedDate = value; return this; }
        public Date getCancelledDate() { return cancelledDate; }
        public Subscription setCancelledDate(Date value) { this.cancelledDate = value; return this; }
        public String getStripeSubscriptionId() { return stripeSubscriptionId; }
        public Subscription setStripeSubscriptionId(String value) { this.stripeSubscriptionId = value; return this; }
        public Integer getEmailId() { return emailId; }
        public Subscription setEmailId(Integer value) { this.emailId = value; return this; }
        public Integer getEmailRenewalId() { return emailRenewalId; }
        public Subscription setEmailRenewalId(Integer value) { this.emailRenewalId = value; return this; }
        public Integer getEmailExpiredId() { return emailExpiredId; }
        public Subscription setEmailExpiredId(Integer value) { this.emailExpiredId = value; return this; }
        public Integer getRenewalSubscriptionId() { return renewalSubscriptionId; }
        public Subscription setRenewalSubscriptionId(Integer value) { this.renewalSubscriptionId = value; return this; }
        public String getExternalRef() { return externalRef; }
        public Subscription setExternalRef(String value) { this.externalRef = value; return this; }
        public String getNotes() { return notes; }
        public Subscription setNotes(String value) { this.notes = value; return this; }
        public String getError() { return error; }
        public Subscription setError(String value) { this.error = value; return this; }
    }

    public static class LicenseKey
    {
        public String ref = null;
        public String name = null;
        public LicenseType type = null;
        public Long meta = null;
        public String hash = null;
        public String halg = null;
        public Date expiry = null;
        
        public String getRef() { return ref; }
        public LicenseKey setRef(String value) { this.ref = value; return this; }
        public String getName() { return name; }
        public LicenseKey setName(String value) { this.name = value; return this; }
        public LicenseType getType() { return type; }
        public LicenseKey setType(LicenseType value) { this.type = value; return this; }
        public Long getMeta() { return meta; }
        public LicenseKey setMeta(Long value) { this.meta = value; return this; }
        public String getHash() { return hash; }
        public LicenseKey setHash(String value) { this.hash = value; return this; }
        public String getHalg() { return halg; }
        public LicenseKey setHalg(String value) { this.halg = value; return this; }
        public Date getExpiry() { return expiry; }
        public LicenseKey setExpiry(Date value) { this.expiry = value; return this; }
    }

    public static class OrderAnalyticData
    {
        public String productName = null;
        public Integer subTotal = null;
        public String couponId = null;
        public Integer discount = null;
        public Integer tax = null;
        public Integer total = null;
        public Boolean paid = null;
        public Date createdDate = null;
        public Date modifiedDate = null;
        public String modifiedBy = null;
        public Date cancelledDate = null;
        public String cancelledReason = null;
        public ArrayList<OrderDetail> orderDetails = null;
        
        public String getProductName() { return productName; }
        public OrderAnalyticData setProductName(String value) { this.productName = value; return this; }
        public Integer getSubTotal() { return subTotal; }
        public OrderAnalyticData setSubTotal(Integer value) { this.subTotal = value; return this; }
        public String getCouponId() { return couponId; }
        public OrderAnalyticData setCouponId(String value) { this.couponId = value; return this; }
        public Integer getDiscount() { return discount; }
        public OrderAnalyticData setDiscount(Integer value) { this.discount = value; return this; }
        public Integer getTax() { return tax; }
        public OrderAnalyticData setTax(Integer value) { this.tax = value; return this; }
        public Integer getTotal() { return total; }
        public OrderAnalyticData setTotal(Integer value) { this.total = value; return this; }
        public Boolean isPaid() { return paid; }
        public OrderAnalyticData setPaid(Boolean value) { this.paid = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public OrderAnalyticData setCreatedDate(Date value) { this.createdDate = value; return this; }
        public Date getModifiedDate() { return modifiedDate; }
        public OrderAnalyticData setModifiedDate(Date value) { this.modifiedDate = value; return this; }
        public String getModifiedBy() { return modifiedBy; }
        public OrderAnalyticData setModifiedBy(String value) { this.modifiedBy = value; return this; }
        public Date getCancelledDate() { return cancelledDate; }
        public OrderAnalyticData setCancelledDate(Date value) { this.cancelledDate = value; return this; }
        public String getCancelledReason() { return cancelledReason; }
        public OrderAnalyticData setCancelledReason(String value) { this.cancelledReason = value; return this; }
        public ArrayList<OrderDetail> getOrderDetails() { return orderDetails; }
        public OrderAnalyticData setOrderDetails(ArrayList<OrderDetail> value) { this.orderDetails = value; return this; }
    }

    public static class OrderDetail
    {
        public Integer id = null;
        public Integer orderId = null;
        public Integer skuId = null;
        public SkuType skuType = null;
        public Integer price = null;
        public String description = null;
        public Integer quantity = null;
        public Integer total = null;
        
        public Integer getId() { return id; }
        public OrderDetail setId(Integer value) { this.id = value; return this; }
        public Integer getOrderId() { return orderId; }
        public OrderDetail setOrderId(Integer value) { this.orderId = value; return this; }
        public Integer getSkuId() { return skuId; }
        public OrderDetail setSkuId(Integer value) { this.skuId = value; return this; }
        public SkuType getSkuType() { return skuType; }
        public OrderDetail setSkuType(SkuType value) { this.skuType = value; return this; }
        public Integer getPrice() { return price; }
        public OrderDetail setPrice(Integer value) { this.price = value; return this; }
        public String getDescription() { return description; }
        public OrderDetail setDescription(String value) { this.description = value; return this; }
        public Integer getQuantity() { return quantity; }
        public OrderDetail setQuantity(Integer value) { this.quantity = value; return this; }
        public Integer getTotal() { return total; }
        public OrderDetail setTotal(Integer value) { this.total = value; return this; }
    }

}

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

{
	section: String,
	success: False,
	activated: False,
	purchasedOrderId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	section: String,
	supportQuantity: 0,
	activeSku: 
	{
		id: 0,
		productId: 0,
		type: Product,
		feature: 0,
		code: String,
		name: String,
		notes: String,
		maxQty: 0,
		price: 0,
		plan: String,
		discountOff: 0,
		discountLabelOff: String,
		actualPrice: 0,
		isPlan: False,
		isRenewal: False,
		subscriptionDurationDays: 0,
		expiryDurationDays: 0,
		trialPeriodDays: 0,
		supportQty: 0,
		coresQty: 0,
		createdDate: 0001-01-01,
		modifiedDate: 0001-01-01,
		licenseType: Free,
		active: False
	},
	activeSubscription: 
	{
		id: 0,
		customerId: 0,
		email: String,
		skuId: 0,
		skuName: String,
		skuType: Product,
		code: String,
		quantity: 0,
		supportQuantity: 0,
		total: 0,
		isPlan: False,
		isRenewal: False,
		subscriptionDurationDays: 0,
		renewalDate: 0001-01-01,
		licenseRef: String,
		licenseName: String,
		licenseAddress: String,
		licenseType: Free,
		expiryDate: 0001-01-01,
		licenseKey: 
		{
			ref: String,
			name: String,
			type: Free,
			meta: 0,
			hash: String,
			halg: String,
			expiry: 0001-01-01
		},
		licenseKeyText: String,
		createdDate: 0001-01-01,
		modifiedDate: 0001-01-01,
		cancelledDate: 0001-01-01,
		stripeSubscriptionId: String,
		emailId: 0,
		emailRenewalId: 0,
		emailExpiredId: 0,
		renewalSubscriptionId: 0,
		externalRef: String,
		notes: String,
		error: String
	},
	inActiveSubscriptions: 
	[
		{
			id: 0,
			customerId: 0,
			email: String,
			skuId: 0,
			skuName: String,
			skuType: Product,
			code: String,
			quantity: 0,
			supportQuantity: 0,
			total: 0,
			isPlan: False,
			isRenewal: False,
			subscriptionDurationDays: 0,
			renewalDate: 0001-01-01,
			licenseRef: String,
			licenseName: String,
			licenseAddress: String,
			licenseType: Free,
			expiryDate: 0001-01-01,
			licenseKey: 
			{
				ref: String,
				name: String,
				type: Free,
				meta: 0,
				hash: String,
				halg: String,
				expiry: 0001-01-01
			},
			licenseKeyText: String,
			createdDate: 0001-01-01,
			modifiedDate: 0001-01-01,
			cancelledDate: 0001-01-01,
			stripeSubscriptionId: String,
			emailId: 0,
			emailRenewalId: 0,
			emailExpiredId: 0,
			renewalSubscriptionId: 0,
			externalRef: String,
			notes: String,
			error: String
		}
	],
	purchasedOrder: 
	{
		productName: String,
		subTotal: 0,
		couponId: String,
		discount: 0,
		tax: 0,
		total: 0,
		paid: False,
		createdDate: 0001-01-01,
		modifiedDate: 0001-01-01,
		modifiedBy: String,
		cancelledDate: 0001-01-01,
		cancelledReason: String,
		orderDetails: 
		[
			{
				id: 0,
				orderId: 0,
				skuId: 0,
				skuType: Product,
				price: 0,
				description: String,
				quantity: 0,
				total: 0
			}
		]
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}