forked from imper86/php-allegro-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShipmentCreateCommands.php
More file actions
38 lines (32 loc) · 1.08 KB
/
ShipmentCreateCommands.php
File metadata and controls
38 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Imper86\PhpAllegroApi\Resource\ShipmentManagement;
use Imper86\PhpAllegroApi\Resource\AbstractResource;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Message\ResponseInterface;
class ShipmentCreateCommands extends AbstractResource
{
/**
* Create new shipment
* Use this resource to create shipment for delivery.
*
* @param array $body Request body
* @return ResponseInterface
* @throws ClientExceptionInterface
*/
public function post(array $body): ResponseInterface
{
return $this->apiPost('/shipment-management/shipments/create-commands', $body);
}
/**
* Get shipment creation command status
* Use this resource to get shipment creation status.
*
* @param string $commandId Unique identifier of shipment create command
* @return ResponseInterface
* @throws ClientExceptionInterface
*/
public function get(string $commandId): ResponseInterface
{
return $this->apiGet(sprintf('/shipment-management/shipments/create-commands/%s', $commandId));
}
}