LogoLogo
System Status
2021-03-23
2021-03-23
  • 2021-03-23
  • Charges
  • Checkouts
  • Country specifications
  • Customers
  • Events
  • Fees
  • File links
  • Files
  • Fulfillment cancellations
  • Fulfillment orders
  • Fulfillment returns
  • Fulfillments
  • Inventory items
  • Inventory levels
  • Invoices
  • Orders
  • Payouts
  • Plans
  • Refunds
  • Reservations
  • Returns
  • Sales summaries
  • Sales transactions
  • Shipments
  • Shipping quotes
  • SKUs
  • SKU groups
  • Sources
  • Subscriptions
  • Tax identifiers
  • Webhooks
Powered by GitBook
On this page

Subscriptions

PreviousSourcesNextTax identifiers

Last updated 6 months ago

A defines the details of the recurring subscription order.

subscription

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
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /subscriptions HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "hasMore": true,
  "data": [
    {
      "contractBindingUntil": "2025-05-09T06:27:12.604Z",
      "createdTime": "2025-05-09T06:27:12.604Z",
      "updatedTime": "2025-05-09T06:27:12.604Z",
      "stateTransitions": {
        "activated": "2025-05-09T06:27:12.604Z",
        "activatedFree": "2025-05-09T06:27:12.604Z",
        "failed": "2025-05-09T06:27:12.604Z",
        "cancelled": "text",
        "ended": "text"
      },
      "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",
          "quantity": 1
        }
      ],
      "currentPeriodEndDate": "2025-05-09T06:27:12.604Z",
      "nextInvoiceDate": "2025-05-09T06:27:12.604Z",
      "nextReminderDate": "2025-05-09T06:27:12.604Z",
      "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
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
404 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /subscriptions/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "contractBindingUntil": "2025-05-09T06:27:12.604Z",
  "createdTime": "2025-05-09T06:27:12.604Z",
  "updatedTime": "2025-05-09T06:27:12.604Z",
  "stateTransitions": {
    "activated": "2025-05-09T06:27:12.604Z",
    "activatedFree": "2025-05-09T06:27:12.604Z",
    "failed": "2025-05-09T06:27:12.604Z",
    "cancelled": "text",
    "ended": "text"
  },
  "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",
      "quantity": 1
    }
  ],
  "currentPeriodEndDate": "2025-05-09T06:27:12.604Z",
  "nextInvoiceDate": "2025-05-09T06:27:12.604Z",
  "nextReminderDate": "2025-05-09T06:27:12.604Z",
  "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
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
delete
DELETE /subscriptions/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

  • GETReturns a list of Subscriptions
  • GETGets a Subscription by ID
  • POSTUpdates a Subscription
  • DELETEDeletes a Subscription by ID

Updates a 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
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
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: 266

{
  "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",
      "quantity": 1
    }
  ],
  "metadata": {
    "coupon": "iOS"
  }
}
{
  "contractBindingUntil": "2025-05-09T06:27:12.604Z",
  "createdTime": "2025-05-09T06:27:12.604Z",
  "updatedTime": "2025-05-09T06:27:12.604Z",
  "stateTransitions": {
    "activated": "2025-05-09T06:27:12.604Z",
    "activatedFree": "2025-05-09T06:27:12.604Z",
    "failed": "2025-05-09T06:27:12.604Z",
    "cancelled": "text",
    "ended": "text"
  },
  "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",
      "quantity": 1
    }
  ],
  "currentPeriodEndDate": "2025-05-09T06:27:12.604Z",
  "nextInvoiceDate": "2025-05-09T06:27:12.604Z",
  "nextReminderDate": "2025-05-09T06:27:12.604Z",
  "metadata": {
    "coupon": "iOS"
  }
}