> Deprecated: > As of July 1, 2023 the [Unity Buy SDK](https://github.com/Shopify/unity-buy-sdk) is no longer supported. For more information, please see the [SDK Alternatives](#sdk-alternatives) section below. You can use the Unity Buy SDK to integrate physical products directly into games and apps made with the [Unity](https://unity3d.com) game engine. ## Requirements - You've created a [development store](/docs/api/development-stores) or have a production store. - You've created [products](/docs/api/storefront/reference/products/product) or [collections](/docs/api/storefront/reference/products/collection) in your store. ## Step 1: Generate an access token To generate an access token, you can [generate one in the Shopify admin](/docs/apps/build/authentication-authorization/access-tokens/generate-app-access-tokens-admin). Alternatively, you can create a custom app and use [authorization code grant](/docs/apps/build/authentication-authorization/access-tokens/authorization-code-grant). ## Step 2: Make your products and collections available After you've generated an access token, you need to make products and collections available to your custom app to access them from your app. After the products and collections are available, you can retrieve them using their respective IDs. > Tip: > If you have many products or collections, then you can use [bulk actions](https://help.shopify.com/manual/shopify-admin/productivity-tools/bulk-actions) to make them available in one step. ### Make a product available 1. From your Shopify admin, go to **Products**. 2. From the **Products** page, click the product you want to make available. 3. Next to **SALES CHANNELS AND APPS** click **Manage**. 4. In the **Sales channels and apps** dialog box, select the box next to the name of your custom app. ### Make a collection available 1. From your Shopify admin, go to **Products** and click **Collections**. 2. From the **Collections** page, click the collection you want to make available. 3. Next to **SALES CHANNELS AND APPS** click **Manage**. 4. In the **Sales channels and apps** dialog box, select the box next to the name of your custom app. ## Step 3: Access the Unity Buy SDK Using the Unity Buy SDK, you can do the following: * Fetch information about products on your Shopify store * Create an in-game shopping cart where customers can add products * Generate a checkout for customers to purchase products > Note: > This SDK is compatible with Unity versions up to 2019.x. When you're ready to start building, explore the [examples in GitHub](https://github.com/Shopify/unity-buy-sdk/blob/master/EXAMPLES.md) to see how to implement the SDK in your app. View the Unity Buy SDK on GitHub ## SDK Alternatives The Unity engine [provides robust APIs](https://docs.unity3d.com/Manual/UnityWebRequest.html) for performing HTTP requests which you can use with our Storefront GraphQL API. Below is an example of performing a simple GraphQL query. ```csharp using UnityEngine; using UnityEngine.Networking; using System.Collections; using System.Text; public class StorefrontGraphQLAPI : MonoBehaviour { void Start() { StartCoroutine(PerformQuery()); } IEnumerator PerformQuery() { string query = "{\"query\": \"query MyQuery { shop { name } }\"}"; UnityWebRequest request = new UnityWebRequest( "https://example.myshopify.com/api/2023-04/graphql", "POST"); request.SetRequestHeader("Accept", "application/json"); request.SetRequestHeader("Content-Type", "application/json"); request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(query)); request.downloadHandler = new DownloadHandlerBuffer(); yield return request.SendWebRequest(); if (request.result == UnityWebRequest.Result.Success) { byte[] results = request.downloadHandler.data; } else { // handle error } } } ``` ## Where to get help ### [.dev Community](https://community.shopify.dev) Visit our forums to connect with the community and learn more about the Shopify API and App development. ### [Hire a Shopify Partner](https://www.shopify.com/partners/directory) Find a Shopify Partner for hire in our ecosystem of talented development agencies.