v1

latestOpenAPI 3.0.02026-07-2475182625.5 KB
Subscriptions

Update a subscription

Updates active subscriptions, including product changes, discounts, add-ons, renewal settings, and more.

post/subscriptions

Request body

Example request

{
  "subscriptions": [
    {
      "subscription": "aBCDE12fGH3iJkL4mNOpqr",
      "product": "new-monthly-subscription",
      "quantity": 1,
      "next": "2025-12-31",
      "end": "2025-12-31",
      "isEndDateSet": true,
      "coupons": [
        "coupon_code"
      ],
      "addons": [
        {
          "product": "add-on-product-path",
          "pricing": {
            "price": {
              "USD": 5
            }
          }
        }
      ],
      "pricing": {
        "price": {
          "USD": 10
        },
        "discount": {
          "type": "amount",
          "amount": 3.5,
          "percentage": 5,
          "duration": "all"
        }
      },
      "manualRenew": true,
      "taxExemptId": "tax-exempt-id",
      "prorate": true,
      "preview": true,
      "remainingPeriods": 4
    }
  ]
}

Response

OK

Example response

{
  "subscriptions": [
    {
      "subscription": "aBCDE12fGH3iJkL4mNOpqr",
      "action": "subscription.update",
      "result": "success",
      "prorated": true,
      "proration": {
        "productPath": "add-on-subscription",
        "currency": "USD",
        "nextPeriodStartDate": "2025-11-01T00:00:00.000Z",
        "nextPeriodEndDate": "2025-11-30T00:00:00.000Z",
        "previousRemainingDays": 29,
        "periodPastDays": 1,
        "nextRemainingDays": 29,
        "regularPeriod": {
          "unit": "MONTH",
          "unitCount": 1
        },
        "nextPricePerPeriod": {
          "amount": 410,
          "period": {
            "count": 1,
            "unit": "month"
          }
        },
        "previousPricePerPeriod": {
          "amount": 205,
          "period": {
            "count": 1,
            "unit": "month"
          }
        },
        "utilizedAmount": 6.83,
        "creditAmount": 198.17,
        "proratedAmount": 396.34,
        "chargeAmount": 198.17,
        "prorateAdjustment": 100,
        "refundAmount": 90
      }
    }
  ]
}