# API Varianten Bilder import

**URL:** <https://forum.shopware.com/t/api-varianten-bilder-import/37902>\
**Category:** Programmierung\
**Created:** [4. Juli 2016 um 15:36 UTC](https://forum.shopware.com/t/api-varianten-bilder-import/37902 "2016-07-04T15:36:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chuebert](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@chuebert](https://forum.shopware.com/u/chuebert)\
**Post date:** [4. Juli 2016 um 15:36 UTC](https://forum.shopware.com/t/api-varianten-bilder-import/37902/1 "2016-07-04T15:36:11Z")

</div>

Hallo,

beim import meiner varianten haben die Varianten einer Farbe, jedoch mit verschiedenen Größen die gleichen Bilder. Zurzeit ist es so das die Bilder wiederholt hochgeladen werden obwohl diese schon existieren. Wie bekomme ich da eine korrekte Zuordnung hin?

> $newArticle6474 = array(  
> &nbsp; &nbsp; ‚name‘ =\> ‚Hibi Mid Shoe‘,  
> &nbsp; &nbsp; ‚active‘ =\> true,  
> &nbsp; &nbsp; ‚tax‘ =\> 19,  
> &nbsp; &nbsp; ‚supplier‘ =\> ‚Urban Classics‘,  
> &nbsp; &nbsp; ‚categories‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚id‘ =\> 123),  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚mainDetail‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; ‚number‘ =\> ‚23893‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; ‚prices‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚customerGroupKey‘ =\> ‚EK‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚price‘ =\> 49.90,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),  
> &nbsp; &nbsp; &nbsp; &nbsp; )  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚descriptionLong‘ =\> ‚‘,  
> &nbsp; &nbsp; ‚metaTitle‘ =\> ‚Urban Classics Shoes fÃ¼r MÃ¤nner & Frauen gÃ¼nstig kaufen: Urban Classics Shoes‘,  
> &nbsp; &nbsp; ‚description‘ =\> ‚Ãœbersicht Ã¼ber das Angebot an Urban Classics Shoes fÃ¼r MÃ¤nner & Frauen. Jetzt gÃ¼nstig bestellen! Die angesagtesten Marken âœ“ Sichere Zahlungsmethoden âœ“ ab 80â‚¬ VSK-frei âœ“‘,  
> &nbsp; &nbsp; ‚weight‘ =\> ‚0.0000‘,
> 
> &nbsp; &nbsp; ‚configuratorSet‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; ‚groups‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚name‘ =\> ‚GrÃ¶ÃŸe‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚options‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(‚name‘ =\>‚36‘),  
> array(‚name‘ =\>‚37‘),  
> array(‚name‘ =\>‚38‘),  
> array(‚name‘ =\>‚39‘),  
> array(‚name‘ =\>‚40‘),  
> array(‚name‘ =\>‚41‘),  
> array(‚name‘ =\>‚42‘),  
> array(‚name‘ =\>‚43‘),  
> array(‚name‘ =\>‚44‘),  
> array(‚name‘ =\>‚45‘),  
> array(‚name‘ =\>‚46‘),  
> array(‚name‘ =\>‚47‘),
> 
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚name‘ =\> ‚Farbe‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚options‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array(‚name‘ =\>‚blk&blk‘),  
> array(‚name‘ =\>‚blk&wht‘),  
> array(‚name‘ =\>‚toffee&wht‘),
> 
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ),  
> &nbsp; &nbsp; &nbsp; &nbsp; )  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚taxId‘ &nbsp; &nbsp; &nbsp;=\> 1,  
> &nbsp; &nbsp; ‚variants‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; ‚active‘ =\> true,  
> &nbsp; &nbsp; ‚isMain‘ =\> true,  
> &nbsp; &nbsp; ‚number‘ =\> ‚23893‘,  
> &nbsp; &nbsp; ‚inStock‘ =\> 0,  
> &nbsp; &nbsp; ‚additionaltext‘ =\> ‚36 / blk&blk‘,  
> &nbsp; &nbsp; ‚configuratorOptions‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚group‘ =\> ‚GrÃ¶ÃŸe‘, ‚option‘ =\> ‚36‘),  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚group‘ =\> ‚Farbe‘, ‚option‘ =\> ‚blk&blk‘),  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚prices‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚customerGroupKey‘ =\> ‚EK‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚price‘ =\> 49.90,  
> &nbsp; &nbsp; &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚images‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P1-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P1-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P4-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P4-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P2-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P2-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P5-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P5-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P7-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P7-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P8-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P8-00017black-black.jpg)‘),  
> &nbsp; &nbsp; ),  
> ),  
> array(  
> &nbsp; &nbsp; ‚active‘ =\> true,  
> &nbsp; &nbsp; ‚isMain‘ =\> false,  
> &nbsp; &nbsp; ‚number‘ =\> ‚23894‘,  
> &nbsp; &nbsp; ‚inStock‘ =\> 0,  
> &nbsp; &nbsp; ‚additionaltext‘ =\> ‚37 / blk&blk‘,  
> &nbsp; &nbsp; ‚configuratorOptions‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚group‘ =\> ‚GrÃ¶ÃŸe‘, ‚option‘ =\> ‚37‘),  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚group‘ =\> ‚Farbe‘, ‚option‘ =\> ‚blk&blk‘),  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚prices‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚customerGroupKey‘ =\> ‚EK‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚price‘ =\> 49.90,  
> &nbsp; &nbsp; &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ),  
> &nbsp; &nbsp; ‚images‘ =\> array(  
> &nbsp; &nbsp; &nbsp; &nbsp; array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P1-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P1-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P4-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P4-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P2-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P2-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P5-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P5-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P7-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P7-00017black-black.jpg)‘),  
> array(‚link‘ =\> ‚[https://www.urban-classics.net/media/images/org/TB1290\_P8-00017black-black.jpg](https://www.urban-classics.net/media/images/org/TB1290%5C_P8-00017black-black.jpg)‘),  
> &nbsp; &nbsp; ),  
> ),
> 
> …
> 
> &nbsp; &nbsp; )  
> );  
> $client-\>post(‚articles‘, $newArticle6474);
