GET /subscriptions
Requires authentication with server or user access token.
Subscriptions are products with time constraints and, optionally, renewal mechanisms.
Standard subscriptions
Standard subscriptions are basically products with an expiry date, and can be used to give customers access to some content for a limited duration. Examples include 24 hour movie rental, 1 month access to a collection of articles, etc.
Auto-renewable subscriptions
Auto-renewable subscriptions are like standard subscriptions, with the difference that they are automatically renewed. The initial subscription period may differ from the renewal period. This enables you to sell a 6 month subscription that will automatically renew once a month after the first expiration date.
Limited time subscription
Limited time subscriptions have start and stop dates, in addition to auto-renewal. The subscription will automatically renew until the subscription end date is reached.
As an example, episode-based digital content is a good fit for limited time subscriptions: If new episodes launch every week, create a subscription that is valid between the start and end date of a season, say January 1st and March 31st. Set auto-renewal to 1 week to match the episode frequency.
See also
Help us improve
Did you spot an error? Or maybe you just have a suggestion for how we can improve? Leave us a comment.
Request
GET /api/2/subscriptions
sort | optional |
---|---|
userId | optionalLimit results by the user's |
status | optionalLimit results to subscriptions with this status. |
filters | optional
|
The pagination parameters limit, offset, since, and until are also supported.
Example request
curl
Minimal example
curl https://login.schibsted.com/api/2/subscriptions -G \
-H "Authorization: Bearer [access token]"
With all parameters
curl https://login.schibsted.com/api/2/subscriptions -G \
-H "Authorization: Bearer [access token]" \
-d "sort=userId" \
-d "userId=42" \
-d "status=0"
Response
This endpoint supports the JSON and JSON-P response formats.
Success: 200 OK
A list of Subscription objects.
Subscription
subscriptionId ✓ | stringUnique ID of the subscription |
---|---|
originalSubscriptionId ✓ | stringUnique ID of the original subscription, if empty this is the first time user bought subscription for product |
clientId ✓ | stringYour client ID |
userId ✓ | stringUser id who bought the subscription |
productId ✓ | stringUnique product ID |
parentProductId | stringID of the parent product, if any |
identifierId ✓ | stringID of the payment identifier that will be used to renew the subscription |
paymentType ✓ | Payment type0 for Schibsted account, 1 for Payment Platform |
orderId ✓ | stringID of the original order |
startDate ✓ | datetimeFrom when the subscription is/was active |
originalPurchaseDate ✓ | datetimeWhen the subscription was originally purchased |
expires ✓ | datetimeWhen the subscription expires |
autoRenew ✓ | string, "1" (true) or "0" (false)If |
renewPrice ✓ | priceThe price of renewal, in cents |
currency ✓ | stringThe renewal price currency |
renewPeriod ✓ | timestamp, in secondsRenewal period |
autoRenewLockPeriod ✓ | timestamp, in secondsLength of the initial period after activation during which it is not allowed to change the auto renew setting for the subscription. |
stopRenewalAfterLock ✓ | string, "1" (true) or "0" (false)When |
autoRenewDisabled ✓ | string, "1" (true) or "0" (false)When |
gracePeriod | timestamp, in secondsThe length of the period the subscription stays active after charging for a renewal fails. |
emailReceiptCount ✓ | integer (as string)The number of receipts sent via email to the user |
finalEndDate | datetimeIf provided, this date denotes the time when the subscription will no longer be available for sale. |
chargeRetryCount ✓ | integer (as string)The number of times the previous charge has been retried |
chargeLastRetry | datetimeTime of the last charge retry |
status ✓ | Subscription statusThe subscription's current status |
statusChangeCode | Subscription status change codeA description of the last change to the subscription's status |
statusChangeDate | datetimeThe date of the last change to the subscription's status |
updated ✓ | datetimeDate and time of last update to the subscription |
created ✓ | datetimeDate and time when the subscription was created |
product ✓ | ProductThe product this subscription belongs to |
The check mark ✓ indicates that the field always contains a valid non-empty value.
Subscription status
An enum, with the following possible values:
| Expired |
---|---|
| Inactive |
| Active |
Subscription status change code
An enum, with the following possible values:
| Subscription expired via multiple failed payment method charge attempts |
---|---|
| Subscription expired via API |
| Subscription expired passively (auto_renew is off) |
| Subscription expired by force |
| Subscription expired because it is no longer for sale |
| Subscription expired because it was renewed (i.e., a new subscription has been created) |
| Subscription expired because the user deleted their account |
| Subscription was paused |
| Expiry date was changed |
| Subscription expired because the user disabled auto renewal |
| Subscription expired because auto renewal was turned off when migrated to Zuora |
| Subscription migrated to Siebel |
| Subscription migrated to Zuora |
Failure cases
Some HTTP response codes are used for multiple error situations. There is no consistent way to tell these apart, but the error object will contain a textual explanation of the reason for the error. For explanation on OAuth related failures and errors see OAuth authentication failures.
- 401 Unauthorized You don't have administration rights for this client.
- 401 Unauthorized Your client doesn't have administration rights for this client.
- 403 Forbidden Client is not authorized to access this API endpoint. Contact Schibsted account to request access.
- 403 Forbidden Requesting IP is not whitelisted
- 403 Forbidden Access token rejected
- 404 Not Found Unknown client ID
- 404 Not Found Client ID mismatch. The client making the request is no the owner of this resource, and does not have administrative privileges for it.
- 420 Request Ratelimit exceeded
Sample response
JSON
{
"1551": {
"subscriptionId": "1551",
"status": "1",
"originalPurchaseDate": "2014-08-05 15:27:43",
"renewPeriod": "2592000",
"clientId": "[Your client ID]",
"userId": "015724",
"currency": "NOK",
"statusChangeDate": null,
"chargeLastRetry": null,
"parentProductId": "301696",
"autoRenewLockPeriod": "0",
"expires": "2014-09-04 15:27:43",
"orderId": null,
"renewPrice": null,
"autoRenewChangeDate": null,
"startDate": "2014-08-05 15:27:43",
"autoRenewChangeBy": null,
"productId": "301696",
"created": "2014-08-05 15:27:43",
"updated": "2014-08-05 15:27:43",
"autoRenewDisabled": "0",
"autoRenew": "0",
"finalEndDate": null,
"originalSubscriptionId": null,
"statusChangeCode": null,
"chargeRetryCount": "0",
"emailReceiptCount": "0",
"identifierId": null,
"gracePeriod": "0"
}
}
JSON-P
callback({
"1551": {
"subscriptionId": "1551",
"status": "1",
"originalPurchaseDate": "2014-08-05 15:27:43",
"renewPeriod": "2592000",
"clientId": "[Your client ID]",
"userId": "015724",
"currency": "NOK",
"statusChangeDate": null,
"chargeLastRetry": null,
"parentProductId": "301696",
"autoRenewLockPeriod": "0",
"expires": "2014-09-04 15:27:43",
"orderId": null,
"renewPrice": null,
"autoRenewChangeDate": null,
"startDate": "2014-08-05 15:27:43",
"autoRenewChangeBy": null,
"productId": "301696",
"created": "2014-08-05 15:27:43",
"updated": "2014-08-05 15:27:43",
"autoRenewDisabled": "0",
"autoRenew": "0",
"finalEndDate": null,
"originalSubscriptionId": null,
"statusChangeCode": null,
"chargeRetryCount": "0",
"emailReceiptCount": "0",
"identifierId": null,
"gracePeriod": "0"
}
});
Comments/feedback
Do you have questions, or just want to contribute some newly gained insight? Want to share an example? Please leave a comment. Our team reads and responds to every question. Additionally, your experience can help others using Schibsted account, and it can help us continuously improve our documentation.