Manage Your Products Through Unity With AppGallery Product Management System (PMS) API

Alihan98ersoy
Huawei Developers
Published in
3 min readJan 27, 2022

--

📖 Introduction 📖

In this article, I’ll be guiding you on how to implement PMS API into the Unity game engine with HMS Unity Plugin v2.1.x version.

Note: PMS API is a content of Connect API. So you first need to implement Connect API from this link.

🚧 Getting Started 🚧

We are going to use HMS Unity Plugin from Github.

After integrating the plugin into your game, We are ready to start using PMS API via Connect API.

✨ Setting up PMS API ✨

To be able to use the Connect API in Unity, we need to generate a token for the API calls. For generating a token please refer to Configuring Connect API in Unity part.

🥡 Querying and Updating a Product 🥡

Go to Huawei > Connect API > PMS API > Query IAP Products

You can query the IAP products according to their product id, product name, purchase type, status, and in which country’s currency to display with.

You can edit the product by pressing the edit button of the product. create a product.

You can not edit product Id, purchase type, subscription group, and subscription period.

🌻 Creating a Product 🌻

Go to Huawei > Connect API > PMS API > Create a Product

Then fill the fields.

Purchase Type: Consumable, Non_Consumable, Auto_Subscription. (When you pick Auto_Subscription you need to fill sub period and sub group.)

When you pick country currency will update automatically.

You can also add different language options with the add language button to the product.

We are generating JSON which is ready to create a new product with generate JSON button.

Before creating a product check your values!!!

You can not edit product Id and purchase type. If purchase type is Auto_Subscription also you can not change subscription group, and subscription period, too.

Then Create Product button to create a product.

🐇 Create Products 🐇

Go to Huawei > Connect API > PMS API > Create Products

You can download the product template and fill the template manually.

Or you can export your project from AGC. AppGallery Connect Console > My apps > “Your app” > Operate > Product Management > Export Product

You can select the .xlsx file and if everything is ok after your select it will generate JSON. Then you can create products with Create Products button.

💡 Conclusion 💡

We’ve learned how to Manage our Products With PMS API.

I hope this article has shown the using PMS API that will power up our projects!

You can ask questions on GitHub.

Don’t hesitate to ask questions.

--

--