Viki Platform

Create Subscription

Creates a subscription for the user. Currently only creates subscriptions for Apple IAP. If the user is logged in (passing a token query parameter) the subscription is created for that user. If there is no user (no token is passed) a new user is created and then the subscription is associated to this new "fake" user.

The endpoint returns a new session after the subscription has been created. This is so to avoid having to make a subsequent call to the sessions endpoint in order to get a new token with the right permissions.

GET /v5/subscriptions.json

Expected body parameters: - apple - plan_id - apple_token

Example:

{"apple": {"plan_id": "1p", "apple_token": "asdFDSdsl12jfkFD"}}

The apple_token parameter is a the receipt that Apple returns to the user after the mobile purchase. It is used to make calls to Apple servers in order to get information about the transaction.

Optional parameters: - source - device - method - partner - platform

Example:

{"apple": {"plan_id": "1p", "apple_token": "asdFDSdsl12jfkFD"}, "source": {"device": "iphone5", "method": "apple", "partner": "yahoo", "platform": "ios"}}

The source parameters are used to register additional information for a newly created user.