This article focuses on virtual subscriptions, or the subscriptions that live inside of your game.
Creating a Subscription
To create a subscription, you must first make sure you have published Catalog Items, Currency, or User Generated Content (UGC) that you want to be accessible/purchaseable in your game. To set up your catalog before creating a subscription, see Economy V2 QuickstartGameManager
- Navigate to Economy > Catalog (V2).
- Under the Subscriptions tab, select New Subscription.
API
You can use the CreateDraftItem API to create a subscription. An exampleCreateDraftItem API request to create a subscription:
The above Holiday Skins Pass subscription grants two items,
Glowing Gloves and Shiny Shoes at two price points for two different validity periods. The first price set of 5 diamonds and 10 gold ensures that the subscription is valid for one week while the second price set of 7 diamonds and 12 gold ensures that the subscription is valid for one month. Do note time duration needs to be set in seconds.
This should return a response that the subscription has been created and published:
Subscriptions within Inventory
Subscriptions will be present in the player’s inventory collection with an ID, StackId, expiration date, and display properties. Everything in a subscription can be modified just like any other item using Add, Subtract, and Update, etc. You can use the GetInventoryItems with a Type filter to retrieve all subscriptions a player currently has.UpdateInventoryItems API call here’s updating the Subscription’s expiration date.
AddInventoryItems API call here’s extending the expiration date by increasing the DurationInSeconds parameter.
SubtractInventoryItems API call here’s decreasing the expiration date by reducing the DurationInSeconds parameter.
