Subscriptions

The Subscriptions resource is a key component in managing recurring billing for digital services or products. It allows businesses to automate payment processes, ensuring a seamless and consistent customer experience. By defining the details of a recurring subscription order, this resource helps in tracking and maintaining customer engagement through personalized and flexible billing cycles.

Returns a list of Subscriptions

get

Gets the Subscriptions specified in the request.

Authorizations
Query parameters
planIdstringOptional

The identifier of the plan associated with the subscriptions you want to retrieve.

statestringOptional

The state associated with the subscriptions you want to retrieve.

customerIdstringOptional

The identifer of the subscribing customer of the subscriptions you want to retrieve.

endingBeforestringOptional

A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xzy, your subsequent calls can include endingBefore=xzy in order to fetch the previous page of the list.

startingAfterstringOptional

A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xzy, your subsequent calls can include startingAfter=xzy in order to fetch the next page of the list.

limitintegerOptional

A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10.

Responses
200
200 OK
application/json
get
GET /subscriptions HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hasMore": true,
  "data": [
    {
      "contractBindingUntil": "2025-06-25T14:17:29.851Z",
      "createdTime": "2021-06-01T13:15:10.1077785Z",
      "updatedTime": "2021-06-01T13:17:10.1077788Z",
      "stateTransitions": {
        "activated": "2018-04-25T20:36:00Z",
        "activatedFree": "2018-04-25T20:36:00Z",
        "failed": "2018-04-25T20:36:00Z",
        "cancelled": "2018-04-25T20:36:00Z",
        "ended": "2018-04-25T20:36:00Z",
        "lapsed": "2018-04-25T20:36:00Z"
      },
      "liveMode": false,
      "id": "fb941eef-c3bb-42f8-bd47-f6da8bf6245d",
      "billingAgreementId": "24b217a7-79b5-4c84-8cae-34370646092f",
      "customerId": "exampleCustomerId",
      "sourceId": "exampleSourceId",
      "taxInclusive": true,
      "currency": "EUR",
      "planId": "4a1a1fdd-2f7b-4a4e-92d2-2e843f06e82a",
      "applicationId": "test",
      "locale": "de_DE",
      "state": "active",
      "items": [
        {
          "aggregatePrice": 20,
          "price": 9.99,
          "metadata": {
            "coupon": "iOS"
          },
          "skuId": "1db7a3d6-1f4d-4d13-8ddc-ef4eccc6bd93",
          "productDetails": {
            "id": "100067660336",
            "skuGroupId": "wireless-keyboards",
            "name": "Keyboard",
            "description": "Top rated keyboard",
            "itemBreadcrumb": "Sports & Outdoors > Exercise & Fitness > Wearable Technology > Fitness Trackers",
            "url": "https://producturl.com",
            "countryOfOrigin": "US",
            "image": "https://imageurl.com",
            "weight": 20.5,
            "weightUnit": "oz",
            "partNumber": "SWG1224J10L",
            "partnerAccountId": "00g6atnynbl2wFsFG357"
          },
          "quantity": 1
        }
      ],
      "currentPeriodStartDate": "2025-06-25T14:17:29.851Z",
      "currentPeriodEndDate": "2025-06-25T14:17:29.851Z",
      "nextInvoiceDate": "2021-07-02T13:15:10.0875833Z",
      "nextReminderDate": "2025-06-25T14:17:29.851Z",
      "metadata": {
        "coupon": "iOS"
      }
    }
  ]
}

Gets a Subscription by ID

get

Retrieves the details of a Subscription.

Authorizations
Path parameters
idstringRequired

Subscription identifier.

Responses
200
OK.
application/json
get
GET /subscriptions/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "contractBindingUntil": "2025-06-25T14:17:29.851Z",
  "createdTime": "2021-06-01T13:15:10.1077785Z",
  "updatedTime": "2021-06-01T13:17:10.1077788Z",
  "stateTransitions": {
    "activated": "2018-04-25T20:36:00Z",
    "activatedFree": "2018-04-25T20:36:00Z",
    "failed": "2018-04-25T20:36:00Z",
    "cancelled": "2018-04-25T20:36:00Z",
    "ended": "2018-04-25T20:36:00Z",
    "lapsed": "2018-04-25T20:36:00Z"
  },
  "liveMode": false,
  "id": "fb941eef-c3bb-42f8-bd47-f6da8bf6245d",
  "billingAgreementId": "24b217a7-79b5-4c84-8cae-34370646092f",
  "customerId": "exampleCustomerId",
  "sourceId": "exampleSourceId",
  "taxInclusive": true,
  "currency": "EUR",
  "planId": "4a1a1fdd-2f7b-4a4e-92d2-2e843f06e82a",
  "applicationId": "test",
  "locale": "de_DE",
  "state": "active",
  "items": [
    {
      "aggregatePrice": 20,
      "price": 9.99,
      "metadata": {
        "coupon": "iOS"
      },
      "skuId": "1db7a3d6-1f4d-4d13-8ddc-ef4eccc6bd93",
      "productDetails": {
        "id": "100067660336",
        "skuGroupId": "wireless-keyboards",
        "name": "Keyboard",
        "description": "Top rated keyboard",
        "itemBreadcrumb": "Sports & Outdoors > Exercise & Fitness > Wearable Technology > Fitness Trackers",
        "url": "https://producturl.com",
        "countryOfOrigin": "US",
        "image": "https://imageurl.com",
        "weight": 20.5,
        "weightUnit": "oz",
        "partNumber": "SWG1224J10L",
        "partnerAccountId": "00g6atnynbl2wFsFG357"
      },
      "quantity": 1
    }
  ],
  "currentPeriodStartDate": "2025-06-25T14:17:29.851Z",
  "currentPeriodEndDate": "2025-06-25T14:17:29.851Z",
  "nextInvoiceDate": "2021-07-02T13:15:10.0875833Z",
  "nextReminderDate": "2025-06-25T14:17:29.851Z",
  "metadata": {
    "coupon": "iOS"
  }
}

