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
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class ActivateSubscription implements IPost
    {
        public String externalRef = null;
        public String userAuthId = null;
        public Boolean agreeTerms = null;
        public String firstName = null;
        public String lastName = null;
        public String email = null;
        public String password = null;
        public String company = null;
        public String phoneNumber = null;
        public String addressLine1 = null;
        public String addressLine2 = null;
        public String addressCity = null;
        public String addressZip = null;
        public String addressState = null;
        public String addressCountry = null;
        
        public String getExternalRef() { return externalRef; }
        public ActivateSubscription setExternalRef(String value) { this.externalRef = value; return this; }
        public String getUserAuthId() { return userAuthId; }
        public ActivateSubscription setUserAuthId(String value) { this.userAuthId = value; return this; }
        public Boolean isAgreeTerms() { return agreeTerms; }
        public ActivateSubscription setAgreeTerms(Boolean value) { this.agreeTerms = value; return this; }
        public String getFirstName() { return firstName; }
        public ActivateSubscription setFirstName(String value) { this.firstName = value; return this; }
        public String getLastName() { return lastName; }
        public ActivateSubscription setLastName(String value) { this.lastName = value; return this; }
        public String getEmail() { return email; }
        public ActivateSubscription setEmail(String value) { this.email = value; return this; }
        public String getPassword() { return password; }
        public ActivateSubscription setPassword(String value) { this.password = value; return this; }
        public String getCompany() { return company; }
        public ActivateSubscription setCompany(String value) { this.company = value; return this; }
        public String getPhoneNumber() { return phoneNumber; }
        public ActivateSubscription setPhoneNumber(String value) { this.phoneNumber = value; return this; }
        public String getAddressLine1() { return addressLine1; }
        public ActivateSubscription setAddressLine1(String value) { this.addressLine1 = value; return this; }
        public String getAddressLine2() { return addressLine2; }
        public ActivateSubscription setAddressLine2(String value) { this.addressLine2 = value; return this; }
        public String getAddressCity() { return addressCity; }
        public ActivateSubscription setAddressCity(String value) { this.addressCity = value; return this; }
        public String getAddressZip() { return addressZip; }
        public ActivateSubscription setAddressZip(String value) { this.addressZip = value; return this; }
        public String getAddressState() { return addressState; }
        public ActivateSubscription setAddressState(String value) { this.addressState = value; return this; }
        public String getAddressCountry() { return addressCountry; }
        public ActivateSubscription setAddressCountry(String value) { this.addressCountry = value; return this; }
    }

    public static class ActivateSubscriptionResponse
    {
        public Subscription subscription = null;
        public ResponseStatus responseStatus = null;
        
        public Subscription getSubscription() { return subscription; }
        public ActivateSubscriptionResponse setSubscription(Subscription value) { this.subscription = value; return this; }
        public ResponseStatus getResponseStatus() { return responseStatus; }
        public ActivateSubscriptionResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
    }

    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 enum SkuType
    {
        Product,
        PerDev,
        PerCore,
        Site,
        Support,
        Training,
        Register,
        Payment;
    }

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

}

Java ActivateSubscription DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<ActivateSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel">
  <AddressCity>String</AddressCity>
  <AddressCountry>String</AddressCountry>
  <AddressLine1>String</AddressLine1>
  <AddressLine2>String</AddressLine2>
  <AddressState>String</AddressState>
  <AddressZip>String</AddressZip>
  <AgreeTerms>false</AgreeTerms>
  <Company>String</Company>
  <Email>String</Email>
  <ExternalRef>String</ExternalRef>
  <FirstName>String</FirstName>
  <LastName>String</LastName>
  <Password>String</Password>
  <PhoneNumber>String</PhoneNumber>
  <UserAuthId>String</UserAuthId>
</ActivateSubscription>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ActivateSubscriptionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Subscription>
    <CancelledDate>0001-01-01T00:00:00</CancelledDate>
    <Code>String</Code>
    <CreatedDate>0001-01-01T00:00:00</CreatedDate>
    <CustomerId>0</CustomerId>
    <Email>String</Email>
    <EmailExpiredId>0</EmailExpiredId>
    <EmailId>0</EmailId>
    <EmailRenewalId>0</EmailRenewalId>
    <Error>String</Error>
    <ExpiryDate>0001-01-01T00:00:00</ExpiryDate>
    <ExternalRef>String</ExternalRef>
    <Id>0</Id>
    <IsPlan>false</IsPlan>
    <IsRenewal>false</IsRenewal>
    <LicenseAddress>String</LicenseAddress>
    <LicenseKey xmlns:d3p1="http://schemas.datacontract.org/2004/07/ServiceStack">
      <d3p1:Expiry>0001-01-01T00:00:00</d3p1:Expiry>
      <d3p1:Halg>String</d3p1:Halg>
      <d3p1:Hash>String</d3p1:Hash>
      <d3p1:Meta>0</d3p1:Meta>
      <d3p1:Name>String</d3p1:Name>
      <d3p1:Ref>String</d3p1:Ref>
      <d3p1:Type>Free</d3p1:Type>
    </LicenseKey>
    <LicenseKeyText>String</LicenseKeyText>
    <LicenseName>String</LicenseName>
    <LicenseRef>String</LicenseRef>
    <LicenseType>Free</LicenseType>
    <ModifiedDate>0001-01-01T00:00:00</ModifiedDate>
    <Notes>String</Notes>
    <Quantity>0</Quantity>
    <RenewalDate>0001-01-01T00:00:00</RenewalDate>
    <RenewalSubscriptionId>0</RenewalSubscriptionId>
    <SkuId>0</SkuId>
    <SkuName>String</SkuName>
    <SkuType>Product</SkuType>
    <StripeSubscriptionId>String</StripeSubscriptionId>
    <SubscriptionDurationDays>0</SubscriptionDurationDays>
    <SupportQuantity>0</SupportQuantity>
    <Total>0</Total>
  </Subscription>
</ActivateSubscriptionResponse>