Manage a subscription

Update the subscription's expiration date

This method updates the subscription's expiration date by including its subscription ID in the {subId} URI path parameter.

POSThttps://api.digitalriver.com/v1/subscriptions/{subId}/expiration-date
Path parameters
subId*string

The subscription's ID.

Header parameters
Body
expirationDate*string (date-time)

The subscription expiration date in "2020-10-11T01:23:48.000Z", "2020-10-11T01:23:48.000-0500", "2020-10-11T01:23:48.000+1100".

Response

Accepted

Request
const response = await fetch('https://api.digitalriver.com/v1/subscriptions/{subId}/expiration-date', {
    method: 'POST',
    headers: {
      "token": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "expirationDate": "2024-12-04T18:55:53.052Z"
    }),
});
const data = await response.json();
Response
{
  "errors": {
    "error": [
      {
        "code": "validation-error",
        "subCode": "required-data-missing",
        "description": "Missing required data: companyId"
      }
    ]
  }
}

Cancel a subscription

This method cancels a subscription by including the subscripton ID in the {subId} URI path parameter. Once completed, the Subscription state changes to Cancelled.

POSThttps://api.digitalriver.com/v1/subscriptions/{subId}/cancel
Path parameters
subId*string

The subscription's ID.

Header parameters
Body
suppressCancelNotificationboolean

The clients can use this element to suppress cancel notification email.By default this is false.

Response

Accepted

Request
const response = await fetch('https://api.digitalriver.com/v1/subscriptions/{subId}/cancel', {
    method: 'POST',
    headers: {
      "token": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "errors": {
    "error": [
      {
        "code": "validation-error",
        "subCode": "required-data-missing",
        "description": "Missing required data: companyId"
      }
    ]
  }
}

Activate a subscription

This method activates a subscription by including the ID in the {subId} URI path parameter. Once complete, the Subscription state changes from PendingActivation to Subscribed.

POSThttps://api.digitalriver.com/v1/subscriptions/{subId}/activate
Path parameters
subId*string

The subscription's ID.

Header parameters
Body
activationKey*string

The subscription activation key

activationDatestring (date-time)

The subscription activation date in "2020-10-11T01:23:48.000Z", "2020-10-11T01:23:48.000-0500", "2020-10-11T01:23:48.000+1100".

expirationDatestring (date-time)

The subscription expiration date in "2020-10-11T01:23:48.000Z", "2020-10-11T01:23:48.000-0500", "2020-10-11T01:23:48.000+1100".

Response

Accepted

Request
const response = await fetch('https://api.digitalriver.com/v1/subscriptions/{subId}/activate', {
    method: 'POST',
    headers: {
      "token": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "activationKey": "text"
    }),
});
const data = await response.json();
Response
{
  "errors": {
    "error": [
      {
        "code": "validation-error",
        "subCode": "required-data-missing",
        "description": "Missing required data: companyId"
      }
    ]
  }
}

Last updated