diff --git a/src/AmoCRM/Models/Sources/SourceServiceModel.php b/src/AmoCRM/Models/Sources/SourceServiceModel.php index 558564c..2661f0c 100644 --- a/src/AmoCRM/Models/Sources/SourceServiceModel.php +++ b/src/AmoCRM/Models/Sources/SourceServiceModel.php @@ -40,11 +40,16 @@ public static function fromArray(array $data): self public function toArray(): array { - return [ - 'type' => $this->getType(), + $result = [ + 'type' => $this->getType(), 'pages' => $this->getPages()->toArray(), - 'params' => $this->getParams()->toArray(), + 'params' => [], ]; + if ($this->getParams() !== null) { + $result['params'] = $this->getParams()->toArray(); + } + + return $result; } public function toApi(string $requestId = null): array