Skip to content

Commit

Permalink
Add endpoint for download invoces (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored Sep 4, 2020
1 parent 6e3607b commit dd8ecb4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Api/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,25 @@ public function email(int $invoice)

return $this->hydrator->hydrate($response, ApiResponse::class);
}

/**
* @throws \FAPI\Fortnox\Exception\DomainException
*
* @return ResponseInterface
*/
public function print(int $invoice)
{
$response = $this->httpGet(sprintf('/3/invoices/%d/print', $invoice));

if (!$this->hydrator) {
return $response;
}

// Use any valid status code here
if (200 !== $response->getStatusCode()) {
$this->handleErrors($response);
}

return $response;
}
}

0 comments on commit dd8ecb4

Please sign in to comment.