Skip to content

Change product

/me/change_product

Target audience: Developers

Upgrade/downgrade subscription

Introduction

This endpoint lets you request a package change on an ongoing subscription. There are a number of requirements to take into account when using this functionality:

  • Source subscription package must be either a package or a campaign
  • Source subscription must be limited or recurring
  • Source subscription must be active
  • Source subscription must be tulo-provisioned
  • Source subscription must be limited or recurring
  • Source subscription package must not be the same as target package
  • Source subscription package must not have an integration code unless supported

Information

Source subscription package can have an integration code if your integration supports export of upgrade and or downgrade. Contact support for details

  • Target package must be either a package or a campaign
  • Target package must be recurring if source subscription is recurring
  • Target package must be limited if source subscription is limited
  • Target package must have a payment period that matches a period on the source subscription package
  • Target package must not have an integration code unless supported

Information

Target package can have an integration code if your integration supports export of upgrade and or downgrade. Contact support for details

In the case of a Downgrade, Source package must be recurring When successfully changing a package one of two things will happen:

How is the change determined

  1. If the source package is less expensive than the target package an upgrade will occur.
  2. If the target package is less expensive than the source package a downgrade will occur.

An upgrade

Will take place immediately and the account will have the new package provisioned on the account right away, with its valid_to re-calculated based on the difference in cost between the packages.
Emits event package_upgrade. Depending on support the upgrade will be exported to your subscription system, if any.
Will cancel previous subscription with cancel reason upgrade. If integration support is enabled you can map this cancel reason to an integration code.

A downgrade

Will result in a "Package Downgrade Request", and the package will be downgraded at the end of the current subscription period, when the next renewal happens.
Emits event package_downgrade. Depending on support the downgrade will be exported to your subscription system, if any.
Will cancel previous subscription with cancel reason downgrade. If integration support is enabled you can map this cancel reason to an integration code.

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/me/change_product
Production https://backend.worldoftulo.com/external/api/v1/me/change_product

Requirements

Identity Scope
Yes /external/me/w

Parameters

Field Required Type Description
id Optional String The id of the user product to change product on.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
package_code Optional String The package_code of the package to upgrade/downgrade into.
Size range: 1..50

Curl Example

curl --request PUT \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me/change_product \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
              "id": "50f3ac249f6aef294d000007",
              "package_code": "adeprimo_premium_extra_large"
          }'

Response

Field Description
id The id of the new user product.
HTTP 200 Updated
{
    "id": "50f3ac249f6aef294d000007"
}

Errors

This API uses the common error conventions of the Payway API

See common error responses