<html lang="it-it" dir="ltr"><head></head><body># EDD REST API V2 - Prodotti

 Questo documento si riferisce specificamente alla Versione 2 dell'API EDD. [La documentazione per la Versione 1 è qui](https://easydigitaldownloads.com/docs/edd-rest-api-products/).

 L'[API REST EDD](https://easydigitaldownloads.com/docs/edd-rest-api-introduction/) fornisce l'accesso alle informazioni sui prodotti tramite l'endpoint `/products/`. È possibile accedere a più prodotti o a un singolo prodotto.

 **NOTA**: L'endpoint dei prodotti non necessita di una chiave o di un token per visualizzare i prodotti pubblicamente disponibili. Se il tuo prodotto è pubblicamente disponibile sul front-end del tuo sito, è disponibile tramite API senza chiave o token.

 Una query di base per i prodotti si presenta così:

```
https://example.com/edd-api/v2/products/
```

 Un esempio di risposta dei prodotti si presenta così, **note di seguito**:

```
{
    "products": [
        {
            "info": {
                "id": 45,
                "slug": "pdf-test",
                "title": "Test PDF",
                "create_date": "2016-05-23 18:44:51",
                "modified_date": "2016-06-08 17:30:54",
                "status": "publish",
                "link": "https://example.com/?post_type=download&amp;p=45",
                "content": "",
                "excerpt": "",
                "thumbnail": false,
                "category": [
                    {
                        "term_id": 3,
                        "name": "ebook",
                        "slug": "ebooks",
                        "term_group": 0,
                        "term_taxonomy_id": 3,
                        "taxonomy": "download_category",
                        "description": "",
                        "parent": 0,
                        "count": 2,
                        "filter": "raw",
                        "object_id": 45
                    }
                ],
                "tags": [
                    {
                        "term_id": 7,
                        "name": "pdf",
                        "slug": "pdf",
                        "term_group": 0,
                        "term_taxonomy_id": 7,
                        "taxonomy": "download_tag",
                        "description": "",
                        "parent": 0,
                        "count": 1,
                        "filter": "raw",
                        "object_id": 45
                    }
                ],
                "sku": "AAMAM2016"
            },
            "stats": {
                "total": {
                    "sales": "0",
                    "earnings": "0.00"
                },
                "monthly_average": {
                    "sales": "0",
                    "earnings": "0.00"
                }
            },
            "pricing": {
                "amount": "1.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "https://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "",
            "licensing": {
                "enabled": false,
                "version": "",
                "exp_unit": "days",
                "exp_length": ""
            }
        },
        {
            "info": {
                "id": 42,
                "slug": "variable-license",
                "title": "Licenza variabile",
                "create_date": "2016-05-20 22:21:38",
                "modified_date": "2016-05-23 17:32:47",
                "status": "publish",
                "link": "https://example.com/?post_type=download&amp;p=42",
                "content": "",
                "excerpt": "",
                "thumbnail": false,
                "category": false,
                "tags": false,
                "sku": "-"
            },
            "stats": {
                "total": {
                    "sales": "0",
                    "earnings": "0.00"
                },
                "monthly_average": {
                    "sales": "0",
                    "earnings": "0.00"
                }
            },
            "pricing": {
                "monthly": "10.00",
                "yearly": "120.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "https://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "",
            "licensing": {
                "enabled": true,
                "version": "",
                "exp_unit": "days",
                "exp_length": ""
            }
        },
        {
            "info": {
                "id": 17,
                "slug": "i-am-pippin-williamson-and-so-can-you",
                "title": "Sono Pippin Williamson, e puoi esserlo anche tu",
                "create_date": "2016-05-17 14:03:50",
                "modified_date": "2016-06-02 19:51:17",
                "status": "publish",
                "link": "https://example.com/?post_type=download&amp;p=17",
                "content": "Questo è un test",
                "excerpt": "",
                "thumbnail": false,
                "category": [
                    {
                        "term_id": 3,
                        "name": "ebook",
                        "slug": "ebooks",
                        "term_group": 0,
                        "term_taxonomy_id": 3,
                        "taxonomy": "download_category",
                        "description": "",
                        "parent": 0,
                        "count": 2,
                        "filter": "raw",
                        "object_id": 17
                    }
                ],
                "tags": false,
                "sku": "-"
            },
            "stats": {
                "total": {
                    "sales": "4",
                    "earnings": "78.000000"
                },
                "monthly_average": {
                    "sales": "4",
                    "earnings": "78.000000"
                }
            },
            "pricing": {
                "amount": "20.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "https://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "Questa è la mia nota di download!",
            "licensing": {
                "enabled": false,
                "version": "",
                "exp_unit": "",
                "exp_length": ""
            }
        },
    ],
    "request_speed": 0.0075628757476807
}
```

 Se gli SKU sono attivati, ma il campo è vuoto, verrà visualizzato un trattino, come nel secondo prodotto dell'esempio sopra.

### Filtrare i Prodotti

##### Prodotti Specifici

 Se desideri recuperare informazioni solo per un prodotto specifico, puoi passare un ID prodotto tramite il parametro *product*:

```
https://example.com/edd-api/v2/products/?product=55
```

##### Ricerca

 Se desideri cercare un prodotto, puoi passare una frase di ricerca tramite il parametro `s`:

```
https://example.com/edd-api/v2/products/?s=PDF
```

##### Tag e Categorie

 Puoi restringere la tua ricerca utilizzando le parole chiave category e tag, seguite da uno slug o un ID. Alcuni esempi:

```
https://example.com/edd-api/v2/products/?category=ebooks
```

```
https://example.com/edd-api/v2/products/?category=3
```

```
https://example.com/edd-api/v2/products/?tag=pdf
```

```
https://example.com/edd-api/v2/products/?tag=42
```

 Esempio combinato:

```
https://example.com/edd-api/v2/products/?category=ebooks&amp;tag=pdf
```</body></html>