Skip to content

Get available product changes

/me/available_product_changes

Target audience: Developers

1
Release version: 4.3.11

Get available product changes

Introduction

This endpoint lets you check if a subscription can either be upgraded or downgraded to requested packages/campaigns. Read more on upgrading and downgrading a subscription here.

URI

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

Requirements

Identity Scope
Yes /external/me/r

Parameters

Field Required Type Description
id Required String The id of the user product to change from.
Size range: ..24
Allowed values: "/^[a-f\d]{24}$/i"
product_codes Required String The product codes of the packages/campaigns to check.
Size range: 1..1024

Curl Example

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/me/available_product_changes?id=50f3ac249f6aef294d000007&product_codes=expensive_package,expensive_campaign,cheaper_package,cheaper_campaign,even_cheaper_package,same_code_as_current_subscription \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \    

Response

Field Description
upgrades The product codes available for upgrade
downgrades The product codes available for downgrade
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
HTTP 200 OK
{
  "item": {
    "upgrades": [
      "expensive_package",
      "expensive_campaign"
    ],
    "downgrades": [
      "cheaper_package",
      "cheaper_campaign",
      "even_cheaper_package"
    ]
  }
}

Errors

This API uses the common error conventions of the Payway API

See common error responses