Updates the Subscription

post

Updates the specified Subscription

Authorizations
Path parameters
idstringRequired

The Subscription identifier.

Body
planIdstringRequired

The Plan identifier.

Example: string
applicationIdstring | nullableOptional

The identifier of the client application that created the subscription.

Example: test
localestring | nullableOptional

A locale designator that combines the two-letter ISO 639-1 language code with a ISO 3166-1 alpha-2 country code.

Example: de_DE
statestring · enumOptional

The state of the subscription

Example: activePossible values:
sourceIdstringOptional

The unique identifier of the subscription's reusable payment source.

Example: exampleSourceId
Responses
200
200 OK
application/json
post
POST /subscriptions/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 677

{
  "planId": "string",
  "applicationId": "test",
  "locale": "de_DE",
  "state": "active",
  "sourceId": "exampleSourceId",
  "items": [
    {
      "aggregatePrice": 20,
      "price": 9.99,
      "metadata": {
        "coupon": "iOS"
      },
      "skuId": "1db7a3d6-1f4d-4d13-8ddc-ef4eccc6bd93",
      "productDetails": {
        "id": "100067660336",
        "skuGroupId": "wireless-keyboards",
        "name": "Keyboard",
        "description": "Top rated keyboard",
        "itemBreadcrumb": "Sports & Outdoors > Exercise & Fitness > Wearable Technology > Fitness Trackers",
        "url": "https://producturl.com",
        "countryOfOrigin": "US",
        "image": "https://imageurl.com",
        "weight": 20.5,
        "weightUnit": "oz",
        "partNumber": "SWG1224J10L",
        "partnerAccountId": "00g6atnynbl2wFsFG357"
      },
      "quantity": 1
    }
  ],
  "metadata": {
    "coupon": "iOS"
  }
}
{
  "contractBindingUntil": "2025-06-25T14:17:29.851Z",
  "createdTime": "2021-06-01T13:15:10.1077785Z",
  "updatedTime": "2021-06-01T13:17:10.1077788Z",
  "stateTransitions": {
    "activated": "2018-04-25T20:36:00Z",
    "activatedFree": "2018-04-25T20:36:00Z",
    "failed": "2018-04-25T20:36:00Z",
    "cancelled": "2018-04-25T20:36:00Z",
    "ended": "2018-04-25T20:36:00Z",
    "lapsed": "2018-04-25T20:36:00Z"
  },
  "liveMode": false,
  "id": "fb941eef-c3bb-42f8-bd47-f6da8bf6245d",
  "billingAgreementId": "24b217a7-79b5-4c84-8cae-34370646092f",
  "customerId": "exampleCustomerId",
  "sourceId": "exampleSourceId",
  "taxInclusive": true,
  "currency": "EUR",
  "planId": "4a1a1fdd-2f7b-4a4e-92d2-2e843f06e82a",
  "applicationId": "test",
  "locale": "de_DE",
  "state": "active",
  "items": [
    {
      "aggregatePrice": 20,
      "price": 9.99,
      "metadata": {
        "coupon": "iOS"
      },
      "skuId": "1db7a3d6-1f4d-4d13-8ddc-ef4eccc6bd93",
      "productDetails": {
        "id": "100067660336",
        "skuGroupId": "wireless-keyboards",
        "name": "Keyboard",
        "description": "Top rated keyboard",
        "itemBreadcrumb": "Sports & Outdoors > Exercise & Fitness > Wearable Technology > Fitness Trackers",
        "url": "https://producturl.com",
        "countryOfOrigin": "US",
        "image": "https://imageurl.com",
        "weight": 20.5,
        "weightUnit": "oz",
        "partNumber": "SWG1224J10L",
        "partnerAccountId": "00g6atnynbl2wFsFG357"
      },
      "quantity": 1
    }
  ],
  "currentPeriodStartDate": "2025-06-25T14:17:29.851Z",
  "currentPeriodEndDate": "2025-06-25T14:17:29.851Z",
  "nextInvoiceDate": "2021-07-02T13:15:10.0875833Z",
  "nextReminderDate": "2025-06-25T14:17:29.851Z",
  "metadata": {
    "coupon": "iOS"
  }
}

Deletes a Subscription by ID

delete

Permanently deletes a subscription. Supply the unique identifier of the Subscription.

Authorizations
Path parameters
idstringRequired

Subscription identifier

Responses
204
204 No Content
delete
DELETE /subscriptions/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated