--- title: Simple IDs in the REST Admin API description: >- Learn how simple IDs work in the REST Admin API and how to retrieve simple IDs for different resources. api_name: admin-rest source_url: html: 'https://shopify.dev/docs/api/admin-rest/usage/simple-ids' md: 'https://shopify.dev/docs/api/admin-rest/usage/simple-ids.md' --- ExpandOn this page * [How it works](https://shopify.dev/docs/api/admin-rest/usage/simple-ids.md#how-it-works) * [Finding equivalent IDs between REST and Graph​QL](https://shopify.dev/docs/api/admin-rest/usage/simple-ids.md#finding-equivalent-ids-between-rest-and-graphql) # Simple IDs in the REST Admin API Legacy The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). This guide describes how simple IDs work in the REST Admin API and how to retrieve simple IDs for different resources. *** ## How it works Shopify's [REST Admin API](https://shopify.dev/docs/api/admin-rest) contains simple IDs, which differ from [global IDs](https://shopify.dev/docs/api/usage/gids). A simple ID is a unique series of numbers that identifies a REST resource: ## Simple ID example ```json "id": 123456789 ``` For example, the REST Admin API's [`DiscountCode`](https://shopify.dev/docs/api/admin-rest/latest/resources/discountcode) resource includes an `id` property that has a simple ID as a value: ## DiscountCode resource ```json { "code": "SUMMERSALE10OFF", "created_at": "2022-03-13T16:09:54-04:00", "updated_at": "2022-03-13T16:09:54-04:00", "id": 9808080986, ... } ``` Simple IDs also exist for properties that have descriptive names appended by `id`. For example, the REST Admin API's [`GiftCard`](https://shopify.dev/docs/api/admin-rest/latest/resources/gift-card) resource includes the following properties that each have a simple ID as a value: ## GiftCard resource ```json { "api_client_id": 123456789, "customer_id": 234567890, "line_item_id": 345678901, "order_id": 456789012, "user_id": 567890123, ... } ``` *** ## Finding equivalent IDs between REST and Graph​QL Most REST Admin API resources include an `admin_graphql_api_id` property, which provides a global ID for the equivalent object in the GraphQL Admin API. For example, the following two properties on the [`Customer`](https://shopify.dev/docs/api/admin-rest/latest/resources/customer) resource are equivalent: ## Customer resource ```json { "id": 123456789, // A simple ID for a Customer resource in the REST Admin API "admin_graphql_api_id": "gid://shopify/Customer/123456789" // A global ID for the equivalent Customer object in the GraphQL Admin API } ``` Similarly, most GraphQL Admin API objects include a `legacyResourceId` field, which provides a simple ID for the equivalent resource in the REST Admin API. For example, the following two fields on the [`Product`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product#field-product-legacyresourceid) object are equivalent: ## POST https://{shop}.myshopify.com/api/{api\_version}/graphql.json ## GraphQL query ```graphql { products(first:5) { edges { node { id # A global ID for the Product object in the GraphQL Admin API legacyResourceId # A simple ID for the equivalent Product resource in the REST Admin API } } } } ``` ## JSON response ```json { "data": { "products": { "edges": [ { "node": { "id": "gid://shopify/Product/4353554645014", "legacyResourceId": "4353554645014" } }, { "node": { "id": "gid://shopify/Product/4353554710550", "legacyResourceId": "4353554710550" } }, { "node": { "id": "gid://shopify/Product/4358159007766", "legacyResourceId": "4358159007766" } }, { "node": { "id": "gid://shopify/Product/5591484858390", "legacyResourceId": "5591484858390" } }, { "node": { "id": "gid://shopify/Product/5591485448214", "legacyResourceId": "5591485448214" } } ] } } } ``` *** * [How it works](https://shopify.dev/docs/api/admin-rest/usage/simple-ids.md#how-it-works) * [Finding equivalent IDs between REST and Graph​QL](https://shopify.dev/docs/api/admin-rest/usage/simple-ids.md#finding-equivalent-ids-between-rest-and-graphql)