customer = $customer; return $this; } public function withAuthToken(string $authToken): self { $this->authToken = $authToken; return $this; } public function execute(): string { $body = [ 'customer' => [ 'created_in' => $this->config->getVendorId(), 'email' => $this->customer->getEmailAddress(), 'firstname' => $this->customer->getFirstName(), 'lastname' => $this->customer->getLastName(), ], ]; $response = $this->client->request( 'POST', self::BASE_URL . self::ENDPOINT, [ 'auth_bearer' => $this->authToken, 'headers' => [ 'Content-Type' => 'application/json', ], 'body' => json_encode($body), ] ); return json_decode($response->getContent()); } }