> For the complete documentation index, see [llms.txt](https://docs.opencityitalia.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opencityitalia.it/stanza-del-cittadino/sviluppatori-e-partner-tecnologici/integrazioni/processi-asincroni-job/importazione-dovuti.md).

# Importazione dovuti

In questa pagina viene fornito un esempio di chiamata API per l'importazione dovuti

Come descritto nella sezione precedente tramite le API dei jobs è possibile creare un processo di importazione dovuti.

{% hint style="warning" %}
Per poter procedere correttamente all'importazione bisogna prima creare un servizio a cui i dovuti devono essere collegati.
{% endhint %}

Questa operazione può essere fatta tramite interfaccia nella sezione admin, il servizio creato dovrà essere di tipo **"Servizio di pagamento dovuti"**

<figure><img src="https://2402436129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNwAiDeLoMPCkkp1BdSbI%2Fuploads%2FrX5ftiKlVi8mmLxOSGEY%2FScreenshot%202024-05-31%20alle%2013.27.24.png?alt=media&amp;token=6d62365e-facc-4901-b2b9-39ceba756d82" alt=""><figcaption></figcaption></figure>

Per il servizio appena creato dovrà essere configurato anche il gateway di pagamento

<figure><img src="https://2402436129-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNwAiDeLoMPCkkp1BdSbI%2Fuploads%2FsLP5rcOtWxpOSwQoikbY%2FScreenshot%202024-05-31%20alle%2013.30.45.png?alt=media&amp;token=17c654a6-dcd0-4965-b1b7-0de240a1e3ca" alt=""><figcaption></figcaption></figure>

### Creazione di un Job per l'importazione dovuti

Per poter creare un Job di importazione dovuti bisogna eseguire una chiamata **POST** all' endpoint `api/jobs`

Il payload per la creazione di un Job è così composto

```
{
  "attachment": {
    "name": "dovuti.csv",
    "mime_type": "text/csv",
    "file": "bm90aWNlX251bWJlsYW1vdW50LHJlYXNvbixjcmVhdGVkX2F0LGV4cGlyZV9hdCxjcmV..."
  },
  "args": {
    "service_id": "a5a9bf9f-7b5c-4aed-b020-5bf2d1ca75ab"
  },
  "type": "import_dovuti"
}
```

Dove:

**attachments** -> è il file csv contenente i dovuti da importare

Il file csv deve acere un template specifico di questo tipo:

{% file src="/files/ypXkzU7QDitrdOlNPDD2" %}

**service\_id** -> è un parametro specifico del tipo di job import\_dovuti ed indica su quale servizio devono essere agganciati i dovuti importati


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opencityitalia.it/stanza-del-cittadino/sviluppatori-e-partner-tecnologici/integrazioni/processi-asincroni-job/importazione-dovuti.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
