Customer not creating via REST API (customer resource)

Hi community!

I am trying to create a customer via REST API like this from this link: https://developers.shopware.com/developers-guide/rest-api/examples/customer/#example-3-create-a-customer-account

$data = [
    'email' => 'meier@mail.de',
    'firstname' => 'Max',
    'lastname' => 'Meier',
    'salutation' => 'mr',
    'billing' => [
        'firstname' => 'Max',
        'lastname' => 'Meier',
        'salutation' => 'mr',
        'street' => 'Musterstrasse 55',
        'city' => 'Sch\\u00f6ppingen',
        'zipcode' => '48624',
        'country' => 2
    ],

];

$manager = new \ Shopware \ Components \ Api \ Manager ();
$customerManager = $manager->getResource('Customer');
$response = $customerManager->create($data);
echo "";
echo "";
print_r($response);
echo PHP_EOL;
die();

 

But it get this error

So i added ‘shopId’ in the array above like this:

$data = [
    'email' => 'meier@mail.de',
    'firstname' => 'Max',
    'lastname' => 'Meier',
    'salutation' => 'mr',
    'billing' => [
        'firstname' => 'Max',
        'lastname' => 'Meier',
        'salutation' => 'mr',
        'street' => 'Musterstrasse 55',
        'city' => 'Sch\\u00f6ppingen',
        'zipcode' => '48624',
        'country' => 2,
    ],
    'shopId' => 1
];

Now it does not give that error, but also does not create a customer. i also tried putting shopId in string as well like this: ‘shopId’ => ‘1’ but same result - not creating a customer.

 

What am i doing wrong? Any leads?

This is a dummyCustomer I created to be used for the customerManager and it worked out fine:

    private function provideDummyCustomer(): array {
        return [
            "sendOptinMail" => false,
            "number" => 'Custom_CustomerKey',
            "shopId"    => 1,
            "groupKey"  => "EK",

            "email"     => "max@mustermann.de",
            "company"   => "Max Company",
            "salutation"=> "mr",
            "firstname" => "Max",
            "lastname"  => "Mustermann",
            "billing" => [
                "salutation"=> "mr",
                "firstname" => "Max",
                "lastname"  => "Mustermann",
                "street" =>  "Musterstrasse 55",
                "city" =>  "Musterstadt",
                "zipcode" =>  "12345",
                "country" =>  2
            ],
            "shipping" => [
                "salutation"=> "mr",
                "firstname" => "Max",
                "lastname"  => "Mustermann",
                "street" =>  "Musterstrasse 55",
                "city" =>  "Musterstadt",
                "zipcode" =>  "12345",
                "country" =>  2
            ],
            "attribute"=> [ "customfield_test" => "customfield_content" ]
        ];
    }