Utilisez cette API pour trouver des commandes.
Recherche de commandes
Pour consulter les commandes, envoyez une demande GET à :
https://app.digital-downloads.com/api/v1/orders
Pour trouver des commandes, vous pouvez ajouter des paramètres de chaîne de requête. Les résultats sont paginés. Utiliser le paramètre de la chaîne de requête page
pour plus de pages, ou utilisez les liens fournis dans la réponse.
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)
}
Réponse
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
}
}
Visualiser une commande
Pour visualiser une commande individuelle, chargez les actifs liés en option. Envoyez une demande GET à :
https://app.digital-downloads.com/api/v1/orders/:id
Exemple
https://app.digital-downloads.com/api/v1/orders/82664d96-6dfd-4343-aaaa-05c46f412a5b?with_assets=1
Réponse
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"
}
]
}
]
}