client->makeRequest( '/reference/price-types', "GET" ); } /** * Edit price type * * @param array $data * * @throws \InvalidArgumentException * @throws \RetailCrm\Exception\CurlException * @throws \RetailCrm\Exception\InvalidJsonException * * @return \RetailCrm\Response\ApiResponse */ public function pricesTypesEdit(array $data) { if (!array_key_exists('code', $data)) { throw new \InvalidArgumentException( 'Data must contain "code" parameter.' ); } if (!array_key_exists('name', $data)) { throw new \InvalidArgumentException( 'Data must contain "name" parameter.' ); } /* @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( sprintf('/reference/price-types/%s/edit', $data['code']), "POST", ['priceType' => json_encode($data)] ); } }