# API Varianten Erstellung

**URL:** <https://forum.shopware.com/t/api-varianten-erstellung/60155>\
**Category:** Programmierung\
**Created:** [25. Juni 2019 um 14:21 UTC](https://forum.shopware.com/t/api-varianten-erstellung/60155 "2019-06-25T14:21:19Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![lhairman](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@lhairman](https://forum.shopware.com/u/lhairman)\
**Post date:** [26. Oktober 2020 um 07:44 UTC](https://forum.shopware.com/t/api-varianten-erstellung/60155/11 "2020-10-26T07:44:56Z")

</div>

> [@JROBFN schrieb:](https://forum.shopware.com/profile/36842/JROBFN "JROBFN")
> 
> Hi zusammen,&nbsp;
> 
> hat da einer einer Idee, habe auch das Problem „Im Admin sieht der Artikel gut aus, im Frontend leider nicht - irgendetwas fehlt.“&nbsp;
> 
> Im „product“ sieht eine Artikel aus der Api gleich dem manuell erstelltem aus, inkl. Varanten. Doch werden nur die in Shopware erstellten Varianten angezeigt.
> 
> Beide nutzen die gleichen Eigenschaften.&nbsp;
> 
> &nbsp;&nbsp;&nbsp;&nbsp;
> 
> Gruß Jörg Rosenbaum

Folgende (Test-)Aufrufe habe ich mir zusammengebastelt, damit kann ich zwei Varianten und das Klammerprodukt anlegen. Den Request setze ich dann jeweils über&nbsp;http://[SERVER]/api/v3/\_action/sync ab.

**Klammerprodukt** :

```
{
  "write-Product": {
    "entity": "product",
    "action": "upsert",
    "payload": [
        {
            "id":"4eb5845b52f44b59ad8744f82c0cff55",
            "name" : "testX-Varianten",
            "productNumber" : "test_post_1",
            "stock" : 10,
            "price" : [
                {
                    "currencyId" : "b7d2554b0ce847cd82f3ac9bd1c0dfca", 
                    "gross": 15, 
                    "net": 10, 
                    "linked" : false
                }
            ],
            "taxId" : "003b74cb4c6b4f0b8f4011586c5bff5f",
            "configuratorGroupConfig": [
                {
                    "id": "5eb85799b5914547adf6348ff2213d5e",
                    "representation": "box",
                    "expressionForListings": false
                }
            ],
            "configuratorSettings": [
                {
                    "optionId": "1ce5af1037ec42d6baf1d34f154f7e92"
                },
                {
                    "optionId": "f7486f4573cb41a7afbdab09b6b0d250"
                }
            ]
        }
    ]
  }
}

```

&nbsp;&nbsp;

**Variante 1** :

```
{
  "write-Product": {
    "entity": "product",
    "action": "upsert",
    "payload": [
        {
            "id":"65ecc128dd1b482bb5e48a5d3f493fba",
            "name" : "testX-Variante-1",
            "productNumber" : "test_post_1_1",
            "parentId":"4eb5845b52f44b59ad8744f82c0cff55",
            "options":[{"id":"f7486f4573cb41a7afbdab09b6b0d250"}],
            "stock" : 10
        }
    ]
  }
}

```

&nbsp;

**Und Variante 2** :

```
{
  "write-Product": {
    "entity": "product",
    "action": "upsert",
    "payload": [
        {
            "id":"b4610d2873d64d62b133e981ee14ef65",
            "name" : "testX-Variante-2",
            "productNumber" : "test_post_1_2",
            "parentId":"4eb5845b52f44b59ad8744f82c0cff55",
            "options":[{"id":"1ce5af1037ec42d6baf1d34f154f7e92"}],
            "stock" : 10
        }
    ]
  }
}

```

Viel Erfolg!

---

_[View the full topic](https://forum.shopware.com/t/api-varianten-erstellung/60155)._
