Technical Q&A QA1329

In-App Purchase Product Identifiers

Q:  I am implementing In-App Purchase and must register my product identifiers. What are product identifiers and how do I create and use them in my application?

A: A product identifier is a string used to uniquely identify every product you wish to sell from your application. The App Store uses it to retrieve information about a product. It is a string identifier that can only contain alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.) characters. You can use any sequence of these characters for your identifier. However, we recommend that you use the reverse domain name style (for example, com.companyname.application.productid) when creating your identifier.

How do I create a product identifier?

See In-App Purchase Configuration Guide for iTunes Connect's To create an In-App Purchase product for more information on how to create a product identifier.

Figure 1 displays the com.samplecode.iap.coins.100, com.samplecode.iap.foodies.7days, com.samplecode.iap.maps.7days, and com.samplecode.iap.tutorial.1 product identifiers for the My Great Application app.

Figure 1  In-App Purchase items in iTunes Connect

How do I use a product identifier in my application?

You create an SKProductsRequest object, then pass your list of product identifiers to its initWithProductIdentifiers method to retrieve information about your products. See Listing 1 for an example that requests information about the products associated with the product identifiers shown in Figure 1.

Listing 1  Retrieve information about products

- (void)requestProductData
  //Create a list of product identifiers
  NSSet *productSet = [NSSet setWithObjects:@"com.samplecode.iap.coins.100",
                                            @"com.samplecode.iap.tutorial.1", nil];
  //Create and initialize a products request object with the above list
  SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: productSet];
  //Attach the request to your delegate
  request.delegate = self;
  //Send the request to the App Store
  [request start];

Additional Resources

Document Revision History


Editorial Update.


Updated the "How do I create a product identifier?" section.


Updated screenshot.


New document that describes how to create and use product identifiers for In-App Purchase.