| @@ 48-57 (lines=10) @@ | ||
| 45 | * @param string $site (default: null) |
|
| 46 | * @return ApiResponse |
|
| 47 | */ |
|
| 48 | public function ordersCreate(array $order, $site = null) |
|
| 49 | { |
|
| 50 | if (!sizeof($order)) { |
|
| 51 | throw new \InvalidArgumentException('Parameter `order` must contains a data'); |
|
| 52 | } |
|
| 53 | ||
| 54 | return $this->client->makeRequest("/orders/create", Client::METHOD_POST, $this->fillSite($site, array( |
|
| 55 | 'order' => json_encode($order) |
|
| 56 | ))); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Edit a order |
|
| @@ 95-104 (lines=10) @@ | ||
| 92 | * @param string $site (default: null) |
|
| 93 | * @return ApiResponse |
|
| 94 | */ |
|
| 95 | public function ordersUpload(array $orders, $site = null) |
|
| 96 | { |
|
| 97 | if (!sizeof($orders)) { |
|
| 98 | throw new \InvalidArgumentException('Parameter `orders` must contains array of the orders'); |
|
| 99 | } |
|
| 100 | ||
| 101 | return $this->client->makeRequest("/orders/upload", Client::METHOD_POST, $this->fillSite($site, array( |
|
| 102 | 'orders' => json_encode($orders), |
|
| 103 | ))); |
|
| 104 | } |
|
| 105 | ||
| 106 | /** |
|
| 107 | * Get order by id or externalId |
|
| @@ 213-222 (lines=10) @@ | ||
| 210 | * @param array $ids |
|
| 211 | * @return ApiResponse |
|
| 212 | */ |
|
| 213 | public function ordersFixExternalIds(array $ids) |
|
| 214 | { |
|
| 215 | if (!sizeof($ids)) { |
|
| 216 | throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); |
|
| 217 | } |
|
| 218 | ||
| 219 | return $this->client->makeRequest("/orders/fix-external-ids", Client::METHOD_POST, array( |
|
| 220 | 'orders' => json_encode($ids), |
|
| 221 | )); |
|
| 222 | } |
|
| 223 | ||
| 224 | /** |
|
| 225 | * Get orders assembly history |
|
| @@ 256-265 (lines=10) @@ | ||
| 253 | * @param string $site (default: null) |
|
| 254 | * @return ApiResponse |
|
| 255 | */ |
|
| 256 | public function customersCreate(array $customer, $site = null) |
|
| 257 | { |
|
| 258 | if (!sizeof($customer)) { |
|
| 259 | throw new \InvalidArgumentException('Parameter `customer` must contains a data'); |
|
| 260 | } |
|
| 261 | ||
| 262 | return $this->client->makeRequest("/customers/create", Client::METHOD_POST, $this->fillSite($site, array( |
|
| 263 | 'customer' => json_encode($customer) |
|
| 264 | ))); |
|
| 265 | } |
|
| 266 | ||
| 267 | /** |
|
| 268 | * Edit a customer |
|
| @@ 307-316 (lines=10) @@ | ||
| 304 | * @param string $site (default: null) |
|
| 305 | * @return ApiResponse |
|
| 306 | */ |
|
| 307 | public function customersUpload(array $customers, $site = null) |
|
| 308 | { |
|
| 309 | if (!sizeof($customers)) { |
|
| 310 | throw new \InvalidArgumentException('Parameter `customers` must contains array of the customers'); |
|
| 311 | } |
|
| 312 | ||
| 313 | return $this->client->makeRequest("/customers/upload", Client::METHOD_POST, $this->fillSite($site, array( |
|
| 314 | 'customers' => json_encode($customers), |
|
| 315 | ))); |
|
| 316 | } |
|
| 317 | ||
| 318 | /** |
|
| 319 | * Get customer by id or externalId |
|
| @@ 366-375 (lines=10) @@ | ||
| 363 | * @param array $ids |
|
| 364 | * @return ApiResponse |
|
| 365 | */ |
|
| 366 | public function customersFixExternalIds(array $ids) |
|
| 367 | { |
|
| 368 | if (!sizeof($ids)) { |
|
| 369 | throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair'); |
|
| 370 | } |
|
| 371 | ||
| 372 | return $this->client->makeRequest("/customers/fix-external-ids", Client::METHOD_POST, array( |
|
| 373 | 'customers' => json_encode($ids), |
|
| 374 | )); |
|
| 375 | } |
|
| 376 | ||
| 377 | /** |
|
| 378 | * Get purchace prices & stock balance |
|
| @@ 410-421 (lines=12) @@ | ||
| 407 | * @param string $site (default: null) |
|
| 408 | * @return ApiResponse |
|
| 409 | */ |
|
| 410 | public function storeInventoriesUpload(array $offers, $site = null) |
|
| 411 | { |
|
| 412 | if (!sizeof($offers)) { |
|
| 413 | throw new \InvalidArgumentException('Parameter `offers` must contains array of the customers'); |
|
| 414 | } |
|
| 415 | ||
| 416 | return $this->client->makeRequest( |
|
| 417 | "/store/inventories/upload", |
|
| 418 | Client::METHOD_POST, |
|
| 419 | $this->fillSite($site, array('offers' => json_encode($offers))) |
|
| 420 | ); |
|
| 421 | } |
|
| 422 | ||
| 423 | /** |
|
| 424 | * Returns deliveryServices list |
|