> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bonx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Importer des articles en masse

> Créez de nombreux articles depuis un fichier ou un système externe.

Bouclez sur le endpoint de création pour importer un lot d'articles, par exemple
depuis un export de votre ancien outil.

<CodeGroup>
  ```js JavaScript theme={null}
  const articles = [
    { articleCode: 'CAM-PEEK-40', name: 'Came PEEK Ø40', unit: 'pce' },
    { articleCode: 'CAM-PEEK-50', name: 'Came PEEK Ø50', unit: 'pce' },
  ];

  for (const article of articles) {
    const res = await fetch(`${process.env.BONX_API_URL}/articles`, {
      method: 'POST',
      headers: { 'x-api-key': process.env.BONX_API_KEY, 'Content-Type': 'application/json' },
      body: JSON.stringify(article),
    });
    if (!res.ok) console.error('Échec pour', article.articleCode, await res.text());
  }
  ```

  ```bash cURL theme={null}
  curl -X POST "$BONX_API_URL/articles" \
    -H "x-api-key: $BONX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "articleCode": "CAM-PEEK-40", "name": "Came PEEK Ø40", "unit": "pce" }'
  ```
</CodeGroup>

<Tip>Traitez les articles par lots et espacez les requêtes si votre import est volumineux.</Tip>
