setSerializer($serializer)->build(); $clientFactory = (new ClientFactory())->setCustomEncoder($encoder); // Replace API URL and API key with your data. $client = $clientFactory->createClient('https://test.simla.com', 'apiKey'); $request = new CustomersCreateRequest(); $request->customer = new Customer(); $request->customer->firstName = 'Tester'; $request->customer->lastName = 'User'; $request->customer->patronymic = 'Patronymic'; $request->site = 'site'; // Replace site with your data. /** @var \Retailcrm\Examples\CustomMethodsDto\Dto\Response\CustomersCreateResponse $response */ $response = $client->customMethods->createCustomer($request); echo 'Created customer using custom methods. ID: ' . $response->id;