All Verbs | /account/subscription | ||
---|---|---|---|
GET | /Subscriptions |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using MyApp.ServiceModel;
namespace MyApp.ServiceModel
{
public partial class OrderAnalyticData
{
public virtual string ProductName { get; set; }
public virtual int SubTotal { get; set; }
public virtual string CouponId { get; set; }
public virtual int Discount { get; set; }
public virtual int Tax { get; set; }
public virtual int Total { get; set; }
public virtual bool Paid { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime ModifiedDate { get; set; }
public virtual string ModifiedBy { get; set; }
public virtual DateTime? CancelledDate { get; set; }
public virtual string CancelledReason { get; set; }
public virtual List<OrderDetail> OrderDetails { get; set; }
}
public partial class OrderDetail
{
public virtual int Id { get; set; }
public virtual int OrderId { get; set; }
public virtual int SkuId { get; set; }
public virtual SkuType SkuType { get; set; }
public virtual int Price { get; set; }
public virtual string Description { get; set; }
public virtual int Quantity { get; set; }
public virtual int Total { get; set; }
}
public partial class Sku
{
public virtual int Id { get; set; }
public virtual int ProductId { get; set; }
public virtual SkuType Type { get; set; }
public virtual LicenseFeature Feature { get; set; }
public virtual string Code { get; set; }
public virtual string Name { get; set; }
public virtual string Notes { get; set; }
[Ignore]
public virtual int? MinQty { get; set; }
public virtual int? MaxQty { get; set; }
public virtual int Price { get; set; }
public virtual string Plan { get; set; }
public virtual int DiscountOff { get; set; }
public virtual string DiscountLabelOff { get; set; }
public virtual int ActualPrice { get; set; }
public virtual bool IsPlan { get; set; }
public virtual bool IsRenewal { get; set; }
public virtual int? SubscriptionDurationDays { get; set; }
public virtual int? ExpiryDurationDays { get; set; }
public virtual int? TrialPeriodDays { get; set; }
public virtual int SupportQty { get; set; }
public virtual int? CoresQty { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime ModifiedDate { get; set; }
public virtual LicenseType LicenseType { get; set; }
public virtual bool Active { get; set; }
}
public enum SkuType
{
Product,
PerDev,
PerCore,
Site,
Support,
Training,
Register,
Payment,
}
public partial class Subscription
{
public virtual int Id { get; set; }
public virtual int CustomerId { get; set; }
public virtual string Email { get; set; }
public virtual int SkuId { get; set; }
public virtual string SkuName { get; set; }
public virtual SkuType SkuType { get; set; }
public virtual string Code { get; set; }
public virtual int Quantity { get; set; }
public virtual int SupportQuantity { get; set; }
public virtual int Total { get; set; }
public virtual bool IsPlan { get; set; }
public virtual bool IsRenewal { get; set; }
public virtual int SubscriptionDurationDays { get; set; }
public virtual DateTime? RenewalDate { get; set; }
public virtual string LicenseRef { get; set; }
public virtual string LicenseName { get; set; }
public virtual string LicenseAddress { get; set; }
public virtual LicenseType LicenseType { get; set; }
public virtual DateTime ExpiryDate { get; set; }
public virtual LicenseKey LicenseKey { get; set; }
public virtual string LicenseKeyText { get; set; }
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime ModifiedDate { get; set; }
public virtual DateTime? CancelledDate { get; set; }
public virtual string StripeSubscriptionId { get; set; }
public virtual int? EmailId { get; set; }
public virtual int? EmailRenewalId { get; set; }
public virtual int? EmailExpiredId { get; set; }
public virtual int? RenewalSubscriptionId { get; set; }
public virtual string ExternalRef { get; set; }
public virtual string Notes { get; set; }
public virtual string Error { get; set; }
}
public partial class Subscriptions
{
public virtual string Section { get; set; }
public virtual bool Success { get; set; }
public virtual bool Activated { get; set; }
public virtual int? PurchasedOrderId { get; set; }
}
public partial class SubscriptionsResponse
{
public virtual string Section { get; set; }
public virtual int SupportQuantity { get; set; }
public virtual Sku ActiveSku { get; set; }
public virtual Subscription ActiveSubscription { get; set; }
public virtual List<Subscription> InActiveSubscriptions { get; set; }
public virtual OrderAnalyticData PurchasedOrder { get; set; }
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
namespace ServiceStack
{
[Flags]
public enum LicenseFeature
{
None = 0,
Free = 0,
Premium = 1,
Text = 2,
Client = 4,
Common = 8,
Redis = 16,
RedisSku = 18,
OrmLite = 32,
OrmLiteSku = 34,
ServiceStack = 64,
Server = 128,
Razor = 256,
Admin = 512,
Aws = 1024,
AwsSku = 1026,
All = 2047,
}
public partial class LicenseKey
{
public virtual string Ref { get; set; }
public virtual string Name { get; set; }
public virtual LicenseType Type { get; set; }
public virtual long Meta { get; set; }
public virtual string Hash { get; set; }
public virtual string Halg { get; set; }
public virtual DateTime Expiry { get; set; }
}
public enum LicenseType
{
Free,
FreeIndividual,
FreeOpenSource,
Indie,
Business,
Enterprise,
TextIndie,
TextBusiness,
OrmLiteIndie,
OrmLiteBusiness,
RedisIndie,
RedisBusiness,
AwsIndie,
AwsBusiness,
Trial,
Site,
TextSite,
RedisSite,
OrmLiteSite,
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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 } } }