Adding a Lifetime Complimentary Subscription to a Subscriber

To add a lifetime complimentary subscription to a subscriber, do an HTTP POST like so:

[ ~ ] $ curl -i -u 2dac9d3d93326f97da4845d407789da232514b48:X \
-H 'Content-Type: application/xml' \
-d '
<lifetime-complimentary-subscription>
  <feature-level>Pro</feature-level>
</lifetime-complimentary-subscription>' \
https://spreedly.com/api/v4/meresheep/subscribers/444/lifetime_complimentary_subscriptions.xml

Here is the response:

<?xml version="1.0" encoding="UTF-8"?>
<subscriber>
  <active-until type="datetime">2009-12-23T18:53:21Z</active-until>
  <billing-first-name nil="true"></billing-first-name>
  <billing-last-name nil="true"></billing-last-name>
  <created-at type="datetime">2009-12-21T19:03:08Z</created-at>
  <customer-id>444</customer-id>
  <eligible-for-free-trial type="boolean">false</eligible-for-free-trial>
  <email nil="true"></email>
  <grace-until type="datetime">2009-12-23T18:53:21Z</grace-until>
  <lifetime-subscription type="boolean">true</lifetime-subscription>
  <on-trial type="boolean">false</on-trial>
  <ready-to-renew type="boolean">false</ready-to-renew>
  <screen-name>447</screen-name>
  <store-credit type="decimal">1.0</store-credit>
  <store-credit-currency-code>USD</store-credit-currency-code>
  <token>eba32476e4cdcdcc39ec8714cebe4272dc02ffce</token>
  <updated-at type="datetime">2010-01-08T20:14:08Z</updated-at>
  <recurring type="boolean">false</recurring>
  <card-expires-before-next-auto-renew type="boolean">false</card-expires-before-next-auto-renew>
  <subscription-plan-name></subscription-plan-name>
  <active type="boolean">true</active>
  <in-grace-period type="boolean">false</in-grace-period>
  <feature-level type="string">SUPER Basic</feature-level>
</subscriber>

If successful, a status code of 201 (Created) is returned. The xml of the subscriber is returned in the response body. In addition, the Location header in the response will be set to the url of the subscriber.

A 404 (Not Found) status code is returned if there is no subscriber with the customer id. A 422 (Unprocessable Entity) is returned if there are any validation errors on the passed in Lifetime Complimentary Subscription.

Return to the Integration Reference ↑

Olark Livehelp