# CreateProduct

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.Shopify/tree/main/Frends.Shopify.CreateProduct>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ProductData : `JObject` | <p>A JSON object containing the product details to create.</p><p><br>Default: <code>-</code><br>Example: <code>Example test product with variants: new JObject { \["title"] = "Test Product", \["body\_html"] = "Test description", \["vendor"] = "Test Vendor", \["product\_type"] = "Test Type", \["variants"] = new JArray { new JObject { \["option1"] = "Size", \["price"] = "10.99", \["sku"] = "TEST-SIZE" } } }</code></p> |
| {% endtab %}            |                                                                                                                                                                                                                                                                                                                                                                                                                                    |

{% tab title="Parameter: Connection" %}

| Name                     | Description                                                                                                                                                                                                                     |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ShopName : `String`      | <p>The Shopify store subdomain (e.g., myshop for myshop.myshopify.com).</p><p><br>Default: <code>-</code><br>Example: <code>myshop</code></p>                                                                                   |
| 🗝AccessToken : `String` | <p>Shopify Admin API access token (private or custom app token).</p><p><br>Default: <code>-</code><br>Example: <code>Private: shpat\_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx OAuth: shpca\_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</code></p> |
| ApiVersion : `String`    | <p>Shopify Admin API version to use.</p><p><br>Default: <code>-</code><br>Example: <code>2025-07</code></p>                                                                                                                     |
| {% endtab %}             |                                                                                                                                                                                                                                 |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                         |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`  | <p>Whether to throw an error on failure. True by default.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>   |
| ErrorMessageOnFailure : `String` | <p>Overrides the error message on failure.</p><p><br>Default: <code>-</code><br>Example: <code>Failed to create product.</code></p> |
| {% endtab %}                     |                                                                                                                                     |

{% tab title="Result: Result" %}

| Name                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`        | <p>Indicates whether the retrieval was successful.<br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                            |
| CreatedProduct : `JObject` | <p>The created product object returned by Shopify.<br>Example: <code>{ "id": 1234567890123, "title": "Example Product", "body\_html": "Example Description", "vendor": "Example Vendor", "product\_type": "Example Type", "status": "active", "variants": \[ { "id": 987654321, "title": "Default Title", "price": "19.99", "sku": "EX-001" } ], "options": \[ { "name": "Title", "values": \["Default Title"] } ] }</code></p> |
| Error : `Error`            | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, object { Exception Exception } AdditionalInfo }</code></p>                                                                                                                                                                                                                                                                             |
| {% endtab %}               |                                                                                                                                                                                                                                                                                                                                                                                                                                 |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2025-07-16

#### Changed

* Refactored to use real API in tests rather than mocks

### \[1.0.0] - 2025-06-19

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
