# Generate annual certifications `POST / GET /api/v1/invoices/generate/{year}` Generates or refreshes certifications for one fiscal year and payment direction. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Invoices → Write**. ## Path parameters - `year` (integer, required) — Four-digit fiscal year, from 1970 through 9999. ## Query parameters - `payment_type` (string) — Use incoming or outgoing. Generation defaults to incoming. ## Body parameters - `payment_type` (string) — Use incoming or outgoing. Generation defaults to incoming. Both methods generate records. You can send payment_type in the query string or the POST JSON body. When both are present, the body takes precedence. ## Request (POST) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/invoices/generate/${YEAR:?Set YEAR}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --url-query "payment_type=incoming" ``` ## Request (GET) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --get \ --url "https://api.asdincloud.com/api/v1/invoices/generate/${YEAR:?Set YEAR}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --data-urlencode "payment_type=incoming" ``` ## Response **200 OK** Returns created and updated counts in `stats`. Inspect the error and warning arrays even on HTTP 200. Example with fictional data and selected fields. ```json { "status": "success", "message": { "message_key": "entities.invoice.messages.generated" }, "stats": { "created": 2, "updated": 1, "errors": [], "warnings": [], "error_details": [], "warning_details": [] } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The fiscal year or payment type is invalid.