# Shopware store-api: Register customer funktioniert nicht

**URL:** <https://forum.shopware.com/t/shopware-store-api-register-customer-funktioniert-nicht/103779>\
**Category:** Shopware 6 (German)\
**Created:** [21. April 2024 um 20:54 UTC](https://forum.shopware.com/t/shopware-store-api-register-customer-funktioniert-nicht/103779 "2024-04-21T20:54:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frimipiso](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@frimipiso](https://forum.shopware.com/u/frimipiso)\
**Post date:** [21. April 2024 um 20:54 UTC](https://forum.shopware.com/t/shopware-store-api-register-customer-funktioniert-nicht/103779/1 "2024-04-21T20:54:45Z")

</div>

Hallo Ihr Lieben,

ich versuche vergebens einen neuen Customer über the store-api anzulegen. Ich erhalte immer den folgenden Response:

```auto
{
	"errors": [
		{
			"status": "412",
			"code": "FRAMEWORK__ROUTING_SALES_CHANNEL_NOT_FOUND",
			"title": "Precondition Failed",
			"detail": "No matching sales channel found.",
			"meta": {
				"parameters": []
			}
		}
	]
}

```

Wo liegt das Problem?

Hier ist der Request (den sw-access-key habe ich natürlich geändert 🙂 ):

```auto
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://www.myshop.de/store-api/account/register",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\n \"salutationId\": \"018ecee4b4d670a58218b7d733483b16\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"password\": \"ShopwareRocks!\",\n \"acceptedDataProtection\": true,\n \"billingAddress\": {\n \"id\": \"131313b\",\n \"customerId\": \"131313\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"street\": \"123 Shopware St\",\n \"zipcode\": \"12345\",\n \"city\": \"ShopCity\",\n \"countryId\": \"018ecee4b4e67027a5ba8fdc057e2def\",\n \"salutationId\": \"018ecee4b4d670a58218b7d733483b16\"\n },\n \"shippingAddress\": {\n \"id\": \"131313s\",\n \"customerId\": \"131313\",\n \"firstName\": \"Joana\",\n \"lastName\": \"Doey\",\n \"street\": \"321 Shopware St\",\n \"zipcode\": \"54321\",\n \"city\": \"ClientCity\",\n \"countryId\": \"018ecee4b4e67027a5ba8fdc057e2def\",\n \"salutationId\": \"018ecee4b4d670a58218b7d733483b16\"\n },\n \"storefrontUrl\": \"https://www.myshop.de\"\n}",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/json",
    "sw-access-key: 12345"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

```

Danke und viele Grüsse

Jens

---

<div class="post-metadata">

**Author:** ![frimipiso](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@frimipiso](https://forum.shopware.com/u/frimipiso)\
**Post date:** [21. April 2024 um 21:40 UTC](https://forum.shopware.com/t/shopware-store-api-register-customer-funktioniert-nicht/103779/2 "2024-04-21T21:40:06Z")

</div>

Problem gelöst:

Ich habe den falschen API code verwendet (von den Integrationen). Hier benötigt man den API Code des Sales Channel!

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/9/29c7587ba660f00e4995d1743162782e5d6d8653.svg) [@system](https://forum.shopware.com/u/system)\
**Post date:** [21. Mai 2024 um 21:41 UTC](https://forum.shopware.com/t/shopware-store-api-register-customer-funktioniert-nicht/103779/3 "2024-05-21T21:41:02Z")

</div>

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.
