Holiday Sale 30% OFF sitewide on all WordPress & WooCommerce plugins — use code Shop Now →
Back to all articles
E-commerce & Business Software Nov 30, 2026 8 min read
TECHRBUN // E-COMMERCE & BUSINESS SOFTWARE

How to Create Products with the PrestaShop API

Creating products in PrestaShop doesn’t have to mean entering every detail by hand. With the PrestaShop API, you can add product information programmatically and make catalog management faster and easier.

In this guide, you’ll learn how to use the PrestaShop API to create products, including how to prepare your request and provide the details each product needs. Whether you’re building an integration or automating a growing catalog, you’ll have a clear starting point for creating products with confidence.

Prepare for PrestaShop API Create Products

Before sending your first product request, it helps to sort out access, data format, and the values your shop expects. A little preparation makes it easier to spot issues before they affect your live catalog.

Start with secure access, then check how your store expects product data to be structured. I also recommend collecting the related IDs and language-specific values in advance, so your first request is easier to validate.

Create an API Key

The API key identifies your integration when it connects to the shop. I create a dedicated key for each integration, which makes it simpler to limit access and revoke credentials if they’re no longer needed.

In your PrestaShop back office, open the Webservice settings, enable the service if necessary, and create a key with permission to view and create products. Grant access to other resources only when your workflow needs them. Use HTTPS, keep the key out of public code, and test with a staging shop when possible.

For the classic Webservice API, the key is commonly sent as the username in HTTP Basic Authentication, with a blank password. Check your shop’s version and configuration before relying on that setup.

Choose the Product Data Format

PrestaShop’s classic Webservice API commonly uses XML, while JSON availability can depend on the version or configuration. Confirm which format your shop accepts before building your integration around it.

I usually inspect the product resource schema first. A request to the products endpoint with schema=blank can show the fields and structure expected by the shop; the exact endpoint and response can vary by installation. Use the response to shape your request rather than guessing at field names.

Whichever format you choose, set the matching Content-Type header and keep the payload valid. A well-formed document can still fail if required fields or nested language and association elements are missing.

Gather Required Product Details

With access and format settled, prepare the values the product record will reference. Required fields can differ by PrestaShop version and shop settings, so treat the blank schema and an API error response as useful checks.

Before sending a create request, I gather the core information and confirm that referenced records already exist:

  • Product name and link rewrite for each required language.
  • Price and the appropriate tax rule group, if applicable.
  • Category IDs, including the default category and any category associations.
  • Optional references such as manufacturer, supplier, or shop IDs for multistore setups.

Keep a simple mapping of names to IDs—for example, the category label “Accessories” may need to be sent as its numeric ID. This small check prevents avoidable validation errors when you begin to create products with the PrestaShop API.

Create Products with the PrestaShop API

Once your product details are mapped to the shop’s records, the next step is turning them into a request PrestaShop can accept. I find it easiest to build one product at a time first, then reuse the same structure for larger imports.

The request has two parts: its endpoint and the product data inside the body. Here’s how I put those pieces together and verify the result.

Build the Product Request

Start with the create operation for the products resource. This subsection covers the request method, endpoint, and headers that tell the shop how to read the payload.

For the classic Webservice API, send an HTTP POST request to your shop’s products endpoint, such as https://your-shop.example/api/products. Authenticate with the API key you prepared, and set the Content-Type header to match the format you’re sending, commonly application/xml.

Use the product schema you inspected earlier as your template. It helps distinguish fields that belong directly under the product from nested values, such as translations and associations.

Add Product Fields and Values

With the request shell ready, fill in the fields your shop expects. The example below shows the general XML shape; it is a guide, not a complete payload, so keep any additional required fields from your shop’s schema.

<prestashop>
  <product>
    <name><language id="1">Canvas Tote</language></name>
    <linkrewrite><language id="1">canvas-tote</language></linkrewrite>
    <price>18.00</price>
    <idcategorydefault>4</idcategorydefault>
  </product>
</prestashop>

Use the correct language ID for each translated value, and include category associations in the structure shown by your schema. I also check number formats and IDs before sending: a category name, for example, won’t substitute for its numeric ID.

Send the Request and Check the Response

After building the payload, send it to the shop and inspect what comes back. The response can confirm that the record was created or point to a specific field that needs attention.

A successful request typically returns a success status and product data, which may include the new product ID. Save that ID in your integration so later updates can target the same record. If the request fails, read the response body for validation details, then check the XML structure, required fields, language IDs, and referenced records.

For a reliable workflow, I test with one product first, confirm it appears correctly in the back office, and only then automate additional PrestaShop API create products requests.

Verify and Manage Your Products

A successful response is a good sign, but it doesn’t always tell the whole story. I check the product in the shop itself, then use that result to guide any fixes or follow-up changes.

First, confirm that the saved record looks right to both customers and store staff. These checks can catch issues that a success status alone may not reveal.

Confirm Products in the Back Office

Use the product ID returned by the create request to find the record in your PrestaShop back office. I check the name, price, category, and translated fields, then preview the product on the storefront if it should be visible.

If it doesn’t appear where expected, check its active status, default category, shop assignment in a multistore setup, and language-specific content. Also review stock settings and any required product options. A saved product may exist in the catalog but remain unavailable to customers until these details are correct.

Once the record looks right, keep its ID alongside your source data. That gives your integration a reliable reference for later changes and helps prevent accidental duplicate records.

After verification, you can handle any validation issues before making changes to existing records. A clear error response is often the quickest place to start.

Troubleshoot Common API Errors

When a request fails, I read both the HTTP status and the response body rather than guessing at the cause. Authentication or permission problems, invalid XML, missing required values, and references to nonexistent IDs are common things to investigate.

Check these details in order:

  • Credentials and permissions: confirm the API key is valid and allowed to create or edit products.
  • Payload structure: compare the XML with your shop’s product schema, including language and association elements.
  • Referenced records: verify category, language, tax, and other IDs exist in the shop.
  • Field values: check formats, required fields, and values accepted by your store configuration.

Fix one issue at a time and retry with a test record. This makes it easier to identify the cause without creating extra catalog changes.

When a product is confirmed, manage it through its saved ID rather than creating another record. For updates and removals, I use a cautious, repeatable process.

Update or Delete Products Safely

To update a product with the classic Webservice API, target its resource URL, such as /api/products/123, using the method supported by your shop. I first retrieve the existing record, change only the intended values, and preserve required fields and associations in the submitted data.

Before deleting, confirm the product ID and consider whether disabling the product is safer. Deletion can be difficult to reverse and may affect workflows that refer to that record. I test changes on a staging shop where possible, keep a record of the request and response, and verify the result in the back office.

Build a Product Workflow You Can Trust

The PrestaShop API makes product creation more efficient when you prepare your data, follow your shop’s schema, and verify each result. Start with a single product, confirm it appears as expected, and use any errors to refine your integration before scaling up.

Keep product IDs and handle future changes carefully to maintain a dependable catalog. With a tested process in place, you can use the PrestaShop API to create products with greater confidence and spend less time on repetitive manual work.

Discussion

0 Comments

Leave a comment ↓

No comments yet. Share your thoughts or questions below.

Leave a Comment

Your email address will not be published. Required fields are marked *