### Docker Compose Setup Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Commands to set up and manage the Fakturoid PHP development environment using Docker Compose. Includes starting services, installing dependencies, and entering the container. ```shell $ docker-compose up -d $ docker-compose exec php composer install $ docker-compose exec php bash ``` -------------------------------- ### Install Fakturoid PHP Library via Composer Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Use Composer to install the Fakturoid PHP library. Ensure you have PHP 8.2 or later and the required extensions. ```bash composer require fakturoid/fakturoid-php ``` -------------------------------- ### Basic Fakturoid API Operations Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md A comprehensive example showing initialization, authentication, fetching user data, setting account slug, creating a subject, creating an invoice with lines, sending the invoice by email, marking it as paid, and locking it. ```php require __DIR__ . '/vendor/autoload.php'; $fManager = new \Fakturoid\FakturoidManager( \Psr\Http\Client\ClientInterface, // see User agent and HTTP client above '{fakturoid-client-id}', '{fakturoid-client-secret}' ); $fManager->authClientCredentials(); // get current user $user = $fManager->getUsersProvider()->getCurrentUser(); $fManager->setAccountSlug($user->getBody()->accounts[0]->slug); // or you can set account slug manually $fManager->setAccountSlug('{fakturoid-account-slug}'); // create subject $response = $fManager->getSubjectsProvider()->create(['name' => 'Firma s.r.o.', 'email' => 'aloha@pokus.cz']); $subject = $response->getBody(); // create invoice with lines $lines = [['name' => 'Big sale', 'quantity' => 1, 'unit_price' => 1000]]; $response = $fManager->getInvoicesProvider()->create(['subject_id' => $subject->id, 'lines' => $lines]); $invoice = $response->getBody(); // send by mail $fManager->getInvoicesProvider()->createMessage($invoice->id, ['email' => 'aloha@pokus.cz']); // to mark invoice as paid and send thank you email $fManager->getInvoicesProvider()->createPayment($invoice->id, ['paid_on' => (new \DateTime())->format('Y-m-d'), 'send_thank_you_email' => true]); // lock invoice (other fire actions are described in the API documentation) $fManager->getInvoicesProvider()->fireAction($invoice->id, 'lock'); ``` -------------------------------- ### Get Fakturoid Credentials Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieve the obtained Fakturoid API credentials from the FakturoidManager object. The credentials can be outputted as a JSON string. ```php $credentials = $fManager->getCredentials(); echo $credentials->toJson(); ``` -------------------------------- ### Get Fakturoid Authentication URL Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Generate the URL for initiating the OAuth 2.0 Authorization Code Flow. This URL directs the user to Fakturoid for login and authorization. ```php $fManager = new \Fakturoid\FakturoidManager( \Psr\Http\Client\ClientInterface::class, // see User agent and HTTP client above '{fakturoid-client-id}', '{fakturoid-client-secret}', null, '{your-redirect-uri}' ); echo 'Link'; ``` -------------------------------- ### List Inventory Moves for a Specific Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Get inventory moves associated with a particular inventory item ID. ```php $fManager->getInventoryMovesProvider()->list(['inventory_item_id' => $inventoryItemId]); ``` -------------------------------- ### Get Single Inventory Move Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Fetch a specific inventory move by its item ID and move ID. ```php $fManager->getInventoryMovesProvider()->get($inventoryItemId, $inventoryMoveId); ``` -------------------------------- ### Get Single Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Fetch a specific inventory item by its ID. ```php $fManager->getInventoryItemsProvider()->get($inventoryItemId); ``` -------------------------------- ### Switching Fakturoid Accounts Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Demonstrates how to initialize the FakturoidManager with an account slug and then switch to a different account slug to process documents for a different company. ```php $fManager = new \Fakturoid\FakturoidManager( \Psr\Http\Client\ClientInterface, // see User agent and HTTP client above '{fakturoid-client-id}', '{fakturoid-client-secret}', '{fakturoid-account-slug}', ); $fManager->authClientCredentials(); $fManager->getBankAccountsProvider()->list(); // switch account and company $fManager->setAccountSlug('{fakturoid-account-slug-another}'); $fManager->getBankAccountsProvider()->list(); ``` -------------------------------- ### Initialize FakturoidManager with Client Credentials Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Initializes the FakturoidManager using client ID and secret for the client credentials flow. Ensure a PSR-18 compatible HTTP client is provided. ```php $fManager = new \Fakturoid\FakturoidManager( \Psr\Http\Client\ClientInterface, // see User agent and HTTP client above '{fakturoid-client-id}', '{fakturoid-client-secret}' ); $fManager->authClientCredentials(); ``` -------------------------------- ### List All Inventory Items Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Fetches all inventory items from Fakturoid. ```php $fManager->getInventoryItemsProvider()->list(); ``` -------------------------------- ### Create HTTP Client with Guzzle Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Instantiate a Guzzle HTTP client with the required User-Agent header for Fakturoid API identification. ```php new \GuzzleHttp\Client(['headers' => ['User-Agent' => 'Bar']]) ``` -------------------------------- ### Create HTTP Client with Symfony Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Configure a Symfony HTTP client with the User-Agent header. This is typically done within the application's configuration. ```php (new \Symfony\Component\HttpClient\Psr18Client())->withOptions([['headers' => ['User-Agent' => 'Bar']]]) ``` -------------------------------- ### Check All Requirements for PR Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Command to verify all requirements for a pull request, including code style and other checks, using Composer scripts within Docker or locally. ```shell $ docker-compose exec php composer check:all # or locally $ composer check:all ``` -------------------------------- ### Create Stock-In Inventory Move Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Record a stock-in transaction for an inventory item, including quantity, date, and pricing details. ```php $fManager->getInventoryMovesProvider()->create( $inventoryItemId, [ 'direction' => 'in', 'moved_on' => '2023-01-12', 'quantity_change' => 5, 'purchase_price' => '249.99', 'purchase_currency' => 'CZK', 'private_note' => 'Bought with discount' ] ) ``` -------------------------------- ### List All Inventory Moves Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieve all inventory moves across all inventory items. ```php $fManager->getInventoryMovesProvider()->list() ``` -------------------------------- ### Create Stock-Out Inventory Move Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Record a stock-out transaction for an inventory item, specifying quantity, date, and pricing. ```php $fManager->getInventoryMovesProvider()->create( $inventoryItemId, [ 'direction' => 'out', 'moved_on' => '2023-01-12', 'quantity_change' => '1.5', 'retail_price' => 50, 'retail_currency' => 'EUR', 'native_retail_price' => '1250' ] ); ``` -------------------------------- ### Create Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Create a new inventory item with specified details. Requires name, SKU, and quantity tracking information. ```php $data = [ 'name' => 'Item name', 'sku' => 'SKU12345', 'track_quantity' => true, 'quantity' => 100, 'native_purchase_price' => 500, 'native_retail_price' => 1000 ]; $fManager->getInventoryItemsProvider()->create($data) ``` -------------------------------- ### Run PHPUnit Tests Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Commands to execute PHPUnit tests, both for standard testing and code coverage generation, using Docker Compose or locally. ```shell $ docker-compose exec php composer test:phpunit $ docker-compose exec php composer coverage:phpunit # or locally $ composer test:phpunit $ composer coverage:phpunit ``` -------------------------------- ### Restore and Set Credentials Manually Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Restores credentials from storage and sets them on the FakturoidManager. This is useful for multi-tenant applications or when managing credentials manually. It also sets a callback for future credential updates. ```php $fManager = new \Fakturoid\FakturoidManager( \Psr\Http\Client\ClientInterface, // see User agent and HTTP client above '{fakturoid-client-id}', '{fakturoid-client-secret}' ); // restore credentials from storage $credentials = new \Fakturoid\Auth\Credentials( 'refreshToken', 'accessToken', (new DateTimeImmutable())->modify('-2 minutes'), \Fakturoid\Enum\AuthTypeEnum::AUTHORIZATION_CODE_FLOW // or \Fakturoid\Enum\AuthTypeEnum:CLIENT_CREDENTIALS_CODE_FLOW ); $fManager->getAuthProvider()->setCredentials($credentials); $fManager->setCredentialsCallback(new class implements \Fakturoid\Auth\CredentialCallback { public function __invoke(?\Fakturoid\Auth\Credentials $credentials = null): void { // Save credentials to database or another storage } }); ``` -------------------------------- ### Download Invoice PDF (Simple) Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Downloads an invoice PDF and saves it to a file. Note that immediately after creation, the PDF might not be ready, resulting in a 204 status code. ```php $invoiceId = 123; $response = $fManager->getInvoicesProvider()->getPdf($invoiceId); $data = $response->getBody(); file_put_contents("{$invoiceId}.pdf", $data); ``` -------------------------------- ### List Archived Inventory Items Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieve all archived inventory items. ```php $fManager->getInventoryItemsProvider()->listArchived(); ``` -------------------------------- ### Code Style Check and Fix Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Commands to perform code style checks and automatically fix issues using Composer scripts, either within a Docker environment or locally. ```shell $ docker-compose exec php composer check:cs # or locally $ composer check:cs ``` ```shell $ docker-compose exec php composer fix:all # or locally $ composer fix:all ``` -------------------------------- ### Check Rate Limit Status in PHP Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Use this to check the current rate limit status from an API response. Access quota, window, remaining requests, and reset time. Handles potential client errors during the request. ```php try { $response = $fManager->getInvoicesProvider()->list(); // Get maximum number of requests allowed in the time window $quota = $response->getRateLimitQuota(); // e.g., 400 // Get time window in seconds $window = $response->getRateLimitWindow(); // e.g., 60 // Get remaining number of requests $remaining = $response->getRateLimitRemaining(); // e.g., 398 // Get remaining time in seconds until the rate limit resets $resetTime = $response->getRateLimitReset(); // e.g., 55 } catch (\Fakturoid\Exception\ClientErrorException $exception) { // Check if rate limit was exceeded (status code 429) if ($exception->isRateLimitExceeded()) { // Access rate limit info from the exception's response $response = $exception->getResponse(); $resetTime = $response->getRateLimitReset(); // Wait until the rate limit resets and retry sleep($resetTime); // retry the request... } } ``` -------------------------------- ### Migrate RequestException Handling from v4.x to v5.0 Source: https://github.com/fakturoid/fakturoid-php/blob/main/UPGRADE.md Update exception handling for RequestException to accommodate the change in the return type of getResponse() from Psr\Http\Message\ResponseInterface to Fakturoid\Response. Access to rate limiting information and decoded body is now more direct. ```php use Fakturoid\Exception\ClientErrorException; use Psr\Http\Message\ResponseInterface; try { $response = $fManager->getInvoicesProvider()->create($data); } catch (ClientErrorException $e) { /** @var ResponseInterface $response */ $response = $e->getResponse(); $statusCode = $response->getStatusCode(); $reasonPhrase = $response->getReasonPhrase(); $body = $response->getBody()->getContents(); } ``` ```php use Fakturoid\Exception\ClientErrorException; use Fakturoid\Response; try { $response = $fManager->getInvoicesProvider()->create($data); } catch (ClientErrorException $e) { /** @var Response $response */ $response = $e->getResponse(); $statusCode = $response->getStatusCode(); // Access to PSR ResponseInterface if needed $reasonPhrase = $response->getOriginalResponse()->getReasonPhrase(); // Body is now easier to access $body = $response->getBody(); // Returns decoded JSON or string // NEW: Access to rate limiting information if ($e->isRateLimitExceeded()) { $resetTime = $response->getRateLimitReset(); $remaining = $response->getRateLimitRemaining(); } } ``` -------------------------------- ### Download Invoice PDF (With Retry Logic) Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Downloads an invoice PDF with a retry mechanism. It repeatedly attempts to download the PDF every second until a 200 status code is received, indicating the PDF is ready. ```php $invoiceId = 123; // This is just an example, you may want to do this in a background job and be more defensive. while (true) { $response = $fManager->getInvoicesProvider()->getPdf($invoiceId); if ($response->getStatusCode() == 200) { $data = $response->getBody(); file_put_contents("{$invoiceId}.pdf", $data); break; } sleep(1); } ``` -------------------------------- ### Set Credentials Callback for Token Refresh Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Sets a callback function that is invoked whenever Fakturoid credentials (like access tokens) are changed or refreshed. This is crucial for automatically handling token expiration and renewal. ```php $fManager->setCredentialsCallback(new class implements \Fakturoid\Auth\CredentialCallback { public function __invoke(?\Fakturoid\Auth\Credentials $credentials = null): void { // Save credentials to database or another storage } }); ``` -------------------------------- ### Search Inventory Items Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Search for inventory items using a query string. This searches across the 'name', 'article_number', and 'sku' fields. ```php $fManager->getInventoryItemsProvider()->listArchived(['query' => 'Item name']); ``` -------------------------------- ### Filter Inventory Items by SKU or Article Number Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieve inventory items by filtering on their SKU or article number. ```php $fManager->getInventoryItemsProvider()->list(['sku' => 'SKU1234']); ``` ```php $fManager->getInventoryItemsProvider()->list(['article_number' => 'IAN321']); ``` -------------------------------- ### Request Fakturoid Credentials with Code Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Exchange the authorization code received after user redirection for Fakturoid API credentials. This step completes the OAuth 2.0 Authorization Code Flow. ```php $fManager->requestCredentials($_GET['code']); ``` -------------------------------- ### Archive Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Archive a specific inventory item by its ID. ```php $fManager->getInventoryItemsProvider()->archive($inventoryItemId); ``` -------------------------------- ### InventoryItem Resource Operations Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Provides methods for managing inventory items, including listing, filtering, searching, retrieving, creating, updating, archiving, unarchiving, and deleting. ```APIDOC ## InventoryItem Resource Operations ### Description Provides methods for managing inventory items, including listing, filtering, searching, retrieving, creating, updating, archiving, unarchiving, and deleting. ### List All Inventory Items #### Method GET #### Endpoint /inventory_items ### Filter Inventory Items #### Method GET #### Endpoint /inventory_items #### Parameters ##### Query Parameters - **sku** (string) - Optional - Filter by SKU code. - **article_number** (string) - Optional - Filter by article number. ### Search Inventory Items #### Method GET #### Endpoint /inventory_items #### Parameters ##### Query Parameters - **query** (string) - Required - Search term for name, article_number, and sku. ### List Archived Inventory Items #### Method GET #### Endpoint /inventory_items/archived ### Get Single Inventory Item #### Method GET #### Endpoint /inventory_items/{id} #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the inventory item to retrieve. ### Create Inventory Item #### Method POST #### Endpoint /inventory_items #### Request Body - **name** (string) - Required - The name of the inventory item. - **sku** (string) - Required - The SKU code of the inventory item. - **track_quantity** (boolean) - Required - Whether to track quantity for this item. - **quantity** (integer) - Optional - The current quantity of the item. - **native_purchase_price** (number) - Optional - The purchase price in the native currency. - **native_retail_price** (number) - Optional - The retail price in the native currency. ### Update Inventory Item #### Method PUT #### Endpoint /inventory_items/{id} #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the inventory item to update. #### Request Body - **name** (string) - Optional - The new name for the inventory item. ### Archive Inventory Item #### Method DELETE #### Endpoint /inventory_items/{id}/archive #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the inventory item to archive. ### Unarchive Inventory Item #### Method PUT #### Endpoint /inventory_items/{id}/unarchive #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the inventory item to unarchive. ### Delete Inventory Item #### Method DELETE #### Endpoint /inventory_items/{id} #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the inventory item to delete. ``` -------------------------------- ### Activate Recurring Generator Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Resume a paused recurring generator. ```php $fManager->getRecurringGeneratorsProvider()->activate($generatorId); ``` -------------------------------- ### Unarchive Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Restore a previously archived inventory item by its ID. ```php $fManager->getInventoryItemsProvider()->unArchive($inventoryItemId); ``` -------------------------------- ### Activate Recurring Generator with Specific Next Occurrence Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Restart a recurring generator and set a specific date for its next occurrence. ```php $fManager->getRecurringGeneratorsProvider()->activate($generatorId, [ 'next_occurrence_on' => '2025-02-15' ]); ``` -------------------------------- ### Handle API Errors in PHP Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Catch and handle `ClientErrorException` for 4xx errors and `ServerErrorException` for 5xx errors. Access error codes, messages, and response bodies. ```php try { $response = $fManager->getSubjectsProvider()->create(['name' => '', 'email' => 'aloha@pokus.cz']); $subject = $response->getBody(); } catch ( \Fakturoid\Exception\ClientErrorException $e) { $e->getCode(); // 422 $e->getMessage(); // Unprocessable entity $e->getResponse()->getBody(); // '{"errors":{"name":["je povinná položka","je příliš krátký/á/é (min. 2 znaků)"]}}' } catch ( \Fakturoid\Exception\ServerErrorException $e) { $e->getCode(); // 503 $e->getMessage(); // Fakturoid is in read only state } ``` -------------------------------- ### InventoryMove Resource Operations Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Manages inventory movements, including listing all moves, filtering by item, retrieving a specific move, creating stock-in or stock-out moves, updating, and deleting. ```APIDOC ## InventoryMove Resource Operations ### Description Manages inventory movements, including listing all moves, filtering by item, retrieving a specific move, creating stock-in or stock-out moves, updating, and deleting. ### List All Inventory Moves #### Method GET #### Endpoint /inventory_moves ### List Inventory Moves for an Item #### Method GET #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. ### Get Single Inventory Move #### Method GET #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves/{inventory_move_id} #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. - **inventory_move_id** (string) - Required - The ID of the inventory move. ### Create Stock-In Inventory Move #### Method POST #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. #### Request Body - **direction** (string) - Required - Must be 'in'. - **moved_on** (string) - Required - Date of the move (YYYY-MM-DD). - **quantity_change** (number) - Required - The quantity to add. - **purchase_price** (string) - Optional - The purchase price. - **purchase_currency** (string) - Optional - The currency of the purchase price. - **private_note** (string) - Optional - A private note for the move. ### Create Stock-Out Inventory Move #### Method POST #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. #### Request Body - **direction** (string) - Required - Must be 'out'. - **moved_on** (string) - Required - Date of the move (YYYY-MM-DD). - **quantity_change** (string) - Required - The quantity to remove. - **retail_price** (number) - Optional - The retail price. - **retail_currency** (string) - Optional - The currency of the retail price. - **native_retail_price** (string) - Optional - The retail price in the native currency. ### Update Inventory Move #### Method PUT #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves/{inventory_move_id} #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. - **inventory_move_id** (string) - Required - The ID of the inventory move. #### Request Body - **moved_on** (string) - Optional - The new date of the move (YYYY-MM-DD). ### Delete Inventory Move #### Method DELETE #### Endpoint /inventory_items/{inventory_item_id}/inventory_moves/{inventory_move_id} #### Parameters ##### Path Parameters - **inventory_item_id** (string) - Required - The ID of the inventory item. - **inventory_move_id** (string) - Required - The ID of the inventory move. ``` -------------------------------- ### List Subjects with Custom ID Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieves a list of subjects, allowing filtering by a custom application record ID. Ensures uniqueness of `custom_id`. ```APIDOC ## List Subjects with Custom ID ### Description Retrieves a list of subjects, allowing filtering by a custom application record ID. Ensures uniqueness of `custom_id`. ### Method GET (implied by list operation) ### Endpoint /subjects ### Parameters #### Query Parameters - **custom_id** (string) - Required - Your application record ID to filter subjects. ### Request Example ```php $response = $fManager->getSubjectsProvider()->list(['custom_id' => '10']); $subjects = $response->getBody(); ``` ### Response #### Success Response (200) - **subjects** (array) - A list of subject objects matching the filter. ### Notes The `custom_id` field always returns a string. ``` -------------------------------- ### List Subjects with Custom ID Filter Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Retrieve subjects filtered by a specific custom ID. The custom ID is always returned as a string. ```php $response = $fManager->getSubjectsProvider()->list(['custom_id' => '10']); $subjects = $response->getBody(); $subject = null; if (count($subjects) > 0) { $subject = $subjects[0]; } ``` -------------------------------- ### Update Inventory Move Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Modify an existing inventory move by its item ID and move ID. ```php $fManager->getInventoryMovesProvider()->update($inventoryItemId, $inventoryMoveId, ['moved_on' => '2023-01-11']); ``` -------------------------------- ### Update Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Modify an existing inventory item by its ID. ```php $fManager->getInventoryItemsProvider()->update($inventoryItemId, ['name' => 'Another name']); ``` -------------------------------- ### Recurring Generators Operations Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Provides operations to manage recurring generators, specifically pausing and activating them. ```APIDOC ## Recurring Generators Operations ### Description Provides operations to manage recurring generators, specifically pausing and activating them. ### Pause Recurring Generator #### Method PUT #### Endpoint /recurring_generators/{id}/pause #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the recurring generator. ### Activate Recurring Generator #### Method PUT #### Endpoint /recurring_generators/{id}/activate #### Parameters ##### Path Parameters - **id** (string) - Required - The ID of the recurring generator. #### Request Body - **next_occurrence_on** (string) - Optional - The specific date for the next occurrence (YYYY-MM-DD). ``` -------------------------------- ### Delete Inventory Item Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Permanently remove an inventory item by its ID. ```php $fManager->getInventoryItemsProvider()->delete($inventoryItemId); ``` -------------------------------- ### Delete Inventory Move Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Remove an inventory move by its item ID and move ID. Note: This uses the 'update' method in the source, which might be a typo and should potentially be 'delete'. ```php $fManager->getInventoryMovesProvider()->update($inventoryItemId, $inventoryMoveId); ``` -------------------------------- ### Pause Recurring Generator Source: https://github.com/fakturoid/fakturoid-php/blob/main/README.md Temporarily stop a recurring generator by its ID. ```php $fManager->getRecurringGeneratorsProvider()->pause($generatorId); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.