ServiceStack Home (Live)

<back to all web services

ActivateSubscription

The following routes are available for this service:
GET/subscriptions/activate/{ExternalRef}
POST/subscriptions/activate
GET POST/ActivateSubscription

export class ActivateSubscription implements IPost
{
    public externalRef: string;
    public userAuthId: string;
    public agreeTerms: boolean;
    public firstName: string;
    public lastName: string;
    public email: string;
    public password: string;
    public company: string;
    public phoneNumber: string;
    public addressLine1: string;
    public addressLine2: string;
    public addressCity: string;
    public addressZip: string;
    public addressState: string;
    public addressCountry: string;

    public constructor(init?: Partial<ActivateSubscription>) { (Object as any).assign(this, init); }
}

export enum SkuType
{
    Product = 'Product',
    PerDev = 'PerDev',
    PerCore = 'PerCore',
    Site = 'Site',
    Support = 'Support',
    Training = 'Training',
    Register = 'Register',
    Payment = 'Payment',
}

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

export class LicenseKey
{
    public ref: string;
    public name: string;
    public type: LicenseType;
    public meta: number;
    public hash: string;
    public halg: string;
    public expiry: string;

    public constructor(init?: Partial<LicenseKey>) { (Object as any).assign(this, init); }
}

export class Subscription
{
    public id: number;
    public customerId: number;
    public email: string;
    public skuId: number;
    public skuName: string;
    public skuType: SkuType;
    public code: string;
    public quantity: number;
    public supportQuantity: number;
    public total: number;
    public isPlan: boolean;
    public isRenewal: boolean;
    public subscriptionDurationDays: number;
    public renewalDate?: string;
    public licenseRef: string;
    public licenseName: string;
    public licenseAddress: string;
    public licenseType: LicenseType;
    public expiryDate: string;
    public licenseKey: LicenseKey;
    public licenseKeyText: string;
    public createdDate: string;
    public modifiedDate: string;
    public cancelledDate?: string;
    public stripeSubscriptionId: string;
    public emailId?: number;
    public emailRenewalId?: number;
    public emailExpiredId?: number;
    public renewalSubscriptionId?: number;
    public externalRef: string;
    public notes: string;
    public error: string;

    public constructor(init?: Partial<Subscription>) { (Object as any).assign(this, init); }
}

export class ActivateSubscriptionResponse
{
    public subscription: Subscription;
    public responseStatus: ResponseStatus;

    public constructor(init?: Partial<ActivateSubscriptionResponse>) { (Object as any).assign(this, init); }
}

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

{
	externalRef: String,
	userAuthId: String,
	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
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	subscription: 
	{
		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
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}