---
title: "Subscription Immediate Midterm Change API - Store cart for subscription owner"
method: POST
path: "/v1/subscriptions/{subId}/preview-cart"
tags: ["Immediate Midterm Change"]
---

# Subscription Immediate Midterm Change API - Store cart for subscription owner

`POST /v1/subscriptions/{subId}/preview-cart`

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

- `subId` string, required

## Headers

- `token` string, required
- `principal` string

## Request body

- SubAddOnChangeRequest
  - `addOns` SubAddOnForPostReq[], required
    - `product` ProductForPostReq, required
      - `id` string — Product id
      - `externalReferenceId` string — Product external reference id
    - `quantity` integer, required — Addon product quantity
    - `proratedUnitPrice` number — If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.
  - `product` ProductForPostReq, required
    - `id` string — Product id
    - `externalReferenceId` string — Product external reference id
  - `quantity` integer, required — Product quantity
  - `proratedUnitPrice` number — If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.

## Response `200`

OK

- PreviewResponseWithCart
  - `subscriptionId` string — Subscription id
  - `subTotal` number — Subscription total amount
  - `credit` number — Credit amount
  - `totalAmountDue` number — Total amount due
  - `totalTax` number — Total tax
  - `currency` string — Currency
  - `prorationDate` string — Proration date
  - `isCartNeeded` boolean — Is cart needed
  - `isPaymentOnFile` boolean — Is payment on file
  - `previewCharges` object[]
    - `productId` string — Product id
    - `quantity` integer — Quantity
    - `unitPrice` number — Unit price
    - `proratedUnitPrice` number — Prorated unit price
  - `previewSubscription` SubAddOnChangeRequest
    - `addOns` SubAddOnForPostReq[], required
      - `product` ProductForPostReq, required
        - `id` string — Product id
        - `externalReferenceId` string — Product external reference id
      - `quantity` integer, required — Addon product quantity
      - `proratedUnitPrice` number — If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.
    - `product` ProductForPostReq, required
      - `id` string — Product id
      - `externalReferenceId` string — Product external reference id
    - `quantity` integer, required — Product quantity
    - `proratedUnitPrice` number — If “proratedUnitPrice” attribute is present then it overrides all other prices and skip normal proration.
  - `reduceActionUrl` string — Reduct action URL
  - `cart` CartResponse
    - `token` string — token
    - `url` string — Web checkout URL

## Other responses

- `400` — * Bad request
- `401` — Please verify your API key and secret (if applicable) is correct.
- `403` — * Access Denied
- `404` — * Not found

---

[API](https://skmtc.net/digitalriver/apis/commerce-api-suite-admin-apis.md) · [All operations](https://skmtc.net/digitalriver/apis/commerce-api-suite-admin-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalriver/commerce-api-suite-admin-apis/revisions/a6efafc1669c/schema)
