diff --git a/src/File/Client.php b/src/File/Client.php index f3505f5..099cc5d 100644 --- a/src/File/Client.php +++ b/src/File/Client.php @@ -23,7 +23,7 @@ class Client extends BaseClient * @throws LexOfficeApiException * @throws CacheException */ - public function upload(string $filepath, string $type) + public function upload(string $filepath, string $type, ?string $voucherId = null) { $regex = '/.(' . implode('|', $this->supportedExtension) . ')/'; $matchResult = preg_match($regex, $filepath, $matches); @@ -45,7 +45,7 @@ public function upload(string $filepath, string $type) 'type' => $type ]); - $api = $this->api->newRequest('POST', $this->resource, [ + $api = $this->api->newRequest('POST', $voucherId ? "vouchers/{$voucherId}/{$this->resource}" : $this->resource, [ 'Content-Type' => 'multipart/form-data; boundary=' . $body->getBoundary() ]);