Payment Services

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

optional

Limit results by the user's uuid or userId (not to be mistaken with the deprecated id).

status

optional

Limit results to subscriptions with this status.

filters

optional
updated
Filter by recently updated items, order by last updated (should be used with since & until)
expired
Return all items with status expired
inactive
Filter by items with status inactive (e.g. disabled)
active
Filter by items with status active
all
Include all items in the response, including deleted/blocked or otherwise excluded items
none
Do not apply any status filters (e.g. same as 'all')

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

string

Unique ID of the subscription

originalSubscriptionId

string

Unique ID of the original subscription, if empty this is the first time user bought subscription for product

clientId

string

Your client ID

userId

string

User id who bought the subscription

productId

string

Unique product ID

parentProductId

string

ID of the parent product, if any

identifierId

string

ID of the payment identifier that will be used to renew the subscription

paymentType

Payment type

0 for Schibsted account, 1 for Payment Platform

orderId

string

ID of the original order

startDate

datetime

From when the subscription is/was active

originalPurchaseDate

datetime

When the subscription was originally purchased

expires

datetime

When the subscription expires

autoRenew

string, "1" (true) or "0" (false)

If "1", the subscription will automatically renew on the expires date.

renewPrice

price

The price of renewal, in cents

currency

string

The renewal price currency

renewPeriod

timestamp, in seconds

Renewal period

autoRenewLockPeriod

timestamp, in seconds

Length 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 "1", the subscription's auto renew will be stoped after the lock period is over.

autoRenewDisabled

string, "1" (true) or "0" (false)

When "1", the subscription's auto renew cannot be changed.

gracePeriod

timestamp, in seconds

The 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

datetime

If 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

datetime

Time of the last charge retry

status

Subscription status

The subscription's current status

statusChangeCode

Subscription status change code

A description of the last change to the subscription's status

statusChangeDate

datetime

The date of the last change to the subscription's status

updated

datetime

Date and time of last update to the subscription

created

datetime

Date and time when the subscription was created

product

Product

The 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:

"-1"

Expired

"0"

Inactive

"1"

Active

Subscription status change code

An enum, with the following possible values:

"100"

Subscription expired via multiple failed payment method charge attempts

"110"

Subscription expired via API

"120"

Subscription expired passively (auto_renew is off)

"130"

Subscription expired by force

"140"

Subscription expired because it is no longer for sale

"150"

Subscription expired because it was renewed (i.e., a new subscription has been created)

"160"

Subscription expired because the user deleted their account

"170"

Subscription was paused

"180"

Expiry date was changed

"190"

Subscription expired because the user disabled auto renewal

"191"

Subscription expired because auto renewal was turned off when migrated to Zuora

"200"

Subscription migrated to Siebel

"201"

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.