public function ordersEdit(array $order, $by = 'externalId', $site = null)
    {
        if (!count($order)) {
            throw new \InvalidArgumentException(
                'Parameter `order` must contains a data'
            );
        }

        $this->checkIdParameter($by);

        if (!array_key_exists($by, $order)) {
            throw new \InvalidArgumentException(
                sprintf('Order array must contain the "%s" parameter.', $by)
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/orders/%s/edit', $order[$by]),
            "POST",
            $this->fillSite(
                $site,
                ['order' => json_encode($order), 'by' => $by]
            )
        );
    }
public function ordersEdit(array $order, $by = 'externalId', $site = null)
    {
        if (!count($order)) {
            throw new \InvalidArgumentException(
                'Parameter `order` must contains a data'
            );
        }

        $this->checkIdParameter($by);

        if (!array_key_exists($by, $order)) {
            throw new \InvalidArgumentException(
                sprintf('Order array must contain the "%s" parameter.', $by)
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/orders/%s/edit', $order[$by]),
            "POST",
            $this->fillSite(
                $site,
                ['order' => json_encode($order), 'by' => $by]
            )
        );
    }
public function ordersEdit ( array $ order , $ by = 'externalId' , $ site = null ) { if ( ! count ( $ order ) ) { throw new \ InvalidArgumentException ( 'Parameter `order` must contains a data' ) ; } $ this -> checkIdParameter ( $ by ) ; if ( ! array_key_exists ( $ by , $ order ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Order array must contain the "%s" parameter.' , $ by ) ) ; } /* @noinspection PhpUndefinedMethodInspection */ return $ this -> client -> makeRequest ( sprintf ( '/orders/%s/edit' , $ order [ $ by ] ) , "POST" , $ this -> fillSite ( $ site , [ 'order' => json_encode ( $ order ) , 'by' => $ by ] ) ) ; }
Edit an order

@param array  $order order data
@param string $by    (default: 'externalId')
@param string $site  (default: null)

@throws \InvalidArgumentException
@throws \RetailCrm\Exception\CurlException
@throws \RetailCrm\Exception\InvalidJsonException

@return \RetailCrm\Response\ApiResponse
Edit an order