> ## 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.

# Fetch sent archive

> Download the official ANAF archive of an invoice sent to RO e-Factura, for the last time it was sent. The zip is signed by ANAF and holds the accepted invoice, or the errors of a rejection.

Returns the official ANAF archive of an invoice sent with the **Send e-Factura XML to ANAF** step, as a zip file signed by ANAF. Keep it as proof of what ANAF received and decided.

The archive always belongs to the last time the invoice was sent. If ANAF rejected it and it was sent again, the archive of the rejection is replaced by the new one once ANAF decides.

| Situation | Status | Answer |
| - | - | - |
| ANAF accepted the invoice | `200` | Zip holding the invoice and ANAF's signature |
| ANAF rejected the invoice | `200` | Zip holding the errors ANAF found and ANAF's signature |
| ANAF is still processing the invoice, also when it was sent again after a rejection | `404` | `anaf archive is not available yet` |
| The invoice was never sent to ANAF | `404` | `sent entry was not found` |
| The invoice belongs to another workspace | `404` | `party belongs to a different workspace` |

The zip is named after the upload index ANAF assigned to the invoice, the same value as the invoice's `ro-anaf-upload-index` stamp (for example `5001234567.zip`).

> [!NOTE]
>
> ANAF usually decides within a few minutes. While it is processing the invoice, try again later.


## OpenAPI

````yaml GET /apps/gov-ro/v1/sent/{silo_entry_id}/archive
openapi: 3.1.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: >-
    Set of end-points that help you register parties with the Romania RO
    e-Factura app and download the official ANAF archives of their invoices
    through the API.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Romania Service API
  version: 0.1.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - InvopopAuth: []
paths:
  /apps/gov-ro/v1/sent/{silo_entry_id}/archive:
    get:
      description: >-
        Download the official ANAF archive of an invoice sent to RO e-Factura,
        for the last time it was sent. The zip is signed by ANAF and holds the
        accepted invoice, or the errors of a rejection.
      parameters:
        - $ref: '#/components/parameters/InvoiceEntryID'
      responses:
        '200':
          $ref: '#/components/responses/Archive'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Not Found - The archive isn't available. The `message` says why, see
            the endpoint page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    InvoiceEntryID:
      description: ID of the bill.Invoice silo entry.
      in: path
      name: silo_entry_id
      required: true
      schema:
        description: ID of the bill.Invoice silo entry.
        example: 0190c3a2-7b1e-7c4d-9f2a-3e5d8b6a1c40
        title: Silo Entry ID
        type: string
  responses:
    Archive:
      description: The official ANAF archive, as a zip file.
      headers:
        Content-Disposition:
          description: Suggested file name of the archive.
          schema:
            type: string
            example: attachment; filename="5001234567.zip"
      content:
        application/zip:
          schema:
            type: string
            format: binary
    Unauthorized:
      description: Unauthorized - Missing or invalid token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Internal Server Error - The request could not be processed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          description: Details of the error.
          type: string
  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>`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.