ServiceStack Home (Live)

<back to all web services

PurchaseSubscription

The following routes are available for this service:
POST/PurchaseSubscription
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Subscriptions:
    section: Optional[str] = None
    success: bool = False
    activated: bool = False
    purchased_order_id: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PurchaseSubscription(ICardInfo, IAddress):
    code: Optional[str] = None
    coupon: Optional[str] = None
    renewal_ref: Optional[str] = None
    upgrade_ref: Optional[str] = None
    quantity: int = 0
    user_auth_id: Optional[str] = None
    sku_id: int = 0
    is_small_company: Optional[bool] = None
    is_non_profit: Optional[bool] = None
    agree_terms: bool = False
    first_name: Optional[str] = None
    last_name: Optional[str] = None
    email: Optional[str] = None
    password: Optional[str] = None
    company: Optional[str] = None
    phone_number: Optional[str] = None
    address_line1: Optional[str] = None
    address_line2: Optional[str] = None
    address_city: Optional[str] = None
    address_zip: Optional[str] = None
    address_state: Optional[str] = None
    address_country: Optional[str] = None
    license_name: Optional[str] = None
    license_email: Optional[str] = None
    license_address: Optional[str] = None
    card_number: Optional[str] = None
    cvc: Optional[str] = None
    exp_month: int = 0
    exp_year: int = 0
    notes: Optional[str] = None

Python 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
}