* } $attributes * - carrier: e.g. "DHL" * - tracking_url: http(s) link to track the parcel, shown to the user * - shipped_at: when it was sent (default: now, not in the future) * - notify_customer: Anikeen ID mails the user with the delivery note (default true); * false if your shop sends its own mail * - items: physical items of the order and how many of them (default: all left) * * Errors (ResourceException with the HTTP status): 409 when the order isn't paid or nothing * is left to ship, 422 for items that aren't physical items of the order or exceed what's left. * * @throws Throwable */ public function create(array $attributes = []): Shipment { return (new Shipment(fn() => $this->billable->anikeenId() ->request('POST', sprintf('v1/orders/%s/shipments', $this->parent->id), $attributes))) ->setBillable($this->billable) ->setParent($this->parent); } /** * {@inheritDoc} */ public function find(string $id): ?Shipment { return (new Shipment(fn() => $this->billable->anikeenId() ->request('GET', sprintf('v1/orders/%s/shipments/%s', $this->parent->id, $id)))) ->setBillable($this->billable) ->setParent($this->parent); } }