Utilizzare questa API per trovare gli ordini.
Ricerca ordini
Per visualizzare gli ordini, inviare una richiesta GET a:
https://app.digital-downloads.com/api/v1/orders
Per trovare gli ordini, è possibile aggiungere parametri di query string. I risultati sono paginati. Utilizzare il parametro stringa di query page
per altre pagine, oppure utilizzare i link forniti nella risposta.
JSON
{
"limit": 100, // max of 1000 will be retuned
"page": 2,
"order_number": 1050,
"with_assets": true // show assets directly attached to the order
// (not assets attached to the products in the order)
}
Risposta
JSON
{
"data": {
"id": "82664d96-6dfd-4343-aaaa-05c46f412a5b",
"order_number": 1050,
"email_sent_at": 1673214647,
"ordered_at": 1673214646,
"assets": [
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5b",
"filename": "My new book",
"size": "10MB",
"is_file": false,
"is_link": true,
"url": "https://www.my-website.com/download/my-book.pdf"
}
]
},
"links": {
"first": "https://app.digital-downloads.com/api/v1/orders?page=1",
"last": "https://app.digital-downloads.com/api/v1/orders?page=625",
"prev": null,
"next": "https://app.digital-downloads.com/api/v1/orders?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 625,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=1",
"label": "1",
"active": true
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=2",
"label": "2",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=3",
"label": "3",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=4",
"label": "4",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=5",
"label": "5",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=6",
"label": "6",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=7",
"label": "7",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=8",
"label": "8",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=9",
"label": "9",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=10",
"label": "10",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=624",
"label": "624",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=625",
"label": "625",
"active": false
},
{
"url": "https://app.digital-downloads.com/api/v1/orders?page=2",
"label": "Next »",
"active": false
}
],
"path": "https://app.digital-downloads.com/api/v1/orders",
"per_page": 25,
"to": 25,
"total": 15608
}
}
Visualizza un ordine
Per visualizzare un singolo ordine, caricare facoltativamente gli asset collegati. Inviare una richiesta GET a:
https://app.digital-downloads.com/api/v1/orders/:id
Esempio
https://app.digital-downloads.com/api/v1/orders/82664d96-6dfd-4343-aaaa-05c46f412a5b?with_assets=1
Risposta
JSON
{
"data": [
{
"id": "82664d96-6dfd-4343-aaaa-05c46f412a5b",
"order_number": 1050,
"assets": [
{
"id": "82664d96-6dfd-4343-96b0-05c46f412a5b",
"filename": "My new book",
"size": "10MB",
"is_file": false,
"is_link": true,
"url": "https://www.my-website.com/download/my-book.pdf"
}
]
}
]
}