v1

latestOpenAPI 3.0.02026-07-24103118224.7 KB
Subscription

Upgrade a subscription

Upgrades an existing subscription to a new offer with prorated billing

post/subscription/{id}/upgrade

Path parameters

idstring required
Example:sub_1234567890abcdef

Unique identifier of the subscription to upgrade

Request body

upgradeAmountInCentsnumber required

The new amount in cents for the subscription upgrade, must be greater than the current subscription amount

threeDsSuccessUrlstring

The URL to redirect to after successful 3DS authentication, only required if card information is provided

threeDsFailureUrlstring

The URL to redirect to after failed 3DS authentication, only required if card information is provided

upgradeSubscriptionNamestring

The name of the upgraded subscription plan, if not provided, the current subscription name will be used

upgradeSubscriptionDescriptionstring

The description of the upgraded subscription plan, if not provided, the current subscription description will be used

savePaymentMethodboolean

Whether to save the payment method

useCustomerPaymentMethodboolean

Whether to use the customer's last saved payment method, it will get the current subscription's customer payment method

autoConfirmboolean

Whether to auto-confirm the payment, if not provided, the payment will be confirmed manually

pricingMode'TAX_EXCLUSIVE' | 'TAX_INCLUSIVE'

The pricing mode for the products

Example request

{
  "upgradeAmountInCents": 2999,
  "threeDsSuccessUrl": "https://yourapp.com/payment/success?paymentId=pay_123",
  "threeDsFailureUrl": "https://yourapp.com/payment/failure?paymentId=pay_123",
  "upgradeSubscriptionName": "Premium Plan",
  "upgradeSubscriptionDescription": "Access to all features of the premium plan",
  "pricingMode": "TAX_EXCLUSIVE"
}

Response

Upgrade a subscription successful

Example response

{
  "payment": {
    "lastDepositAttempt": {
      "status": "succeeded",
      "amount": 10000,
      "paymentMethod": "CARD",
      "error": "card_declined",
      "attemptedAt": "2025-10-24T14:35:00Z"
    },
    "taxRateInPercentage": 20,
    "pricingMode": "TAX_EXCLUSIVE",
    "lastThreeDsAttempt": {
      "status": "succeeded",
      "cardBrand": "Visa",
      "createdDate": "2025-11-12T21:51:33.530Z"
    },
    "invoiceUrl": "https://api.inflowpay.com/invoice/download?token=abc123xyz",
    "customerPaymentMethod": {
      "id": "cpm_abc123",
      "type": "card",
      "cardBrand": "visa",
      "cardLast4": "4242"
    }
  },
  "subscriptionUpgrade": {
    "subscriptionId": "sub_1234567890abcdef",
    "currentAmountInCents": 2999,
    "upgradeAmountInCents": 4999,
    "dueAmountInCents": 2000
  }
}