Documentation

​
​

Development

User Acquisition

Monetization

Industry

In-App Purchasing

IAP Client API

IAP SDK API

Webshop Admin API

Webshop Client API

In-App Purchasing

LiveOps
​
​
Get started
  • Overview
  • Introduction to IAP
  • What's new in IAP v5.4
  • Upgrade from IAP v4 to v5
Direct to Consumer (D2C) payments
  • Direct to Consumer (D2C) payment providers
Webshop
  • Overview
  • Get started with webshops
  • Webshop setup
  • Catalog and payments
  • Game integration for webshops
  • Troubleshooting webshops
Platform-native stores
  • Set up IAP for platform-native stores
  • Codeless IAP
Catalogs and store management
  • Create product catalogs
    • Catalogs and catalog listings
    • Catalog schema
    • Create a catalog in the Editor
    • IAP Catalog window reference
    • Create your catalog programmatically
    • Create Remote Catalog
    • Manage catalogs in the Dashboard
    • Codeless IAP
    • Stores
    • Purchases
    • Receipt validation
    • Restore purchases
  • Supported stores
Purchases
  • Purchase management and fulfillment
Monitor IAP performance
  • Overview
  • IAP revenue performance
  • D2C performance
Privacy
  • Privacy and consent
  1. Unity In-App Purchasing

Create your catalog programmatically

Use the CatalogProvider class to define your catalog in code for flexible or runtime-driven configurations.
Read time 1 minute
Last updated 2 months ago

You can define your catalog directly in code using the
CatalogProvider
class. This approach gives you full programmatic control over your catalog configuration and is useful in complex scenarios, such as if you have a game with a very large catalog that constantly adds new items in large quantities.
If your catalog is static and you prefer a visual setup, you can configure listings using the IAP Catalog window in the Unity Editor instead. Refer to Create a catalog in the Editor for more information. You can still access a catalog created this way from your scripts. Refer to Fetch products from a catalog created in the Editor for more information.
Note
For a Direct-to-Consumer (D2C) payment provider, you need to create a remote catalog.
To define catalog listings programmatically:
  1. During the initialization stage, create an instance of the
    CatalogProvider
    class.
  2. Use the
    AddProduct()
    method to add each listing, or
    AddProducts()
    to add multiple listings at once.
  3. For each listing, specify a unique cross-store
    Product ID
    and
    Product Type
    .
The following example shows how to add a consumable listing with the ID
100_gold_coins
to a
CatalogProvider
, and later call
FetchProducts()
to retrieve the defined listing.
using UnityEngine;using UnityEngine.Purchasing;public class MyIAPManager { public MyIAPManager () { var catalog = new CatalogProvider(); catalog.AddProduct("100_gold_coins", ProductType.Consumable); // Connect to the store catalog.FetchProducts(UnityIAPServices.DefaultProduct().FetchProductsWithNoRetries); }}
Note
Use the
CatalogProvider
class to configure store-specific IDs and other advanced configurations directly in code.

Additional resources

  • Manage your catalog in the Dashboard

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Additional resources


Report a problem with this page