Guest User

verificaPartitaIva.yaml

a guest
Oct 2nd, 2023
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 12.21 KB | Software | 0 0
  1. #
  2. # Verifica validità partita iva
  3. x-commons:
  4.   ratelimit-headers: &ratelimit-headers
  5.     X-RateLimit-Limit:
  6.       $ref: '#/components/headers/X-RateLimit-Limit'
  7.     X-RateLimit-Remaining:
  8.       $ref: '#/components/headers/X-RateLimit-Remaining'
  9.     X-RateLimit-Reset:
  10.         $ref: '#/components/headers/X-RateLimit-Reset'
  11.   common-responses: &common-responses
  12.     '400':
  13.       $ref: '#/components/responses/400BadRequest'
  14.     '401':
  15.       $ref: '#/components/responses/401Unauthorized'
  16.     '429':
  17.       $ref: '#/components/responses/429TooManyRequests'
  18.     '503':
  19.       $ref: '#/components/responses/503ServiceUnavailable'
  20.     default:
  21.       $ref: '#/components/responses/default'
  22.  
  23. security:
  24.   - IBM-Client-Secret: []
  25.     IBM-Client-Id: []
  26.    
  27. openapi: 3.0.0
  28. info:
  29.   version: "1.0.0"
  30.  
  31.   title: |-
  32.     Verifica validità partita iva.
  33.   x-summary: >-
  34.     Verifica di validità di partita iva e recupero di alcuni dati anagrafici
  35.  
  36.   description: |
  37.    #### Documentazione
  38.     Questo servizio ritorna la validità di una partita iva. In caso riscontro positivo
  39.     vengono fornite alcune informazioni di tipo
  40.     anagrafico tra cui eventuali riferimenti al GRUPPO IVA:
  41.  
  42.     - STATO, DENOMINAZIONE, DATA INIZIO ATTIVITA', DATA CESSAZIONE, DATA SOSPENSIONE
  43.    
  44.     ##### Denominazione
  45.     Per le ditte individuali viene fornita la denominazione se dichiarata, diversamente il cognome e nome del titolare
  46.  
  47.     ##### Gruppo Iva
  48.     Il concetto di *GRUPPO IVA* può essere approfondito al seguente
  49.     [link](https://www.agenziaentrate.gov.it/portale/web/guest/schede/istanze/costituzione-gruppo-iva/scheda-informativa-costituzione-gruppoiva).
  50.    
  51.     #### Note
  52.     Poiché il servizio effettua una verifica sul dato in input una risposta verrà sempre ritornata con stato 200
  53.     anche se la partita iva in input non fosse presente negli archivi.
  54.    
  55.     Alcune "DATE" potrebbero essere espresse nei seguenti formati '1001-01-01', '9999-12-31'.
  56.     Tali date devono essere interpretate come informazioni assenti o non certe.
  57.     E' in corso una revisione degli archivi dell'Agenzia Delle Entrate per sanare queste informazioni.
  58.  
  59.     Il servizio non richiede autenticazione, ma va' usato rispettando gli
  60.     header di throttling esposti in conformita' alle Linee Guida del Modello di interoperabilita'.
  61.    
  62.     ##### Confomrmità con il modello di interoperabilità
  63.     L'Header di Throttling X-RateLimit-Reset non viene inviato in caso di https status code 200, sarà presente solo in caso di 429
  64.  
  65.     #### Sicurezza
  66.     Pur essendo questa API di pubblico accesso, è richiesto l'invio delle API Key che consentono all'infrastruttura
  67.     di applicare le politiche di throttling definite nell'ambito del piano sottoscritto
  68.      
  69.     #### Informazioni tecniche ed esempi
  70.  
  71.     Esempio:
  72.  
  73.     ```
  74.     curl https://api.agenziaentrate.gov.it/entrate/api/partita-iva/v0/verifica/06363391001
  75.    
  76.     {
  77.       "partitaIva": "06363391001",
  78.       "valida": true,
  79.       "stato": "ATTIVA",
  80.       "denominazione": "AGENZIA DELLE ENTRATE",
  81.       "dataInizioAttivita": "2001-01-02"
  82.     }
  83.     ```
  84.  
  85.  
  86.   contact:
  87.     name: Agenzia delle Entrate
  88.     url: https://www.agenziaentrate.gov.it
  89.   x-audience:
  90.    - public
  91.   x-api-id: 5ca54741-8f62-4aad-ab79-13ae762920e3
  92.   license:
  93.     name: Apache 2.0
  94.     url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  95. tags:
  96.   - name: public
  97.     description: |-
  98.       Endpoint non autenticato per la verifica dello stato del servizio
  99.   - name: verifiche
  100.     description: |-
  101.       verifica la validità e l'esistenza della partita iva in input
  102. servers:
  103.   - description: Produzione
  104.     url: https://api.agenziaentrate.gov.it/entrate/api/partita-iva/v0
  105.  
  106.  
  107. paths:
  108.   /status:
  109.     get:
  110.       summary: Ritorna lo stato dell'applicazione.
  111.       description: |
  112.         Ritorna lo stato dell'applicazione: 200 se funziona correttamente
  113.         o un errore se l'applicazione è temporaneamente indisponibile
  114.         per manutenzione o per un problema tecnico.
  115.       operationId: get_status
  116.       tags:
  117.        - public
  118.       responses:
  119.         <<: *common-responses
  120.         '200':
  121.           description: |
  122.            Il server ha ritornato lo status. In caso di problemi
  123.             ritorna sempre un problem+json.
  124.           headers:
  125.             <<: *ratelimit-headers
  126.           content:
  127.             application/problem+json:
  128.               schema:
  129.                 $ref: '#/components/schemas/Problem'
  130.   /verifica:
  131.     post:
  132.       summary: Valida una partita iva.
  133.       description: |
  134.        Ritorna informazioni sulla validità della partita iva
  135.         e in caso di esito positivo vengono aggiunte alcune informazioni anagrafiche.
  136.  
  137.       operationId: post_partita_iva
  138.       tags:
  139.        - verifiche
  140.       requestBody:
  141.         required: true
  142.         content:
  143.           application/json:
  144.             schema:
  145.               $ref: '#/components/schemas/Richiesta'
  146.             examples:
  147.               partitaIvaNumerica:
  148.                 value:
  149.                   partitaIva: '06363391001'
  150.       responses:
  151.         <<: *common-responses
  152.         '200':
  153.           description: |
  154.            Il servizio ha ritornato l'esito della validazione - che può essere positivo o negativo -
  155.             a seconda del valore del campo `valida`.
  156.  
  157.             Attenzione! Le partite iva valide possono essere o meno attive: va quindi sempre
  158.             verificato il contenuto della response.
  159.           # header di throttling sono obbligatori
  160.           headers:
  161.             <<: *ratelimit-headers
  162.           content:
  163.             application/json:
  164.               schema:
  165.                 $ref: '#/components/schemas/VerificaPartitaIva'
  166.               examples:   # Esempi per ogni casistica
  167.                 Invalida:
  168.                   value:
  169.                     partitaIva: '01043931007'
  170.                     valida: false
  171.                 Attiva:
  172.                   value: &example_partita_iva_attiva
  173.                     partitaIva: '06363391001'
  174.                     valida: true
  175.                     stato: 'ATTIVA'
  176.                     denominazione: 'AGENZIA DELLE ENTRATE'
  177.                     dataInizioAttivita: '2001-01-02'
  178.                 Sospesa:
  179.                   value:
  180.                     <<: *example_partita_iva_attiva
  181.                     stato: 'SOSPESA'
  182.                     dataInizioSospensione: '2013-03-15'
  183.                 Cessata:
  184.                   value:
  185.                     <<: *example_partita_iva_attiva
  186.                     stato: 'CESSATA'
  187.                     dataCessazioneAttivita: '1989-01-01'
  188.                 GruppoIva:
  189.                   value:
  190.                     <<: *example_partita_iva_attiva
  191.                     isGruppoIva: true
  192.                 PartecipanteGruppoIva:
  193.                   value:
  194.                     <<: *example_partita_iva_attiva
  195.                     isPartecipanteGruppoIva: true
  196.                     dataInizioPartecipazioneGruppoIva: '2018-10-27'
  197.                     partitaIvaGruppo: '06363391001'
  198.  
  199. components:
  200.   schemas:
  201.     Richiesta:
  202.       type: object
  203.       properties:
  204.         partitaIva:
  205.           $ref: '#/components/schemas/PartitaIva'
  206.  
  207.     PartitaIva:
  208.       type: string
  209.       maxLength: 11
  210.       minLength: 11
  211.       pattern: '^[0-9]+'
  212.       example: '06363391001'
  213.  
  214.     VerificaPartitaIva:
  215.       type: object
  216.       properties:
  217.         partitaIva:
  218.           $ref: '#/components/schemas/PartitaIva'
  219.         valida:
  220.           type: boolean
  221.           example: true
  222.         stato:
  223.           type: string
  224.           enum:
  225.            - ATTIVA
  226.             - CESSATA
  227.             - SOSPESA
  228.           example: 'ATTIVA'
  229.         denominazione:
  230.           type: string
  231.           example: 'AGENZIA DELLE ENTRATE'
  232.         dataInizioAttivita:
  233.           type: string
  234.           format: date
  235.           example: '1982-05-22'
  236.         dataCessazioneAttivita:
  237.           type: string
  238.           format: date
  239.           example: '1982-05-22'
  240.         dataInizioSospensione:
  241.           type: string
  242.           format: date
  243.           example: '1982-05-22'
  244.         isGruppoIva:
  245.           type: boolean
  246.           example: false
  247.         partitaIvaGruppo:
  248.           $ref: '#/components/schemas/PartitaIva'
  249.         dataInizioPartecipazioneGruppoIva:
  250.           type: string
  251.           format: date
  252.           example: '1982-05-22'
  253.         isPartecipanteGruppoIva:
  254.           type: boolean
  255.           example: false
  256.     Problem:
  257.       properties:
  258.         detail:
  259.           description: |
  260.            A human readable explanation specific to this occurrence of the
  261.             problem. You MUST NOT expose internal informations, personal
  262.             data or implementation details through this field.
  263.           example: Request took too long to complete.
  264.           type: string
  265.         instance:
  266.           description: |
  267.            An absolute URI that identifies the specific occurrence of the problem.
  268.             It may or may not yield further information if dereferenced.
  269.           format: uri
  270.           type: string
  271.         status:
  272.           description: |
  273.            The HTTP status code generated by the origin server for this occurrence
  274.             of the problem.
  275.           example: 503
  276.           exclusiveMaximum: true
  277.           format: int32
  278.           maximum: 600
  279.           minimum: 100
  280.           type: integer
  281.         title:
  282.           description: |
  283.            A short, summary of the problem type. Written in english and readable
  284.             for engineers (usually not suited for non technical stakeholders and
  285.             not localized); example: Service Unavailable
  286.           type: string
  287.         type:
  288.           default: about:blank
  289.           description: |
  290.            An absolute URI that identifies the problem type.  When dereferenced,
  291.             it SHOULD provide human-readable documentation for the problem type
  292.             (e.g., using HTML).
  293.           format: uri
  294.           type: string
  295.       type: object
  296.   securitySchemes:
  297.       IBM-Client-Secret:
  298.         type: apiKey
  299.         description: ''
  300.         name: X-IBM-Client-Secret
  301.         in: header
  302.       IBM-Client-Id:
  303.         type: apiKey
  304.         description: ''
  305.         name: X-IBM-Client-Id
  306.         in: header
  307.  
  308.   headers:
  309.     Retry-After:
  310.       description: |-
  311.         Retry contacting the endpoint *at least* after seconds.
  312.         See https://tools.ietf.org/html/rfc7231#section-7.1.3
  313.       schema:
  314.         type: string
  315.     WWW-Authenticate:
  316.       description: |-
  317.         Auth realm=APIkey
  318.         See https://tools.ietf.org/html/rfc7235#section-4.1
  319.       schema:
  320.         type: string
  321.     X-RateLimit-Limit:
  322.       description: The number of allowed requests in the current period
  323.       schema:
  324.         type: string
  325.     X-RateLimit-Remaining:
  326.       description: The number of remaining requests in the current period
  327.       schema:
  328.         type: string
  329.     X-RateLimit-Reset:
  330.       description: The number of seconds left in the current period
  331.       schema:
  332.         type: string
  333.  
  334.   responses:
  335.     400BadRequest:
  336.       content:
  337.         application/problem+json:
  338.           schema:
  339.             $ref: '#/components/schemas/Problem'
  340.       description: Bad Request
  341.     401Unauthorized:
  342.       content:
  343.         application/problem+json:
  344.           schema:
  345.             $ref: '#/components/schemas/Problem'
  346.       headers:
  347.         WWW-Authenticate:
  348.           $ref: '#/components/headers/WWW-Authenticate'
  349.       description: Not authorized
  350.     403Forbidden:
  351.       description: Forbidden
  352.     404NotFound:
  353.       description: Not Found
  354.     429TooManyRequests:
  355.       description: Too many requests
  356.       headers:
  357.         Retry-After:
  358.           $ref: '#/components/headers/Retry-After'
  359.         X-RateLimit-Limit:
  360.           $ref: '#/components/headers/X-RateLimit-Limit'
  361.         X-RateLimit-Remaining:
  362.           $ref: '#/components/headers/X-RateLimit-Remaining'
  363.         X-RateLimit-Reset:
  364.           $ref: '#/components/headers/X-RateLimit-Reset'
  365.     503ServiceUnavailable:
  366.       content:
  367.         application/problem+json:
  368.           schema:
  369.             $ref: '#/components/schemas/Problem'
  370.       description: Service Unavailable
  371.       headers:
  372.         Retry-After:
  373.           $ref: '#/components/headers/Retry-After'
  374.     default:
  375.       description: Unexpected error
  376.  
Add Comment
Please, Sign In to add comment