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

Full store_full_access
Read transactions_read
Write transactions_write

Actions

GET View a downloadable purchase
POST Reset the download usage for a downloadable purchase. This will set number_of_downloads to 0 and first_download_time to null.
HEAD Get just the header response
OPTIONS Get a response explaining which HTTP methods are supported

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://.foxycart.com/dl?p=

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:store GET PATCH PUT DELETE This Store
fx:customer GET PATCH PUT DELETE This Customer
fx:transaction GET PATCH PUT POST This Transaction
fx:item GET PATCH PUT DELETE This Item
fx:downloadable GET PATCH PUT DELETE This Downloadable
fx:reset_usage Reset Usage
fx:download_url GET Downloadable URL

Only present when the download is available (within download count and time limits).

https://api.foxycart.com/downloadable_purchases/{id}
Available via fx:downloadable_purchase on item

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
}