Additional subscription creation examples
Several examples of subscription creation are included below. The requests often only vary by the payment plan, which represents the edition of the product being purchased, but the responses may contain very different information depending on how the edition is configured.
Creating a subscription with all attributes
Below is an example of creating a subscription passing all supported attributes.
Request
- JSON
{
"order":{
"paymentPlanId":749,
"discountId":27,
"orderLines":[{
"unit":"USER",
"quantity":3
}],
"parameters":[{
"name":"BusinessName",
"value":"API Getting Started"
},
{
"name":"FirstName",
"value":"Billing"
},
{
"name":"LastName",
"value":"API"
},
{
"name":"Address/Line1",
"value":"650 California Street"
},
{
"name":"Address/Line2",
"value":"Floor 25"
},
{
"name":"Address/City",
"value":"San Francisco"
},
{
"name":"Address/State",
"value":"CA"
},
{
"name":"Address/PostalCode",
"value":"94108"
},
{
"name":"Address/ISO3Country",
"value":"USA"
},
{
"name":"Address/PhoneNumber",
"value":"5109289829"
},
{
"name":"AlternateEmail",
"value":"test@test.de"
},
{
"name":"UserPrincipleName",
"value":"testUser"
},
{
"name":"SubDomain",
"value":"subtest.onmicrosoft.com"
},
{
"name":"CommunicationLanguage",
"value":"en"
},
{
"name":"CommunicationCulture",
"value":"USA"
}]
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>749</paymentPlanId>
<discountId>27</discountId>
<orderLines>
<unit>USER</unit>
<quantity>3</quantity>
</orderLines>
<parameters>
<name>BusinessName</name>
<value>API Getting Started</value>
</parameters>
<parameters>
<name>FirstName</name>
<value>Billing</value>
</parameters>
<parameters>
<name>LastName</name>
<value>API</value>
</parameters>
<parameters>
<name>Address/Line1</name>
<value>650 California Street</value>
</parameters>
<parameters>
<name>Address/Line2</name>
<value>Floor 25</value>
</parameters>
<parameters>
<name>Address/City</name>
<value>San Francisco</value>
</parameters>
<parameters>
<name>Address/State</name>
<value>CA</value>
</parameters>
<parameters>
<name>Address/PostalCode</name>
<value>94108</value>
</parameters>
<parameters>
<name>Address/ISO3Country</name>
<value>USA</value>
</parameters>
<parameters>
<name>Address/PhoneNumber</name>
<value>5109289829</value>
</parameters>
<parameters>
<name>AlternateEmail</name>
<value>test@test.de</value>
</parameters>
<parameters>
<name>UserPrincipleName</name>
<value>testUser</value>
</parameters>
<parameters>
<name>SubDomain</name>
<value>subtest.onmicrosoft.com</value>
</parameters>
<parameters>
<name>CommunicationLanguage</name>
<value>en</value>
</parameters>
<parameters>
<name>CommunicationCulture</name>
<value>USA</value>
</parameters>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1114
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 04:41:56 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "fd1b0164-f4c5-4f00-b853-f0392d317e48",
"creationDate": "2015-08-12T22:41:55-06:00",
"status": "INITIALIZED",
"maxUsers": "1",
"order": {
"id": "1590",
"startDate": "2015-08-12T00:00:00-06:00",
"nextBillingDate": "2015-09-12T00:00:00-06:00",
"status": "PENDING_REMOTE_CREATION",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "5.3100000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "httpw://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/93/editions/612/paymentPlans/749",
"id": "749",
"uuid": "eb483983-ce47-41a7-b304-e5b6bb89d818",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": [
{
"unit": "USER",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10.0000000000",
"CHF": "10.0000000000",
"USD": "10.0000000000"
}
},
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10.0000000000",
"CHF": "10.0000000000",
"USD": "10.0000000000"
}
}
]
}
},
"discount": {
"-id": "27",
"-href": "https://www.appdirect.com/api/channel/v1/discounts/27"
},
"paymentPlanId": "749",
"activated": "false",
"orderLines": {
"orderLine": [
{
"description": "Office 365 Web Apps - Plan 1 - Monthly Fee",
"id": "2442",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "autoApply attribute is true",
"id": "2443",
"price": "-5.0000000000",
"quantity": "1.0000000000",
"totalPrice": "-5.0000000000",
"type": "DISCOUNT"
},
{
"description": "Sales Tax",
"id": "2444",
"percentage": "6.2000000000",
"quantity": "1.0000000000",
"totalPrice": "0.3100000000",
"type": "TAX"
}
]
}
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "93",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/93"
},
"edition": {
"-id": "612",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/93/editions/612"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1114
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 04:41:56 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>fd1b0164-f4c5-4f00-b853-f0392d317e48</id>
<creationDate>2015-08-12T22:41:55-06:00</creationDate>
<status>INITIALIZED</status>
<maxUsers>1</maxUsers>
<order>
<id>1590</id>
<startDate>2015-08-12T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-12T00:00:00-06:00</nextBillingDate>
<status>PENDING_REMOTE_CREATION</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>5.3100000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/93/editions/612/paymentPlans/749">
<id>749</id>
<uuid>eb483983-ce47-41a7-b304-e5b6bb89d818</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10.0000000000</CAD>
<CHF>10.0000000000</CHF>
<USD>10.0000000000</USD>
</amount>
</cost>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10.0000000000</CAD>
<CHF>10.0000000000</CHF>
<USD>10.0000000000</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<discount id="27" href="https://www.appdirect.com/api/channel/v1/discounts/27"/>
<paymentPlanId>749</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>Office 365 Web Apps - Plan 1 - Monthly Fee</description>
<id>2442</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>autoApply attribute is true</description>
<id>2443</id>
<price>-5.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>-5.0000000000</totalPrice>
<type>DISCOUNT</type>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2444</id>
<percentage>6.2000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.3100000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="93" href="https://www.appdirect.com/api/marketplace/v1/products/93"/>
<edition id="612" href="https://www.appdirect.com/api/marketplace/v1/products/93/editions/612"/>
</subscription>
Creating a free trial subscription
Below is an example of creating a subscription for a free trial edition.
Request
- JSON
{
"order": {
"paymentPlanId": "552"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>552</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 948
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 17:19:00 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "efc58da2-d957-46d7-988b-48c7419a8c58",
"creationDate": "2015-08-12T11:18:59-06:00",
"externalAccountId": "2217d789-bdce-4c01-bebe-431b44cab478",
"status": "FREE_TRIAL",
"maxUsers": "1",
"order": {
"id": "1585",
"startDate": "2015-08-27T00:00:00-06:00",
"nextBillingDate": "2015-08-27T00:00:00-06:00",
"status": "FREE_TRIAL",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "0.0000000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/450/paymentPlans/552",
"id": "552",
"uuid": "78941742-43e6-4a85-b656-65b2727d515c",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false"
},
"paymentPlanId": "552",
"activated": "false",
"orderLines": {[
{
"description": "LATEST AUTO_WEBAPP_NEW - Free Trial 15 Days No Grace Period - Monthly Fee",
"id": "2430",
"price": "0.0000000000",
"quantity": "1.0000000000",
"totalPrice": "0.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2431",
"percentage": "0.0000000000",
"quantity": "1.0000000000",
"totalPrice": "0.0000000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "450",
"-href": "https://www.appdi/api/marketplace/v1/products/78/editions/450"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 948
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 17:19:00 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="http://www.w3.org/2005/Atom">
<id>efc58da2-d957-46d7-988b-48c7419a8c58</id>
<creationDate>2015-08-12T11:18:59-06:00</creationDate>
<externalAccountId>2217d789-bdce-4c01-bebe-431b44cab478</externalAccountId>
<status>FREE_TRIAL</status>
<maxUsers>1</maxUsers>
<order>
<id>1585</id>
<startDate>2015-08-27T00:00:00-06:00</startDate>
<nextBillingDate>2015-08-27T00:00:00-06:00</nextBillingDate>
<status>FREE_TRIAL</status>>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>0.0000000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/450/paymentPlans/552">
<id>552</id>
<uuid>78941742-43e6-4a85-b656-65b2727d515c</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs/>>
</paymentPlan>
<paymentPlanId>552</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Free Trial 15 Days No Grace Period - Monthly Fee</description>
<id>2430</id>
<price>0.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>0.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2431</id>
<percentage>0.0000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.0000000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="450" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/450"/>
</subscription>
Creating a one time flat rate subscription
Below is an example of creating a subscription for a one time flat rate edition.
Request
- JSON
{
"order": {
"paymentPlanId": "568"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>568</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1072
Content-Type: application/json;charset=UTF-8
Date: Wed, 12 Aug 2015 23:49:09 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "03bbb592-327f-4a20-a4b2-f337d724b5db",
"creationDate": "2015-08-12T17:49:07-06:00",
"externalAccountId": "03250499-8505-41c4-bef7-fdfe1d243984",
"status": "ACTIVE",
"order": {
"id": "1588",
"startDate": "2015-08-12T00:00:00-06:00",
"endDate": "2015-08-12T00:00:00-06:00",
"nextBillingDate": "2015-08-12T17:49:08-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "NEW",
"totalPrice": "10.6300000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.app/api/marketplace/v1/products/78/editions/465/paymentPlans/568",
"id": "568",
"uuid": "e52ff207-2a17-4c58-85f3-6d49a23136af",
"frequency": "ONE_TIME",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": {
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "1",
"SEK": "10",
"USD": "10"
}
}
}
},
"paymentPlanId": "568",
"activated": "false",
"orderLines": {
"orderLine": [
{
"description": "LATEST AUTO_WEBAPP_NEW - One Time - Flat Rate Price - One Time Fee",
"id": "2438",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2439",
"percentage": "6.3000000000",
"quantity": "1.0000000000",
"totalPrice": "0.6300000000",
"type": "TAX"
}
]
}
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "465",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/465"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1072
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 23:49:09 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="http://www.w3.org/2005/Atom">
<id>03bbb592-327f-4a20-a4b2-f337d724b5db</id>
<creationDate>2015-08-12T17:49:07-06:00</creationDate>
<externalAccountId>03250499-8505-41c4-bef7-fdfe1d243984</externalAccountId>
<status>ACTIVE</status>
<order>
<id>1588</id>
<startDate>2015-08-12T00:00:00-06:00</startDate>
<endDate>2015-08-12T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-12T17:49:08-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>10.6300000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/465/paymentPlans/568">
<id>568</id>
<uuid>e52ff207-2a17-4c58-85f3-6d49a23136af</uuid>
<frequency>ONE_TIME</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>1</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>568</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - One Time - Flat Rate Price - One Time Fee</description>
<id>2438</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2439</id>
<percentage>6.3000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.6300000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="465" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/465"/>
</subscription>
Creating a one time flat rate subscription with a discount
Below is an example of creating a subscription for a one time flat rate edition applying a discount.
Request
- JSON
{
"order": {
"paymentPlanId": "568"
"discountId": "27"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>568</paymentPlanId>
<discountId>27</discountId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1143
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 16:08:47 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "b9e159e3-51d5-44f7-a44d-d48ff478f1f7",
"creationDate": "2015-08-13T10:08:45-06:00",
"externalAccountId": "eef78dca-25a7-4e19-a9bd-3ad22fe2cca3",
"status": "ACTIVE",
"order": {
"id": "1593",
"startDate": "2015-08-13T00:00:00-06:00",
"endDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-08-13T10:08:46-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "NEW",
"totalPrice": "5.3100000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/465/paymentPlans/568",
"id": "568",
"uuid": "e52ff207-2a17-4c58-85f3-6d49a23136af",
"frequency": "ONE_TIME",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": {
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "1",
"SEK": "10",
"USD": "10"
}
}
}
},
"discount": {
"-id": "27",
"-href": "https://www.appdirect.com/api/channel/v1/discounts/27"
},
"paymentPlanId": "568",
"activated": "false",
"orderLines": [
{
"description": "LATEST AUTO_WEBAPP_NEW - One Time - Flat Rate Price - One Time Fee",
"id": "2450",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "autoApply attribute is true",
"id": "2451",
"price": "-5.0000000000",
"quantity": "1.0000000000",
"totalPrice": "-5.0000000000",
"type": "DISCOUNT"
},
{
"description": "Sales Tax",
"id": "2452",
"percentage": "6.2000000000",
"quantity": "1.0000000000",
"totalPrice": "0.3100000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "465",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/465"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1143
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 16:08:47 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>b9e159e3-51d5-44f7-a44d-d48ff478f1f7</id>
<creationDate>2015-08-13T10:08:45-06:00</creationDate>
<externalAccountId>eef78dca-25a7-4e19-a9bd-3ad22fe2cca3</externalAccountId>
<status>ACTIVE</status>
<order>
<id>1593</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<endDate>2015-08-13T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-13T10:08:46-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>5.3100000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/465/paymentPlans/568">
<id>568</id>
<uuid>e52ff207-2a17-4c58-85f3-6d49a23136af</uuid>
<frequency>ONE_TIME</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>1</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<discount id="27" href="https://www.appdirect.com/api/channel/v1/discounts/27"/>
<paymentPlanId>568</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - One Time - Flat Rate Price - One Time Fee</description>
<id>2450</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>autoApply attribute is true</description>
<id>2451</id>
<price>-5.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>-5.0000000000</totalPrice>
<type>DISCOUNT</type>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2452</id>
<percentage>6.2000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.3100000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="465" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/465"/>
</subscription>
Creating a recurring flat rate subscription with price per unit
Below is an example of creating a subscription for a recurring flat rate edition with USER as a price per unit.
Request
- JSON
{
"order": {
"paymentPlanId": "600"
"orderLines": [{
"unit": "USER",
"quantity": "3"
}
]
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>600</paymentPlanId>
<orderLines>
<orderLine>
<unit>USER</unit>
<quantity>3</quantity>
</orderLine>
</orderLines>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 948
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 17:19:00 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "fed9488f-31fb-429b-9651-11d1acb52639",
"creationDate": "2015-08-13T09:34:50-06:00",
"externalAccountId": "b43d3c80-50e9-4e23-986d-ddd2fb193d7d",
"status": "ACTIVE",
"maxUsers": "4",
"order": {
"id": "1592",
"startDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "42.5100000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/494/paymentPlans/600",
"id": "600",
"uuid": "99eca49e-9227-4c92-bdda-aa1af5e4671e",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": [
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "USER",
"minUnits": "0.0000000000",
"maxUnits": "10.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "true",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"SEK": "10",
"USD": "10"
}
}
]
}
},
"paymentPlanId": "600",
"activated": "false",
"orderLines": {
"orderLine": [
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring having Flat Rate Price and Price Per Unit with Min 0 to Max 10 Usage Restrictions - Monthly Fee",
"id": "2447",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring having Flat Rate Price and Price Per Unit with Min 0 to Max 10 Usage Restrictions - Per User Fee",
"id": "2448",
"price": "10.0000000000",
"quantity": "3.0000000000",
"totalPrice": "30.0000000000",
"type": "ITEM",
"unit": "USER"
},
{
"description": "Sales Tax",
"id": "2449",
"percentage": "6.2750000000",
"quantity": "1.0000000000",
"totalPrice": "2.5100000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "494",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/494"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1150
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 15:24:23 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=1E0F77BD46679BE92DB37479B99466FE; Path=/; HttpOnly
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>fed9488f-31fb-429b-9651-11d1acb52639</id>
<creationDate>2015-08-13T09:34:50-06:00</creationDate>
<externalAccountId>b43d3c80-50e9-4e23-986d-ddd2fb193d7d</externalAccountId>
<status>ACTIVE</status>
<maxUsers>4</maxUsers>
<order>
<id>1592</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>42.5100000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/494/paymentPlans/600">
<id>600</id>
<uuid>99eca49e-9227-4c92-bdda-aa1af5e4671e</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<maxUnits>10.0000000000</maxUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>true</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>600</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring having Flat Rate Price and Price Per Unit with Min 0 to Max 10 Usage Restrictions - Monthly Fee</description>
<id>2447</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring having Flat Rate Price and Price Per Unit with Min 0 to Max 10 Usage Restrictions - Per User Fee</description>
<id>2448</id>
<price>10.0000000000</price>
<quantity>3.0000000000</quantity>
<totalPrice>30.0000000000</totalPrice>
<type>ITEM</type>
<unit>USER</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2449</id>
<percentage>6.2750000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>2.5100000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="494" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/494"/>
</subscription>
Creating a tiered recurring subscription with price per unit
Below is an example of creating a subscription for a tiered recurring edition with USER as a price per unit.
Request
- JSON
{
"order": {
"paymentPlanId": "599"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>599</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 982
Content-Type: application/json;charset=UTF-8
Date: Fri, 14 Aug 2015 05:11:00 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "87f48c70-cf63-4362-80d6-22ef8a24b0f5",
"creationDate": "2015-08-13T23:11:00-06:00",
"externalAccountId": "439ba12f-355d-4d8a-a8c4-7d22d15695cf",
"status": "ACTIVE",
"maxUsers": "1",
"order": {
"id": "1602",
"startDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "0.0000000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/493/paymentPlans/599",
"id": "599",
"uuid": "36e1d66b-fc77-4519-87c1-572b40b3e432",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": {
"unit": "USER",
"minUnits": "0.0000000000",
"maxUnits": "5.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "true",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "5",
"CHF": "5",
"SEK": "5",
"USD": "5"
}
}
}
},
"paymentPlanId": "599",
"activated": "false",
"orderLines": [{
"description": "Sales Tax",
"id": "2469",
"percentage": "0.0000000000",
"quantity": "1.0000000000",
"totalPrice": "0.0000000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "493",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/493"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 982
Content-Type: application/xml;charset=UTF-8
Date: Fri, 14 Aug 2015 05:11:00 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>87f48c70-cf63-4362-80d6-22ef8a24b0f5</id>
<creationDate>2015-08-13T23:11:00-06:00</creationDate>
<externalAccountId>439ba12f-355d-4d8a-a8c4-7d22d15695cf</externalAccountId>
<status>ACTIVE</status>
<maxUsers>1</maxUsers>
<order>
<id>1602</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>0.0000000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/493/paymentPlans/599">
<id>599</id>
<uuid>36e1d66b-fc77-4519-87c1-572b40b3e432</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<maxUnits>5.0000000000</maxUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>true</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>5</CAD>
<CHF>5</CHF>
<SEK>5</SEK>
<USD>5</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>599</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>Sales Tax</description>
<id>2469</id>
<percentage>0.0000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.0000000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="493" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/493"/>
</subscription>
Creating a recurring flat rate subscription with set up fees
Below is an example of creating a subscription for a recurring flat rate edition with set up fees.
Request
- JSON
{
"order": {
"paymentPlanId": "592"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>592</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1185
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 16:26:52 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options
{
"id": "47460ffb-4a25-43be-b32e-cd59c4ac7d6c",
"creationDate": "2015-08-13T10:26:51-06:00",
"externalAccountId": "3e5fd2ba-3e5a-43ae-931e-7dcff37bfcf1",
"status": "ACTIVE",
"maxUsers": "1",
"order": {
"id": "1595",
"startDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "10.6300000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://ww.appdirect.com/api/marketplace/v1/products/78/editions/486/paymentPlans/592",
"id": "592",
"uuid": "b9902237-23ae-4dca-9696-8243c69f5023",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": [
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "ONE_TIME_SETUP",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "5",
"CHF": "5",
"EUR": "5",
"SEK": "5",
"USD": "5"
}
}
]
},
"paymentPlanId": "592",
"activated": "false",
"oneTimeOrders": {
"oneTimeOrder": {
"id": "1594",
"startDate": "2015-08-13T00:00:00-06:00",
"endDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-08-13T10:26:52-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "ONE_TIME_FEE",
"totalPrice": "5.3100000000",
"paymentPlan": {
"-id": "592",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/486/paymentPlans/592"
}
}
},
"orderLines": [
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring Flat Rate w/ Setup Fee - Monthly Fee",
"id": "2455",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2456",
"percentage": "6.3000000000",
"quantity": "1.0000000000",
"totalPrice": "0.6300000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "486",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/486"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1185
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 16:26:52 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>47460ffb-4a25-43be-b32e-cd59c4ac7d6c</id>
<creationDate>2015-08-13T10:26:51-06:00</creationDate>
<externalAccountId>3e5fd2ba-3e5a-43ae-931e-7dcff37bfcf1</externalAccountId>
<status>ACTIVE</status>
<maxUsers>1</maxUsers>
<order>
<id>1595</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>10.6300000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/486/paymentPlans/592">
<id>592</id>
<uuid>b9902237-23ae-4dca-9696-8243c69f5023</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>10</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>ONE_TIME_SETUP</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>5</CAD>
<CHF>5</CHF>
<EUR>5</EUR>
<SEK>5</SEK>
<USD>5</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>592</paymentPlanId>
<activated>false</activated>
<oneTimeOrders>
<oneTimeOrder>
<id>1594</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<endDate>2015-08-13T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-13T10:26:52-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>ONE_TIME_FEE</type>
<totalPrice>5.3100000000</totalPrice>
<paymentPlan id="592" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/486/paymentPlans/592"/>
</oneTimeOrder>
</oneTimeOrders>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring Flat Rate w/ Setup Fee - Monthly Fee</description>
<id>2455</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2456</id>
<percentage>6.3000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.6300000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="486" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/486"/>
</subscription>
Creating a recurring subscription with an auto renewing contract
Below is an example of creating a subscription for a recurring edition with an auto renewing contract.
Request
- JSON
{
"order": {
"paymentPlanId": "566"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>566</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1191
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 17:21:40 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "38466fa8-c2e4-42c0-8b74-37ea62c17c6a",
"creationDate": "2015-08-13T11:21:38-06:00",
"externalAccountId": "a1b9a59e-a76e-407d-98c8-868b69b343a8",
"status": "ACTIVE",
"maxUsers": "1",
"order": {
"id": "1597",
"startDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "10.6300000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/463/paymentPlans/566",
"id": "566",
"uuid": "463ef552-274d-4e03-9131-4307b3984d2a",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false",
"minimumServiceLength": "0"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": [
{
"unit": "CONTRACT_FEE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "USER",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "10",
"SEK": "10",
"USD": "10"
}
}
]
},
"paymentPlanId": "566",
"activated": "false",
"oneTimeOrders": {
"oneTimeOrder": {
"id": "1596",
"startDate": "2015-08-13T00:00:00-06:00",
"endDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-08-13T11:21:39-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "ONE_TIME_FEE",
"totalPrice": "10.6300000000",
"paymentPlan": {
"-id": "566",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/463/paymentPlans/566"
}
}
},
"orderLines": [
{
"description": "LATEST AUTO_WEBAPP_NEW - Contract Auto Renewal - Monthly Fee",
"id": "2459",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2460",
"percentage": "6.3000000000",
"quantity": "1.0000000000",
"totalPrice": "0.6300000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "463",
"-href": "https://www.appdriect.com/api/marketplace/v1/products/78/editions/463"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1191
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 17:21:40 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>38466fa8-c2e4-42c0-8b74-37ea62c17c6a</id>
<creationDate>2015-08-13T11:21:38-06:00</creationDate>
<externalAccountId>a1b9a59e-a76e-407d-98c8-868b69b343a8</externalAccountId>
<status>ACTIVE</status>
<maxUsers>1</maxUsers>
<order>
<id>1597</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>10.6300000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/463/paymentPlans/566">
<id>566</id>
<uuid>463ef552-274d-4e03-9131-4307b3984d2a</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
<minimumServiceLength>0</minimumServiceLength>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>CONTRACT_FEE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>10</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>10</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>10</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>566</paymentPlanId>
<activated>false</activated>
<oneTimeOrders>
<oneTimeOrder>
<id>1596</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<endDate>2015-08-13T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-13T11:21:39-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>ONE_TIME_FEE</type>
<totalPrice>10.6300000000</totalPrice>
<paymentPlan id="566" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/463/paymentPlans/566"/>
</oneTimeOrder>
</oneTimeOrders>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Contract Auto Renewal - Monthly Fee</description>
<id>2459</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2460</id>
<percentage>6.3000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.6300000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="463" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/463"/>
</subscription>
Creating a recurring subscription with a contract termination fee
Below is an example of creating a subscription for a recurring edition with a contract that has a percentage-based termination fee.
Request
- JSON
{
"order": {
"paymentPlanId": "571"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>571</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1282
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 17:37:57 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "07265ec6-c0c7-44ba-99c3-960efa0e505f",
"creationDate": "2015-08-13T11:37:56-06:00",
"externalAccountId": "bc8a5beb-ff5a-46d8-a0ce-17378d1a8a4b",
"status": "ACTIVE",
"maxUsers": "1",
"order": {
"id": "1599",
"startDate": "2015-08-13T00:00:00-06:00",
"endDate": "2016-08-13T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "10.6300000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/468/paymentPlans/571",
"id": "571",
"uuid": "6ed24faf-bfce-45e4-839b-1c90be727c96",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false",
"minimumServiceLength": "12",
"terminationFee": {
"type": "PERCENTAGE",
"description": "Termination Fee applied to remaining",
"percentageFee": "0.2500000000"
}
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": [
{
"unit": "CONTRACT_FEE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"EUR": "1",
"SEK": "10",
"USD": "10"
}
}
]
},
"contract": {
"endOfContractDate": "2016-08-13T00:00:00-06:00",
"minimumServiceLength": "12",
"terminationFee": {
"description": "Termination Fee applied to remaining",
"percentage": "25.0000000000",
"type": "PERCENTAGE"
}
},
"paymentPlanId": "571",
"activated": "false",
"oneTimeOrders": {
"oneTimeOrder": {
"id": "1598",
"startDate": "2015-08-13T00:00:00-06:00",
"endDate": "2015-08-13T00:00:00-06:00",
"nextBillingDate": "2015-08-13T11:37:57-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "ONE_TIME_FEE",
"totalPrice": "10.6300000000",
"paymentPlan": {
"-id": "571",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/468/paymentPlans/571"
}
}
},
"orderLines": [
{
"description": "LATEST AUTO_WEBAPP_NEW - Contract - Termination Fee Percentage - Monthly Fee",
"id": "2463",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2464",
"percentage": "6.3000000000",
"quantity": "1.0000000000",
"totalPrice": "0.6300000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "468",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/468"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1282
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 17:37:57 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>07265ec6-c0c7-44ba-99c3-960efa0e505f</id>
<creationDate>2015-08-13T11:37:56-06:00</creationDate>
<externalAccountId>bc8a5beb-ff5a-46d8-a0ce-17378d1a8a4b</externalAccountId>
<status>ACTIVE</status>
<maxUsers>1</maxUsers>
<order>
<id>1599</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<endDate>2016-08-13T00:00:00-06:00</endDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>10.6300000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/468/paymentPlans/571">
<id>571</id>
<uuid>6ed24faf-bfce-45e4-839b-1c90be727c96</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
<minimumServiceLength>12</minimumServiceLength>
<terminationFee>
<type>PERCENTAGE</type>
<description>Termination Fee applied to remaining</description>
<percentageFee>0.2500000000</percentageFee>
<flatFee/>
</terminationFee>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>CONTRACT_FEE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>10</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<EUR>1</EUR>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<contract>
<endOfContractDate>2016-08-13T00:00:00-06:00</endOfContractDate>
<minimumServiceLength>12</minimumServiceLength>
<terminationFee>
<description>Termination Fee applied to remaining</description>
<percentage>25.0000000000</percentage>
<type>PERCENTAGE</type>
</terminationFee>
</contract>
<paymentPlanId>571</paymentPlanId>
<activated>false</activated>
<oneTimeOrders>
<oneTimeOrder>
<id>1598</id>
<startDate>2015-08-13T00:00:00-06:00</startDate>
<endDate>2015-08-13T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-13T11:37:57-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>ONE_TIME_FEE</type>
<totalPrice>10.6300000000</totalPrice>
<paymentPlan id="571" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/468/paymentPlans/571"/>
</oneTimeOrder>
</oneTimeOrders>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Contract - Termination Fee Percentage - Monthly Fee</description>
<id>2463</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2464</id>
<percentage>6.3000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.6300000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="468" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/468"/>
</subscription>
Creating a recurring subscription with taxes
Below is an example of creating a subscription for a recurring edition charging a percentage tax.
Request
- JSON
{
"order": {
"paymentPlanId": "596",
"orderLines": {[
{
"unit": "USER",
"quantity": "5"
},
{
"unit": "HOUR",
"quantity": "15"
},
{
"type": "TAX",
"percentage": "0.10",
"description": "10% Tax"
}
]
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
596USER5HOUR15TAX0.1010% Tax
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1449
Content-Type: application/json;charset=UTF-8
Date: Fri, 14 Aug 2015 17:30:07 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "d74bc04e-f654-4e87-ae94-68fc5e7ab56f",
"creationDate": "2015-08-14T11:30:05-06:00",
"externalAccountId": "4a70546a-a2ae-448e-95ae-6f9b1eccdd9c",
"status": "ACTIVE",
"maxUsers": "6",
"order": {
"id": "1604",
"startDate": "2015-08-14T00:00:00-06:00",
"endDate": "2016-08-14T00:00:00-06:00",
"nextBillingDate": "2015-09-01T00:00:00-06:00",
"status": "ACTIVE",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "57.9100000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/490/paymentPlans/596",
"id": "596",
"uuid": "7ad9c40d-ce26-48f9-8573-954fabe6f862",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false",
"minimumServiceLength": "12"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": [
{
"unit": "CONTRACT_FEE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "100",
"CHF": "100",
"SEK": "100",
"USD": "100"
}
},
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10",
"CHF": "10",
"SEK": "10",
"USD": "10"
}
},
{
"unit": "ONE_TIME_SETUP",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "1.2",
"CHF": "1.2",
"SEK": "1.2",
"USD": "1.2"
}
},
{
"unit": "USER",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "5",
"CHF": "5",
"SEK": "5",
"USD": "5"
}
},
{
"unit": "ONE_TIME_SETUP",
"unitDependency": "USER",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "1.1",
"CHF": "1.1",
"SEK": "1.1",
"USD": "1.1"
}
},
{
"unit": "HOUR",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "1.3",
"CHF": "1.3",
"SEK": "1.3",
"USD": "1.3"
}
},
{
"unit": "ONE_TIME_SETUP",
"unitDependency": "HOUR",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"increment": "1.0000000000",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "0.2",
"CHF": "0.2",
"SEK": "0.2",
"USD": "0.2"
}
}
]
},
"contract": {
"endOfContractDate": "2016-08-14T00:00:00-06:00",
"minimumServiceLength": "12"
},
"paymentPlanId": "596",
"activated": "false",
"oneTimeOrders": {
"oneTimeOrder": {
"id": "1603",
"startDate": "2015-08-14T00:00:00-06:00",
"endDate": "2015-08-14T00:00:00-06:00",
"nextBillingDate": "2015-08-14T11:30:06-06:00",
"status": "ONE_TIME",
"frequency": "ONE_TIME",
"currency": "USD",
"type": "ONE_TIME_FEE",
"totalPrice": "116.5600000000",
"paymentPlan": {
"-id": "596",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/490/paymentPlans/596"
}
}
},
"orderLines": [
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Monthly Fee",
"id": "2475",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Per Hour Fee",
"id": "2476",
"price": "1.3000000000",
"quantity": "15.0000000000",
"totalPrice": "19.5000000000",
"type": "ITEM",
"unit": "HOUR"
},
{
"description": "LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Per User Fee",
"id": "2477",
"price": "5.0000000000",
"quantity": "5.0000000000",
"totalPrice": "25.0000000000",
"type": "ITEM",
"unit": "USER"
},
{
"description": "Sales Tax",
"id": "2478",
"percentage": "6.2568807300",
"quantity": "1.0000000000",
"totalPrice": "3.4100000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "78",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78"
},
"edition": {
"-id": "490",
"-href": "https://www.appdirect.com/api/marketplace/v1/products/78/editions/490"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1449
Content-Type: application/xml;charset=UTF-8
Date: Fri, 14 Aug 2015 17:30:07 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?--><?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="https://www.w3.org/2005/Atom">
<id>d74bc04e-f654-4e87-ae94-68fc5e7ab56f</id>
<creationDate>2015-08-14T11:30:05-06:00</creationDate>
<externalAccountId>4a70546a-a2ae-448e-95ae-6f9b1eccdd9c</externalAccountId>
<status>ACTIVE</status>
<maxUsers>6</maxUsers>
<order>
<id>1604</id>
<startDate>2015-08-14T00:00:00-06:00</startDate>
<endDate>2016-08-14T00:00:00-06:00</endDate>
<nextBillingDate>2015-09-01T00:00:00-06:00</nextBillingDate>
<status>ACTIVE</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>57.9100000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/490/paymentPlans/596">
<id>596</id>
<uuid>7ad9c40d-ce26-48f9-8573-954fabe6f862</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
<minimumServiceLength>12</minimumServiceLength>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>CONTRACT_FEE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>100</CAD>
<CHF>100</CHF>
<SEK>100</SEK>
<USD>100</USD>
</amount>
</cost>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10</CAD>
<CHF>10</CHF>
<SEK>10</SEK>
<USD>10</USD>
</amount>
</cost>
<cost>
<unit>ONE_TIME_SETUP</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>1.2</CAD>
<CHF>1.2</CHF>
<SEK>1.2</SEK>
<USD>1.2</USD>
</amount>
</cost>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>5</CAD>
<CHF>5</CHF>
<SEK>5</SEK>
<USD>5</USD>
</amount>
</cost>
<cost>
<unit>ONE_TIME_SETUP</unit>
<unitDependency>USER</unitDependency>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>1.1</CAD>
<CHF>1.1</CHF>
<SEK>1.1</SEK>
<USD>1.1</USD>
</amount>
</cost>
<cost>
<unit>HOUR</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>1.3</CAD>
<CHF>1.3</CHF>
<SEK>1.3</SEK>
<USD>1.3</USD>
</amount>
</cost>
<cost>
<unit>ONE_TIME_SETUP</unit>
<unitDependency>HOUR</unitDependency>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<increment>1.0000000000</increment>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>0.2</CAD>
<CHF>0.2</CHF>
<SEK>0.2</SEK>
<USD>0.2</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<contract>
<endOfContractDate>2016-08-14T00:00:00-06:00</endOfContractDate>
<minimumServiceLength>12</minimumServiceLength>
</contract>
<paymentPlanId>596</paymentPlanId>
<activated>false</activated>
<oneTimeOrders>
<oneTimeOrder>
<id>1603</id>
<startDate>2015-08-14T00:00:00-06:00</startDate>
<endDate>2015-08-14T00:00:00-06:00</endDate>
<nextBillingDate>2015-08-14T11:30:06-06:00</nextBillingDate>
<status>ONE_TIME</status>
<frequency>ONE_TIME</frequency>
<currency>USD</currency>
<type>ONE_TIME_FEE</type>
<totalPrice>116.5600000000</totalPrice>
<paymentPlan id="596" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/490/paymentPlans/596"/>
</oneTimeOrder>
</oneTimeOrders>
<orderLines>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Monthly Fee</description>
<id>2475</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Per Hour Fee</description>
<id>2476</id>
<price>1.3000000000</price>
<quantity>15.0000000000</quantity>
<totalPrice>19.5000000000</totalPrice>
<type>ITEM</type>
<unit>HOUR</unit>
</orderLine>
<orderLine>
<description>LATEST AUTO_WEBAPP_NEW - Recurring with all types of fees - Once per Company and Automated Discount - Per User Fee</description>
<id>2477</id>
<price>5.0000000000</price>
<quantity>5.0000000000</quantity>
<totalPrice>25.0000000000</totalPrice>
<type>ITEM</type>
<unit>USER</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2478</id>
<percentage>6.2568807300</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>3.4100000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="https://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="https://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="78" href="https://www.appdirect.com/api/marketplace/v1/products/78"/>
<edition id="490" href="https://www.appdirect.com/api/marketplace/v1/products/78/editions/490"/>
</subscription>
Creating a subscription to Microsoft products
Below is an example of creating a Microsoft product. Notice that several parameters are passed in using the parameters attribute of the order field.
Request
- JSON
POST https://appdirect.com/api/billing/v1/companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78/users/3d4d2342-b7c4-4865-85bd-842f269adae6/subscriptions
Host: www.appdirect.com
Authorization OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="VeJO1tP7RKUE1rz", oauth_timestamp="1438728054", oauth_consumer_key="appdirect-91", oauth_signature="xy37tmDbpwuIHZJIioRSB3GGAhM%3D"
Content-Type application/json
{
"order":{
"paymentPlanId":749,
"orderLines":[{
"unit":"USER",
"quantity":3
}],
"parameters":[{
"name":"BusinessName",
"value":"API Getting Started"
},
{
"name":"FirstName",
"value":"Billing"
},
{
"name":"LastName",
"value":"API"
},
{
"name":"Address/Line1",
"value":"650 California Street"
},
{
"name":"Address/Line2",
"value":"Floor 25"
},
{
"name":"Address/City",
"value":"San Francisco"
},
{
"name":"Address/State",
"value":"CA"
},
{
"name":"Address/PostalCode",
"value":"94108"
},
{
"name":"Address/ISO3Country",
"value":"USA"
},
{
"name":"Address/PhoneNumber",
"value":"5109289829"
},
{
"name":"AlternateEmail",
"value":"test@test.de"
},
{
"name":"UserPrincipleName",
"value":"testUser"
},
{
"name":"SubDomain",
"value":"subtest.onmicrosoft.com"
},
{
"name":"CommunicationLanguage",
"value":"en"
},
{
"name":"CommunicationCulture",
"value":"USA"
}]
}
}
- XML
POST https://appdirect.com/api/billing/v1/companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78/users/3d4d2342-b7c4-4865-85bd-842f269adae6/subscriptions
Host: www.appdirect.com
Authorization OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="VeJO1tP7RKUE1rz", oauth_timestamp="1438728054", oauth_consumer_key="appdirect-91", oauth_signature="xy37tmDbpwuIHZJIioRSB3GGAhM%3D"
Content-Type application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>749</paymentPlanId>
<orderLines>
<unit>USER</unit>
<quantity>3</quantity>
</orderLines>
<parameters>
<name>BusinessName</name>
<value>API Getting Started</value>
</parameters>
<parameters>
<name>FirstName</name>
<value>Billing</value>
</parameters>
<parameters>
<name>LastName</name>
<value>API</value>
</parameters>
<parameters>
<name>Address/Line1</name>
<value>650 California Street</value>
</parameters>
<parameters>
<name>Address/Line2</name>
<value>Floor 25</value>
</parameters>
<parameters>
<name>Address/City</name>
<value>San Francisco</value>
</parameters>
<parameters>
<name>Address/State</name>
<value>CA</value>
</parameters>
<parameters>
<name>Address/PostalCode</name>
<value>94108</value>
</parameters>
<parameters>
<name>Address/ISO3Country</name>
<value>USA</value>
</parameters>
<parameters>
<name>Address/PhoneNumber</name>
<value>5109289829</value>
</parameters>
<parameters>
<name>AlternateEmail</name>
<value>test@test.de</value>
</parameters>
<parameters>
<name>UserPrincipleName</name>
<value>testUser</value>
</parameters>
<parameters>
<name>SubDomain</name>
<value>subtest.onmicrosoft.com</value>
</parameters>
<parameters>
<name>CommunicationLanguage</name>
<value>en<value>
</parameters>
<parameters>
<name>CommunicationCulture</name>
<value>USA</value>
</parameters>
</order>
</subscription>
Response
- JSON
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1049
Content-Type: application/json;charset=UTF-8
Date: Tue, 11 Aug 2015 21:39:41 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"id": "1be642f4-64cd-4357-b0f0-14b476c47dfa",
"creationDate": "2015-08-11T15:39:39-06:00",
"status": "INITIALIZED",
"maxUsers": "1",
"order": {
"id": "1584",
"startDate": "2015-08-11T00:00:00-06:00",
"nextBillingDate": "2015-09-11T00:00:00-06:00",
"status": "PENDING_REMOTE_CREATION",
"frequency": "MONTHLY",
"currency": "USD",
"type": "NEW",
"totalPrice": "10.6300000000",
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "http://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "http://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"paymentPlan": {
"-href": "http://www.appdirect.com/api/marketplace/v1/products/93/editions/612/paymentPlans/749",
"id": "749",
"uuid": "eb483983-ce47-41a7-b304-e5b6bb89d818",
"frequency": "MONTHLY",
"contract": {
"blockContractDowngrades": "false",
"blockContractUpgrades": "false",
"blockSwitchToShorterContract": "false"
},
"allowCustomUsage": "false",
"keepBillDateOnUsageChange": "false",
"separatePrepaid": "false",
"isPrimaryPrice": "false",
"costs": {
"cost": [
{
"unit": "USER",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10.0000000000",
"CHF": "10.0000000000",
"USD": "10.0000000000"
}
},
{
"unit": "NOT_APPLICABLE",
"minUnits": "0.0000000000",
"meteredUsage": "false",
"pricePerIncrement": "false",
"blockContractDecrease": "false",
"blockContractIncrease": "false",
"blockOriginalContractDecrease": "false",
"amount": {
"CAD": "10.0000000000",
"CHF": "10.0000000000",
"USD": "10.0000000000"
}
}
]
}
},
"paymentPlanId": "749",
"activated": "false",
"orderLines": {
"orderLine": [
{
"description": "Office 365 Web Apps - Plan 1 - Monthly Fee",
"id": "2428",
"price": "10.0000000000",
"quantity": "1.0000000000",
"totalPrice": "10.0000000000",
"type": "ITEM",
"unit": "NOT_APPLICABLE"
},
{
"description": "Sales Tax",
"id": "2429",
"percentage": "6.3000000000",
"quantity": "1.0000000000",
"totalPrice": "0.6300000000",
"type": "TAX"
}
]
},
"user": {
"-id": "3d4d2342-b7c4-4865-85bd-842f269adae6",
"-href": "http://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"
},
"company": {
"-id": "a012bb88-c2c5-40a1-b140-ec6ed4593b78",
"-href": "http://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"
},
"product": {
"-id": "93",
"-href": "http://www.appdirect.com/api/marketplace/v1/products/93"
},
"edition": {
"-id": "612",
"-href": "http://www.appdirect.com/api/marketplace/v1/products/93/editions/612"
}
}
- XML
Status Code: 201 Created
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Length: 1049
Content-Type: application/xml;charset=UTF-8
Date: Tue, 11 Aug 2015 21:39:41 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Vary: Accept-Encoding
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription xmlns:atom="http://www.w3.org/2005/Atom">
<id>1be642f4-64cd-4357-b0f0-14b476c47dfa</id>
<creationDate>2015-08-11T15:39:39-06:00</creationDate>
<status>INITIALIZED</status>
<maxUsers>1</maxUsers>
<order>
<id>1584</id>
<startDate>2015-08-11T00:00:00-06:00</startDate>
<nextBillingDate>2015-09-11T00:00:00-06:00</nextBillingDate>
<status>PENDING_REMOTE_CREATION</status>
<frequency>MONTHLY</frequency>
<currency>USD</currency>
<type>NEW</type>
<totalPrice>10.6300000000</totalPrice>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="http://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="http://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<paymentPlan href="http://www.appdirect.com/api/marketplace/v1/products/93/editions/612/paymentPlans/749">
<id>749</id>
<uuid>eb483983-ce47-41a7-b304-e5b6bb89d818</uuid>
<frequency>MONTHLY</frequency>
<contract>
<blockContractDowngrades>false</blockContractDowngrades>
<blockContractUpgrades>false</blockContractUpgrades>
<blockSwitchToShorterContract>false</blockSwitchToShorterContract>
</contract>
<allowCustomUsage>false</allowCustomUsage>
<keepBillDateOnUsageChange>false</keepBillDateOnUsageChange>
<separatePrepaid>false</separatePrepaid>
<isPrimaryPrice>false</isPrimaryPrice>
<costs>
<cost>
<unit>USER</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10.0000000000</CAD>
<CHF>10.0000000000</CHF>
<USD>10.0000000000</USD>
</amount>
</cost>
<cost>
<unit>NOT_APPLICABLE</unit>
<minUnits>0.0000000000</minUnits>
<meteredUsage>false</meteredUsage>
<pricePerIncrement>false</pricePerIncrement>
<blockContractDecrease>false</blockContractDecrease>
<blockContractIncrease>false</blockContractIncrease>
<blockOriginalContractDecrease>false</blockOriginalContractDecrease>
<amount>
<CAD>10.0000000000</CAD>
<CHF>10.0000000000</CHF>
<USD>10.0000000000</USD>
</amount>
</cost>
</costs>
</paymentPlan>
<paymentPlanId>749</paymentPlanId>
<activated>false</activated>
<oneTimeOrders/>
<orderLines>
<orderLine>
<description>Office 365 Web Apps - Plan 1 - Monthly Fee</description>
<id>2428</id>
<price>10.0000000000</price>
<quantity>1.0000000000</quantity>
<totalPrice>10.0000000000</totalPrice>
<type>ITEM</type>
<unit>NOT_APPLICABLE</unit>
</orderLine>
<orderLine>
<description>Sales Tax</description>
<id>2429</id>
<percentage>6.3000000000</percentage>
<quantity>1.0000000000</quantity>
<totalPrice>0.6300000000</totalPrice>
<type>TAX</type>
</orderLine>
</orderLines>
<parameters/>
</order>
<user id="3d4d2342-b7c4-4865-85bd-842f269adae6" href="http://www.appdirect.com/api/account/v1//users/3d4d2342-b7c4-4865-85bd-842f269adae6"/>
<company id="a012bb88-c2c5-40a1-b140-ec6ed4593b78" href="http://www.appdirect.com/api/account/v1//companies/a012bb88-c2c5-40a1-b140-ec6ed4593b78"/>
<product id="93" href="http://www.appdirect.com/api/marketplace/v1/products/93"/>
<edition id="612" href="http://www.appdirect.com/api/marketplace/v1/products/93/editions/612"/>
</subscription>
Creating a subscription invalid discount
Below is an example of creating a subscription with a bad request caused by invalid data, specifically the discount code not being valid for the application.
Request
- JSON
{
"order": {
"paymentPlanId":749,
"discountId":25
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>749</paymentPlanId>
<discountId>25</discountId>
</order>
</subscription>
Response
- JSON
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 152
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 01:41:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"code": "DISCOUNT_NOT_VALID",
"message": "Discount cannot apply to this order."
}
- XML
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 152
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 01:41:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<errors>
<error>
<code>DISCOUNT_NOT_VALID</code>
<message>Discount cannot apply to this order.</message>
</error>
</errors>
Creating a subscription missing required data
Below is an example of creating a subscription with a bad request caused by missing required data, specifically the paymentPlanId field.
Request
- JSON
{
"order": {
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order />
</subscription>
Response
- JSON
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 152
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Aug 2015 01:41:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"code": "PAYMENT_PLAN_ID_MISSING",
"message": "Payment plan ID is missing."
}
- XML
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 152
Content-Type: application/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 01:41:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<errors>
<error>
<code>PAYMENT_PLAN_ID_MISSING</code>
<message>Payment plan ID is missing.</message>
</error>
</errors>
Creating a subscription with a bad request
Below is an example of creating a subscription with a bad request. In this case, the JSON object is missing a curly brace, while the XML is missing a closing tag.
Request
- JSON
{
"order": {
"paymentPlanId": "568"
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>568
</order>
</subscription>
Response
- JSON
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 133
Content-Type: text/json;charset=UTF-8
Date: Thu, 13 Aug 2015 01:29:50 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=36AF57502F9FA7774A5C25DB732DD8BF; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"code": "Bad Request",
"message": "Unexpected end-of-input: expected close marker for OBJECT (from [Source: org.apache.cxf.transport.http.AbstractHTTPDestination$1@41e290f5; line: 1, column: 0])"
}
- XML
Status Code: 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Connection: close
Content-Length: 133
Content-Type: text/xml;charset=UTF-8
Date: Thu, 13 Aug 2015 01:29:50 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=36AF57502F9FA7774A5C25DB732DD8BF; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<errors>
<error>
<code>Bad Request</code>
<message>HTTP 400 Bad Request</message>
</error>
</errors>
Creating a subscription for an existing entitlement
Below is an example of creating a subscription for an application that is already owned by the user and/or company. It can be the same edition or a different edition of the application.
Request
- JSON
{
"order": {
"paymentPlanId": "568"
}
}
- XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<subscription>
<order>
<paymentPlanId>568</paymentPlanId>
</order>
</subscription>
Response
- JSON
Status Code: 409 Conflict
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 166
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 23:28:03 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=5F84FC4F9EA36791D38C5E32869DBC29; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
{
"code": "APP_ALREADY_EXISTS",
"message": "Company has already purchased the application."
}
- XML
Status Code: 409 Conflict
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Length: 166
Content-Type: application/xml;charset=UTF-8
Date: Wed, 12 Aug 2015 23:28:03 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=5F84FC4F9EA36791D38C5E32869DBC29; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<code>APP_ALREADY_EXISTS</code>
<message>Company has already purchased the application.</message>
</error>
Was this page helpful?
Tell us more…
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!