Bulk IAP Import
A typical UDP implementation consists of:
- Preparing your IAP Catalog inside your Unity project
- Building and uploading your APK file to the UDP console
However, putting together an IAP Catalog of hundreds of products in the Editor can be tedious, and that’s when you may want to leverage the Bulk IAP Import feature.
Bulk IAP Import lets you upload CSV files in the regular UDP format and in Google Play format to the UDP Console with all your IAP product details, including prices in multiple currencies and descriptions in multiple languages.
This section describes how to import your IAP items in bulk.
Implementation requirements
To add new IAP products
You should only use the Bulk IAP Import function to add new IAP products if you implemented UDP:
- With the UDP Package
- With Unity IAP, not using codeless
If your implementation is with Unity IAP codeless, don’t use the Bulk IAP Import function to add new IAP products to your catalog. Your game’s IAP products must be defined in the Editor’s IAP Catalog when you build your game APK, so your bulk upload would be in vain.
To add localized descriptions and prices
For all implementations, you can use Bulk IAP Import to assign descriptions in more languages and prices in more currencies to your existing IAP products.
With the UDP Package
You can use Bulk IAP Import to entirely redefine your game’s IAP Catalog without having to rebuild your game.
You only need to have a UDP implementation in good working order.
With Unity IAP (non codeless)
With Unity IAP, the IAP Catalog sync is unidirectional: from the Editor to the UDP Console only. You therefore cannot Pull an IAP Catalog that was uploaded on the UDP Console.
If you will upload your game’s IAP Catalog to the UDP Console via Bulk IAP Upload, you should prepare your game to fetch IAP product information from the UDP Console, rather than from the game client’s default IAP Catalog.
Simply do not invoke any IAP product retrieval method in your code to allow your game to fetch its entire IAP Catalog from the UDP Console.
For more information, see Querying IAP inventory.
With Unity IAP (codeless)
Don’t use the Bulk IAP Import function to add new IAP products, your bulk upload would be in vain. You must define your game’s IAP products in the Editor’s IAP Catalog by the time you build your game APK. See Filling in the IAP Catalog.
You can still, however, use Bulk IAP Import to assign descriptions in more languages and prices in more currencies to your existing IAP products. To ensure a successful operation, make sure that for each IAP product the ProductID and Product Type you define in the CSV file match exactly the values defined in your Editor’s IAP Catalog.
Download the CSV Template
UDP provides a CSV template you can use for bulk import of IAP products. The template is in the regular UDP format for CSV files.
- Select EDIT INFO on the Game Information page.
- Go to the In-App Purchases panel.
- Click IMPORT CATALOG.
- Click Download Template.
Fill in the CSV file
CSV files use commas (,) and semicolons (;) to separate data values. Commas separate primary data values, and semicolons separate subvalues.
Each IAP item must appear entirely on a single line within the CSV file.
You must enter data in the exact format of the template provided.
Data values for CSV files
See Filling in the IAP Catalog for general information on IAP item fields.
Each row in a CSV file of In-App Purchases can contain the following values. Do not pass empty values.
Field | Description |
product_id | Represents the ID of a unique IAP product product_id needs to start with a lowercase letter or a digit and must be composed of only lowercase letters (a-z), digits (0-9), underscores (_), and periods (.) |
language; product_name; description | When setting the language value, use the language code listed in TABLE A. UDP uses en-US as the default language. Use semicolon(;) to separate language, product_name and description. To include localized versions of the item's product name and description, you must list the default language, product_name, and description, followed by the languages, product_names, and descriptions for each locale. In the following example, the product has en-US (ENGLISH) as the default language and zh-CN (CHINESE) as a localization: en-US;Product 1;This is my first product; zh-CN; 产品1; 产品描述1. Note: After uploading the file, only the fields corresponding to languages already defined in the Game Info section will be imported. If you intend to support multiple languages, define them on the UDP Console before importing your IAP catalog. |
consumable | This value must be set to TRUE or FALSE (case insensitive). |
currency; price | When setting the currency value, use the currency code listed in TABLE B. The price must be positive.The default currency is USD. The price of each IAP product must immediately follow its corresponding currency. For example: USD;0.99;CNY;6 |
TABLE A - Language codes
Language | Code |
AFRIKAANS | af |
AMHARIC | am |
BULGARIAN | bg |
CATALAN | ca |
CHINESE | zh-CN |
CHINESE (HONG KONG) | zh-HK |
CHINESE (TAIWAN) | zh-TW |
CROATIAN | hr |
CZECH | cs |
DANISH | da |
DUTCH | nl |
ENGLISH (UK) | en-GB |
ENGLISH | en-US |
ESTONIAN | et |
FILIPINO | fil |
FINNISH | fi |
FRENCH (CANADA) | fr-CA |
FRENCH | fr-FR |
GERMAN | de |
GREEK | el |
HINDI | hi |
HUNGARIAN | hu |
INDONESIAN | id |
ITALIAN | it |
JAPANESE | ja |
KOREAN | ko |
LATVIAN | lv |
LITHUANIAN | lt |
MALAY | ms |
NORWEGIAN | no |
POLISH | pl |
PORTUGUESE (BRAZIL) | pt-BR |
PORTUGUESE (PORTUGAL) | pt-PT |
ROMANIAN | ro |
RUSSIAN | ru |
SERBIAN | sr |
SLOVAK | sk |
SLOVENIAN | sl |
SPANISH (LATIN AMERICA) | es |
SPANISH | es-ES |
SWAHILI | sw |
SWEDISH | sv |
THAI | th |
TURKISH | tr |
UKRAINIAN | uk |
VIETNAMESE | vi |
ZULU | zu |
TABLE B - Currency codes
Code | Code | Code |
AED | IDR | PEN |
ARS | ILS | PHP |
AUD | INR | PKR |
BGN | IQD | PLN |
BHD | ISK | QAR |
BND | JOD | RON |
BIF | JPY | RUB |
BRL | KES | SAR |
CAD | KHR | SDG |
CHF | KRW | SEK |
CNY | KWD | SGD |
CZK | LAK | THB |
DKK | LKR | TND |
DZD | LYD | TRY |
EGP | MAD | TWD |
EUR | MMK | TZS |
GBP | MXN | USD |
GHS | MYR | UYU |
HKD | NOK | VND |
HRK | NZD | ZAR |
HUF | OMR |
Example 1
product_id,language; product_name; description,consumable,currency; price com.mystudio.mygame.product1,en-US;Product 1;This is my first product; zh-CN; 产品1; 产品描述1,TRUE,USD;0.99;CNY;6;EUR;0.79 com.mystudio.mygame.product2,en-US;Product 2;This is my second product; zh-CN; 产品2; 产品描述2,FALSE,USD;1.99;CNY;12;EUR;1.59 com.mystudio.mygame.product3,en-US;Product 3;This is my third product; zh-CN; 产品3; 产品描述3,TRUE,USD;4.99;CNY;30;EUR;3.99
Example 2
product_id,language; product_name; description,consumable,currency; price com.mystudio.mygame.product1,en-US;Product 1;This is my first product,TRUE,USD;0.99 com.mystudio.mygame.product2,en-US;Product 2;This is my second product,FALSE,USD;1.99 com.mystudio.mygame.product3,en-US;Product 3;This is my third product,TRUE,USD;4.99
Upload your CSV file
- Select EDIT INFO on the Game Information page.
- Go to the In-App Purchases section.
- Click IMPORT CATALOG.
- Click Upload CSV or drag and drop your CSV file in the designated box.
- Click IMPORT to upload your IAP Catalog to the UDP console.
Note: Uploading a CSV file entirely overwrites this revision’s IAP catalog. The UDP console only uses the information contained in your CSV file; any other IAP information you previously entered via the UDP console is lost.
Export a CSV file
If you want to re-use an existing IAP Catalog or add new products to it, click EXPORT CATALOG to download it, and use this file to make modifications to your IAP Catalog. This exports the IAP Catalog as a CSV file in the regular UDP format. Upload the final IAP Catalog back using IMPORT CATALOG.
The EXPORT CATALOG button is only shown if you have IAP products in your IAP Catalog, and is only visible in edit mode.
Import IAP products from Google Play format
UDP also supports CSV files in Google Play format. To import IAP products using a Google Play CSV file:
- Select EDIT INFO on the Game Information page.
- Go to the In-App Purchases section.
- Click IMPORT CATALOG.
- Select the CSV file in Google Play format checkbox.
- Click Upload CSV or drag and drop your CSV file in the designated box.
- Click CREATE to upload your IAP Catalog to the UDP console.
Pricing
Google Play sets pricing by country, UDP sets pricing by currency. Therefore the import maps countries to currencies. If for the same IAP product you've set different prices across countries using the same currency (for instance, EUR in European countries) UDP uses the first country in the list for the currency. If there are several countries with USD listed, the US locale is used.
Default currency
Your Google Play default currency cannot be determined from your CSV file; you need to tell UDP what your Google Play default currency is. UDP uses USD as its default currency. If you don’t have USD pricing on Google Play, UDP converts your Google Play default pricing and default currency into USD and uses this as the UDP default pricing. Local prices that are set in your CSV file are maintained in their respective currencies. For countries that aren't explicitly set in the CSV file, UDP converts your Google Play default pricing and default currency into their respective currencies.
IAP products
The type of IAP products (consumable / non-consumable) cannot be determined from your CSV file; you need to tell UDP the type of each IAP product.
UDP does not support Auto-Translate. This setting is ignored. UDP only uses the localized descriptions provided in the CSV file.
UDP does not support Google Play’s Pricing Templates. This setting is ignored. UDP only uses the local prices provided in the CSV file.