downloadable_purchase
Collection: downloadable_purchases
When a downloadable item is purchased, a downloadable purchase resource is created. This includes the download_passcode needed by the customer to retrieve their downloadable item. It also shows how many downloads of this item have taken place and when the first download happened.
You can use the POST method to reset the download usage for a downloadable purchase. This is useful when you want to allow a customer to download an item again, for example after resolving a technical issue or as a customer service gesture. The POST request requires no parameters and will reset both number_of_downloads and first_download_time to their initial values.
Required Scopes
store_full_access transactions_read transactions_write Actions
Properties (5)
number_of_downloads Number · Read-only The number of times the customer attempted to download this item. This is useful for fine tuning your downloadables settings.
first_download_time String (nullable) · Read-only The time of the first download attempt by the customer. This is useful for fine tuning your downloadables settings.
download_passcode String · Read-only This is the passcode for downloading this item after a purchase. To construct the download link, use https://
date_created String (nullable) · Read-only The date this resource was created.
date_modified String (nullable) · Read-only The date this resource was last modified.
Link Relations (8)
self This Downloadable Purchase fx:reset_usage Reset Usage fx:download_url GET Downloadable URL Only present when the download is available (within download count and time limits).
Example Representation
{
"_links": {
"curies": [
{
"name": "fx",
"href": "https://api.foxycart.com/rels/{rel}",
"templated": true
}
],
"self": {
"href": "https://api.foxycart.com/downloadable_purchases/123",
"title": "This Downloadable Purchase"
},
"fx:store": {
"href": "https://api.foxycart.com/stores/456",
"title": "This Store"
},
"fx:customer": {
"href": "https://api.foxycart.com/customers/789",
"title": "This Customer"
},
"fx:transaction": {
"href": "https://api.foxycart.com/transactions/999",
"title": "This Transaction"
},
"fx:item": {
"href": "https://api.foxycart.com/items/999",
"title": "This Item"
},
"fx:downloadable": {
"href": "https://api.foxycart.com/downloadables/999",
"title": "This Downloadable"
},
"fx:reset_usage": {
"href": "https://api.foxycart.com/downloadable_purchases/123",
"title": "Reset Usage"
}
},
"number_of_downloads": 0,
"first_download_time": null,
"download_passcode": "QYLKcnhe9Q1nklCXRQJLFTpZxDLKgSX2HAG",
"date_created": null,
"date_modified": null
}