Create New Product

Topic summary

Issue: Creating a product via Shopify’s Admin GraphQL API using PHP returns error: {“errors”:{“product”:“Required parameter missing or invalid”}}.

Diagnosis: The response suggests one or more required fields in the productCreate input are missing or invalid. “productCreate” is a GraphQL mutation to create products; its input has mandatory parameters defined in the 2022-10 API docs.

Requested info: The responder asked the poster to share the exact API request/code to identify which parameter is missing.

Resources provided: Links to Shopify developer docs for productCreate required arguments and a PHP code example using Shopify\Clients\Graphql (API version 2022-10) were provided. A partial PHP snippet was shown, with guidance to follow the sample.

Current status: No resolution yet. Next step is for the poster to share their code or align their request with the required productCreate input fields per the documentation to pinpoint the missing/invalid parameter.

Summarized with AI on January 21. AI used: gpt-5.

Hello,

i try to create a new product with a fetch call. I am using php to add a new product.

But i get this error:

{“errors”:{“product”:“Required parameter missing or invalid”}}

1 Like

Hi there :waving_hand:

From that error message is seems like you are missing one of the required parameters. Would you be able to share your code you are using to make the API request?

In the developer documentation you should find code sample for creating products with the Shopify API in PHP.

use Shopify\Clients\Graphql;

$client = new Graphql("your-development-store.myshopify.com", $accessToken);
$query = <<