Docs
Dashboard

Make your first Admin API request

Last updated View as Markdown

Make your first Admin API request

This quickstart reads your project’s catalog and creates one draft product. The draft stays separate from the publication and pricing work needed to make it sellable.

Before you begin

Complete Connect to a project. Use an Admin credential with the required product permissions in a development project. Send the operations below to that project’s Admin endpoint with the appropriate header. The GraphQL document and Variables tab become the JSON request’s query and variables fields.

1. Read a page of products

Code in graphql

An empty nodes list is valid for a new catalog. For the next page, send the returned endCursor as after only when hasNextPage is true. See Pagination for traversal rules.

2. Create a draft

Code in graphql

Expect a product with status: DRAFT and an opaque id, with no business errors. Retain that ID. If a lamp already exists from an earlier attempt, use it rather than creating a duplicate. After a timeout, query the existing state before repeating creation.

3. Verify the created record

Code in graphql

Replace the placeholder with the returned ID. A draft product does not establish a variant, price, inventory, or publication. That is expected.

Continue with Create and publish a product, using this product’s ID and skipping its product-creation step. For response handling, read Errors and retries.