diff --git a/lib/RetailCrm/ApiClient.php b/lib/RetailCrm/ApiClient.php index 593c63f..bbc3d2a 100644 --- a/lib/RetailCrm/ApiClient.php +++ b/lib/RetailCrm/ApiClient.php @@ -520,6 +520,16 @@ class ApiClient { return $this->client->makeRequest('/reference/sites', Client::METHOD_GET); } + + /** + * Returns stores list + * + * @return ApiResponse + */ + public function storesList() + { + return $this->client->makeRequest('/reference/stores', Client::METHOD_GET); + } /** * Edit deliveryService @@ -710,6 +720,31 @@ class ApiClient ); } + /** + * Edit store + * + * @param array $data site data + * @return ApiResponse + */ + public function storesEdit(array $data) + { + if (!isset($data['code'])) { + throw new \InvalidArgumentException('Data must contain "code" parameter.'); + } + + if (!isset($data['name'])) { + throw new \InvalidArgumentException('Data must contain "name" parameter.'); + } + + return $this->client->makeRequest( + '/reference/stores/' . $data['code'] . '/edit', + Client::METHOD_POST, + array( + 'site' => json_encode($data) + ) + ); + } + /** * Update CRM basic statistic *