Apply an immediate midterm change
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.
Subscription Id
Basic authorization (dispatch Key and Secret) - Client Admin key
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.
Product quantity
If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.
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"
}
}
This API to change the subscription quantity immediately so that client have increased subscription management capability via API
Subscription Id
Basic authorization (dispatch Key and Secret) - Client Admin key or Full access token
Product quantity
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
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.
Subscription Id
Basic authorization (dispatch Key and Secret) - Client Admin key
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.
Product quantity
If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.
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"
}
Last updated