> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invopop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate SAF-T report

> Generate and download a SAF-T PT report for the specified period.

Generate and download a SAF-T PT report for the specified period. The report can be generated for a full year or a specific month.


## OpenAPI

````yaml GET /apps/at-pt/v1/entry/{silo_entry_id}/saft
openapi: 3.1.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: Set of end-points to interact with the AT Portugal app API.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Portugal AT Service API
  version: 0.1.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - InvopopAuth: []
paths:
  /apps/at-pt/v1/entry/{silo_entry_id}/saft:
    get:
      description: Generate and download a SAF-T PT report for the specified period.
      parameters:
        - description: Silo entry ID of the supplier to generate the SAF-T PT report for.
          in: path
          name: silo_entry_id
          required: true
          schema:
            description: Silo entry ID of the supplier to generate the SAF-T PT report for.
            example: 347c5b04-cde2-11ed-afa1-0242ac120002
            title: Silo Entry ID
            type: string
        - description: Report year for the SAF-T PT report.
          in: query
          name: year
          required: true
          schema:
            description: Report year for the SAF-T PT report.
            example: 2024
            minimum: 2020
            title: Year
            type: integer
        - description: >-
            Report month (1-12) for monthly report. Omit or use 0 for full year
            report.
          in: query
          name: period
          required: false
          schema:
            default: 0
            description: >-
              Report month (1-12) for monthly report. Omit or use 0 for full
              year report.
            example: 3
            maximum: 12
            minimum: 0
            title: Period
            type: integer
      responses:
        '200':
          content:
            application/xml:
              schema:
                format: binary
                type: string
          description: SAF-T report generated successfully.
          headers:
            Content-Disposition:
              description: Suggested filename for download.
              schema:
                example: attachment; filename="saft-2024-03-01-2024-03-31.xml"
                type: string
            Content-Type:
              description: MIME type with Windows-1252 charset.
              schema:
                example: application/xml; charset=windows-1252
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid parameters (year < 2020, period out of range, future date).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Supplier not found.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
components:
  schemas:
    Error:
      properties:
        message:
          description: Details of the error.
          title: Message
          type: string
      type: object
  securitySchemes:
    InvopopAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Use the `Bearer` scheme with a valid JWT token to authenticate requests.

        Example: `Authorization: Bearer <token>`

````