GET | /subscriptions/activate/{ExternalRef} | ||
---|---|---|---|
POST | /subscriptions/activate | ||
GET POST | /ActivateSubscription |
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class ActivateSubscription : IPost
{
open var externalRef:String? = null
open var userAuthId:String? = null
open var agreeTerms:Boolean? = null
open var firstName:String? = null
open var lastName:String? = null
open var email:String? = null
open var password:String? = null
open var company:String? = null
open var phoneNumber:String? = null
open var addressLine1:String? = null
open var addressLine2:String? = null
open var addressCity:String? = null
open var addressZip:String? = null
open var addressState:String? = null
open var addressCountry:String? = null
}
open class ActivateSubscriptionResponse
{
open var subscription:Subscription? = null
open var responseStatus:ResponseStatus? = null
}
open class Subscription
{
open var id:Int? = null
open var customerId:Int? = null
open var email:String? = null
open var skuId:Int? = null
open var skuName:String? = null
open var skuType:SkuType? = null
open var code:String? = null
open var quantity:Int? = null
open var supportQuantity:Int? = null
open var total:Int? = null
open var isPlan:Boolean? = null
open var isRenewal:Boolean? = null
open var subscriptionDurationDays:Int? = null
open var renewalDate:Date? = null
open var licenseRef:String? = null
open var licenseName:String? = null
open var licenseAddress:String? = null
open var licenseType:LicenseType? = null
open var expiryDate:Date? = null
open var licenseKey:LicenseKey? = null
open var licenseKeyText:String? = null
open var createdDate:Date? = null
open var modifiedDate:Date? = null
open var cancelledDate:Date? = null
open var stripeSubscriptionId:String? = null
open var emailId:Int? = null
open var emailRenewalId:Int? = null
open var emailExpiredId:Int? = null
open var renewalSubscriptionId:Int? = null
open var externalRef:String? = null
open var notes:String? = null
open var error:String? = null
}
enum class SkuType
{
Product,
PerDev,
PerCore,
Site,
Support,
Training,
Register,
Payment,
}
enum class LicenseType
{
Free,
FreeIndividual,
FreeOpenSource,
Indie,
Business,
Enterprise,
TextIndie,
TextBusiness,
OrmLiteIndie,
OrmLiteBusiness,
RedisIndie,
RedisBusiness,
AwsIndie,
AwsBusiness,
Trial,
Site,
TextSite,
RedisSite,
OrmLiteSite,
}
open class LicenseKey
{
open var ref:String? = null
open var name:String? = null
@SerializedName("type") open var Type:LicenseType? = null
open var meta:Long? = null
open var hash:String? = null
open var halg:String? = null
open var expiry:Date? = null
}
Kotlin ActivateSubscription DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
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/csv 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":"\/Date(-62135596800000-0000)\/","licenseRef":"String","licenseName":"String","licenseAddress":"String","licenseType":"Free","expiryDate":"\/Date(-62135596800000-0000)\/","licenseKey":{"ref":"String","name":"String","type":"Free","meta":0,"hash":"String","halg":"String","expiry":"\/Date(-62135596800000-0000)\/"},"licenseKeyText":"String","createdDate":"\/Date(-62135596800000-0000)\/","modifiedDate":"\/Date(-62135596800000-0000)\/","cancelledDate":"\/Date(-62135596800000-0000)\/","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"}}}