downloadable_purchase

Description

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.

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, effectively allowing the customer to download the item again within the configured limits.
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
number_of_downloads The number of times the customer attempted to download this item. This is useful for fine tuning your downloadables settings. Integer Read only
first_download_time The time of the first download attempt by the customer. This is useful for fine tuning your downloadables settings. Date Read only
download_passcode This is the passcode for downloading this item after a purchase. To construct the download link, use https://<store_domain>.foxycart.com/dl?p=<download_passcode> String Read only
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api-sandbox.foxycart.com/downloadable_purchases/362",
            "title": "This Downloadable Purchase"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/66",
            "title": "This Store"
        },
        "fx:customer": {
            "href": "https://api-sandbox.foxycart.com/customers/47866",
            "title": "This Customer"
        },
        "fx:transaction": {
            "href": "https://api-sandbox.foxycart.com/transactions/3842428",
            "title": "This Transaction"
        },
        "fx:item": {
            "href": "https://api-sandbox.foxycart.com/items/5613426",
            "title": "This Item"
        },
        "fx:downloadable": {
            "href": "https://api-sandbox.foxycart.com/downloadables/15",
            "title": "This Downloadable"
        }
    },
    "number_of_downloads": 0,
    "first_download_time": null,
    "download_passcode": "QYLKcnhe9Q1nklCXRQJLFTpZxDLKgSX2HAG",
    "date_created": null,
    "date_modified": null
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api-sandbox.foxycart.com/downloadable_purchases/362" rel="https://api.foxycart.com/rels/downloadable_purchase">
  <link rel="self" href="https://api-sandbox.foxycart.com/downloadable_purchases/362" title="This Downloadable Purchase"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api-sandbox.foxycart.com/stores/66" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/customer" href="https://api-sandbox.foxycart.com/customers/47866" title="This Customer"/>
  <link rel="https://api.foxycart.com/rels/transaction" href="https://api-sandbox.foxycart.com/transactions/3842428" title="This Transaction"/>
  <link rel="https://api.foxycart.com/rels/item" href="https://api-sandbox.foxycart.com/items/5613426" title="This Item"/>
  <link rel="https://api.foxycart.com/rels/downloadable" href="https://api-sandbox.foxycart.com/downloadables/15" title="This Downloadable"/>
  <number_of_downloads>0</number_of_downloads>
  <first_download_time></first_download_time>
  <download_passcode>QYLKcnhe9Q1nklCXRQJLFTpZxDLKgSX2HAG</download_passcode>
  <date_created></date_created>
  <date_modified></date_modified>
</resource>
{
    "class": [
        "downloadable_purchase"
    ],
    "properties": {
        "number_of_downloads": 0,
        "first_download_time": null,
        "download_passcode": "QYLKcnhe9Q1nklCXRQJLFTpZxDLKgSX2HAG",
        "date_created": null,
        "date_modified": null
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api-sandbox.foxycart.com/downloadable_purchases/362"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api-sandbox.foxycart.com/stores/66"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/customer"
            ],
            "href": "https://api-sandbox.foxycart.com/customers/47866"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/transaction"
            ],
            "href": "https://api-sandbox.foxycart.com/transactions/3842428"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/item"
            ],
            "href": "https://api-sandbox.foxycart.com/items/5613426"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/downloadable"
            ],
            "href": "https://api-sandbox.foxycart.com/downloadables/15"
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.