LogoLogo
System status
Admin APIs reference
Admin APIs reference
  • Admin APIs reference
  • Order management
    • Refunds
    • Retrieve an order (synchronous API)
    • Retrieve an invoice (synchronous API)
    • Manage orders (synchronous API)
  • Customer management
    • Retrieve a customer (synchronous API)
    • Manage a customer (synchronous API)
  • Subscription mangement
    • Manage a subscription
    • Renew a subscription
    • Apply an immediate midterm change
    • Manage subscription payments
    • Modify the subscription's external reference ID
    • Manage the subscription's address
    • Get all orders
    • Retrieve subscriptions with pending actions
    • Retrieve subscriptions
    • Manage a perpetual price
    • Update a subscription's email address
  • Site management
    • Get authorized countries
  • Product management
    • Manage products (asynchronous API)
    • Retrieve a product (synchronous API)
    • Retrieve the product task status (synchronous API)
  • Offer Management
    • Manage offers (synchronous API)
    • Retrieve an offer (synchronous API)
  • Webhook management
    • Manage webhook events
  • Payment source
    • Source management
  • File management
    • Retrieve a file
Powered by GitBook
On this page
  1. Subscription mangement

Apply an immediate midterm change

PreviousRenew a subscriptionNextManage subscription payments

Last updated 1 year ago

  • POSTSubscription Immediate Midterm Change API - Store cart for subscription owner
  • POSTReduce Subscription's Quantity Or Addons
  • POSTSubscription Immediate Midterm Change API - Doesn't store cart for subscription owner

Subscription Immediate Midterm Change API - Store cart for subscription owner

post

Preview Change API provides the preview response for the changes which includes the credit, sub total, total tax and total amount due to be paid if the preview changes results in due amount. This API return the cart details (if created) in the response of the preview API. If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration. If “proratedUnitPrice” attribute is not present then GC pricing and proration applies. If subscription is perpetual subscription and we don’t pass “proratedUnitPrice” attribute into the request payload then prorated transaction price calculates on the basis of perpetual price.

Path parameters
subIdstringRequired

Subscription Id

Header parameters
tokenstringRequired

Basic authorization (dispatch Key and Secret) - Client Admin key

principalstringOptional

principal header is required only for price overriding. By default principal type will be a site. Other principal type (company, user) need to pass explicitly in header.

Body
quantityinteger · int32Required

Product quantity

proratedUnitPricenumberOptional

If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.

Responses
200
OK
application/json
400
* Bad request
application/json
401
Please verify your API key and secret (if applicable) is correct.
403
* Access Denied
application/json
404
* Not found
application/json
post
POST /v1/subscriptions/{subId}/preview-cart HTTP/1.1
Host: api.digitalriver.com
token: text
Content-Type: application/json
Accept: */*
Content-Length: 190

{
  "addOns": [
    {
      "product": {
        "id": "text",
        "externalReferenceId": "text"
      },
      "quantity": 1,
      "proratedUnitPrice": 1
    }
  ],
  "product": {
    "id": "text",
    "externalReferenceId": "text"
  },
  "quantity": 1,
  "proratedUnitPrice": 1
}
{
  "subscriptionId": "text",
  "subTotal": 1,
  "credit": 1,
  "totalAmountDue": 1,
  "totalTax": 1,
  "currency": "text",
  "prorationDate": "text",
  "isCartNeeded": true,
  "isPaymentOnFile": true,
  "previewCharges": [
    {
      "productId": "text",
      "quantity": 1,
      "unitPrice": 1,
      "proratedUnitPrice": 1
    }
  ],
  "previewSubscription": {
    "addOns": [
      {
        "product": {
          "id": "text",
          "externalReferenceId": "text"
        },
        "quantity": 1,
        "proratedUnitPrice": 1
      }
    ],
    "product": {
      "id": "text",
      "externalReferenceId": "text"
    },
    "quantity": 1,
    "proratedUnitPrice": 1
  },
  "reduceActionUrl": "text",
  "cart": {
    "token": "text",
    "url": "text"
  }
}

Reduce Subscription's Quantity Or Addons

post

This API to change the subscription quantity immediately so that client have increased subscription management capability via API

Path parameters
subIdstringRequired

Subscription Id

Header parameters
tokenstringRequired

Basic authorization (dispatch Key and Secret) - Client Admin key or Full access token

Body
quantityinteger · int32Required

Product quantity

Responses
202
Accepted
400
* Bad request
application/json
401
Please verify your API key and secret (if applicable) is correct.
403
* Access Denied
application/json
404
* Not found
application/json
post
POST /v1/subscriptions/{subId}/reduce HTTP/1.1
Host: api.digitalriver.com
token: text
Content-Type: application/json
Accept: */*
Content-Length: 146

{
  "addOns": [
    {
      "product": {
        "id": "text",
        "externalReferenceId": "text"
      },
      "quantity": 1
    }
  ],
  "product": {
    "id": "text",
    "externalReferenceId": "text"
  },
  "quantity": 1
}

No content

Subscription Immediate Midterm Change API - Doesn't store cart for subscription owner

post

Preview Change API provides the preview response for the changes which includes the credit, sub total, total tax and total amount due to be paid if the preview changes results in due amount. This API does not return the cart details (if created) in the response of the preview API. If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration. If “proratedUnitPrice” attribute is not present then GC pricing and proration applies. If subscription is perpetual subscription and we don’t pass “proratedUnitPrice” attribute into the request payload then prorated transaction price calculates on the basis of perpetual price.

Path parameters
subIdstringRequired

Subscription Id

Header parameters
tokenstringRequired

Basic authorization (dispatch Key and Secret) - Client Admin key

principalstringOptional

principal header is required only for price overriding. By default principal type will be a site. Other principal type (company, user) need to pass explicitly in header.

Body
quantityinteger · int32Required

Product quantity

proratedUnitPricenumberOptional

If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.

Responses
200
OK
application/json
400
* Bad request
application/json
401
Please verify your API key and secret (if applicable) is correct.
403
* Access Denied
application/json
404
* Not found
application/json
post
POST /v1/subscriptions/{subId}/preview HTTP/1.1
Host: api.digitalriver.com
token: text
Content-Type: application/json
Accept: */*
Content-Length: 190

{
  "addOns": [
    {
      "product": {
        "id": "text",
        "externalReferenceId": "text"
      },
      "quantity": 1,
      "proratedUnitPrice": 1
    }
  ],
  "product": {
    "id": "text",
    "externalReferenceId": "text"
  },
  "quantity": 1,
  "proratedUnitPrice": 1
}
{
  "subscriptionId": "text",
  "subTotal": 1,
  "credit": 1,
  "totalAmountDue": 1,
  "totalTax": 1,
  "currency": "text",
  "prorationDate": "text",
  "isCartNeeded": true,
  "isPaymentOnFile": true,
  "previewCharges": [
    {
      "productId": "text",
      "quantity": 1,
      "unitPrice": 1,
      "proratedUnitPrice": 1
    }
  ],
  "previewSubscription": {
    "addOns": [
      {
        "product": {
          "id": "text",
          "externalReferenceId": "text"
        },
        "quantity": 1,
        "proratedUnitPrice": 1
      }
    ],
    "product": {
      "id": "text",
      "externalReferenceId": "text"
    },
    "quantity": 1,
    "proratedUnitPrice": 1
  },
  "reduceActionUrl": "text"
}