Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Tebex Upgrade/Downgrade update
Browse files Browse the repository at this point in the history
  • Loading branch information
benjokoren-ow committed Jul 4, 2024
1 parent 3c1a6ea commit f4d1077
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 2 deletions.
28 changes: 28 additions & 0 deletions pages/api/general/subscriptions-api/subscriptions-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The following is a list of endpoints exposed by the Overwolf Subscriptions API,

**For live examples of the different endpoints, please check out the [Tebex Subs Sample App](https://github.com/overwolf/tebex-subs-sample).**

**For live examples of the new categories and upgrade/downgrade endpoint, please check out the [Tebex Subs Sample App on the “upgrade/downgrade-develop” branch](https://github.com/overwolf/tebex-subs-sample/tree/upgrade/downgrade-develop).**

### Checkout

> Generates a checkout page for a specific subscription plan (package).
Expand All @@ -42,6 +44,32 @@ import Packages from '@site/../pages/endpoints/subscriptions-api.overwolf.com/_p

<Packages/>

### Categories

> Returns a list of all categories and their associated packages available for a specific store in this App.
import Categories from '@site/../pages/endpoints/subscriptions-api.overwolf.com/_categories.mdx'

<Categories/>

### Upgrade/Downgrade

> Updates the package tier of a subscription package within a specific category for this App.
import UpgradeDowngrade from '@site/../pages/endpoints/subscriptions-api.overwolf.com/_pgrade-downgrade.mdx'

<UpgradeDowngrade/>

#### Notes for Using the Categories and Upgrade/Downgrade Endpoints:

* To utilize the new `Categories` endpoint, you **must** create a new category and packages for that category in your Tebex store.
* If you have users subscribed to the "old" package type (which cannot be upgraded or downgraded), please implement the following UI changes in the subscription settings section of your app:
* inform the user that he can’t switch between plans and must cancel his current plan first.

* Allow the user to cancel his subscription and only then allow him to switch to the new package type that allows for Upgrading/Downgrading their package tier.

* When subscribing to the new package type, an initial purchase must be made using the `Checkout` endpoint. After the initial subscription, you can query the new `Categories` endpoint to check if the user has an active tier (subscription), and then display the Update/Downgrade buttons accordingly using the `prorate_price`.

## Deeplinks

The following is a list of deeplinks used by the Overwolf Subscriptions API, to handle calls back to the application.
Expand Down
2 changes: 1 addition & 1 deletion pages/api/media/replays/replays.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ Replay video options.
| keep_game_capture_on_lost_focus | bool | Keep capturing the game when the game loses focus (i.e do not show "Be Right Back"). Note: if game is minimized, BRB will be shown. | 0.180 |
| color_space | string &#124; [overwolf.streaming.enums.VideoColorSpec](../streaming#videocolorspec-enum) | The default value is: **Rec709**. | 0.254 |
| color_format | string &#124; [overwolf.streaming.enums.VideoColorFormat](../streaming#videocolorformat-enum) | The default value is: **NV12**. | 0.254 |
| fragmented_video_file | bool | Splits the video to smaller fragments which allows for the immediate start of video playback after downloading only a small initial segment. <br/>Defaults to **true**. | 0.254 |
| fragmented_video_file | bool | Splits the video to smaller fragments which allows for the immediate start of video playback after downloading only a small initial segment. <br/>Defaults to **false**. | 0.254 |

#### base_frame_size_source notes

Expand Down
2 changes: 1 addition & 1 deletion pages/api/streaming/streaming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ Stream video options.
| disable_auto_shutdown_on_game_exit | bool | Should the recording engine stay running even after the relevant game was closed. | 0.236 |
| color_space | string &#124; [overwolf.streaming.enums.VideoColorSpec](#videocolorspec-enum) | The default value is: **Rec709**. | 0.254 |
| color_format | string &#124; [overwolf.streaming.enums.VideoColorFormat](#videocolorformat-enum) | The default value is: **NV12**. | 0.254 |
| fragmented_video_file | bool | Splits the video to smaller fragments which allows for the immediate start of video playback after downloading only a small initial segment. <br/>Defaults to **true**. | 0.254 |
| fragmented_video_file | bool | Splits the video to smaller fragments which allows for the immediate start of video playback after downloading only a small initial segment. <br/>Defaults to **false**. | 0.254 |

## VideoColorSpec enum

Expand Down
61 changes: 61 additions & 0 deletions pages/endpoints/subscriptions-api.overwolf.com/_categories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
```yaml
Request Type: 'GET'
Hostname: 'https://subscriptions-api.overwolf.com'
Path: '/subscriptions/${STORE_ID}/categories'
Search Params:
extensionId: string
Headers:
Authorization: 'Bearer ${token}'

Result: Array of:
name: 'string'
description: 'string'
active_tier?:
tier_id: 'number'
package:
base_price: 'number'
category:
id: 'number'
name: 'string'
created_at: 'string'
description: 'string'
disable_gifting: 'boolean'
disable_quantity: 'boolean'
discount: 'number'
expiration_date?: 'string'
id: 'number'
image?: 'string'
name: 'string'
sales_tax: 'number'
total_price: 'number'
type: 'subscription' | 'single'
updated_at: 'string'
prorate_price?: 'number'
currency: 'string'
active: 'boolean'
created_at: 'string'
next_payment_date: 'string'
status:
id: 'string'
description: 'string'
packages: Array of:
base_price: 'number'
category:
id: 'number'
name: 'string'
created_at: 'string'
description: 'string'
disable_gifting: 'boolean'
disable_quantity: 'boolean'
discount: 'number'
expiration_date?: 'string'
id: 'number'
image?: 'string'
name: 'string'
sales_tax: 'number'
total_price: 'number'
type: 'subscription' | 'single'
updated_at: 'string'
prorate_price?: 'number'
currency: 'string'
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```yaml
Request Type: 'PUT'
Hostname: 'https://subscriptions-api.overwolf.com'
Path: '/subscriptions/${STORE_ID}'
Search Params:
extensionId: string
Headers:
Authorization: 'Bearer ${token}'

Body:
{
// The tierId from the activeTier object received by the get categories method.
"tierId": number,
// The packageId you want to change to.
"packageId": number,
// Whether to upgrade or downgrade to a package.
"type": "upgrade" | "downgrade"
}
```

0 comments on commit f4d1077

Please sign in to comment.