Skip to content

Get Customer Downloadable Products

Retrieve all downloadable product purchases belonging to the authenticated customer. This is a read-only API — customers can view their purchased downloadable links, check download status, and see remaining downloads.

Endpoint

GET /api/shop/customer-downloadable-products

Request Headers

HeaderValueRequiredDescription
Content-Typeapplication/jsonYesRequest content type
X-STOREFRONT-KEYpk_storefront_xxxYesStorefront API key
AuthorizationBearer {token}YesCustomer authentication token

Response Fields

FieldTypeDescription
idIntegerDownloadable link purchase ID
productNameStringName of the purchased product
nameStringName of the downloadable link
urlString|nullExternal download URL (for URL-type links)
fileString|nullFile path (for file-type links)
fileNameStringDisplay name of the file
typeStringLink type: file or url
downloadBoughtIntegerTotal number of allowed downloads
downloadUsedIntegerNumber of times downloaded
downloadCanceledIntegerNumber of canceled downloads
statusStringPurchase status: available, expired, or pending
remainingDownloadsIntegerComputed remaining downloads (null if unlimited)
customerIdIntegerID of the customer who purchased
orderIdIntegerAssociated order ID
orderItemIdIntegerAssociated order item ID
orderObjectAssociated order details
createdAtDateTimePurchase creation date
updatedAtDateTimePurchase last update date

Status Values

StatusDescription
availableDownload link is active and can be used
pendingOrder has not been invoiced yet; download is not available
expiredAll downloads have been used or the link has expired

cURL Example

bash
curl -X GET "http://localhost:8000/api/shop/customer-downloadable-products" \
  -H "X-STOREFRONT-KEY: pk_storefront_your_key_here" \
  -H "Authorization: Bearer YOUR_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json"

Empty Collection

When the customer has no downloadable product purchases:

json
[]

Notes

  • Read-only API: Only GET operations are available.
  • Customer isolation: Purchases are automatically filtered by the authenticated customer. A customer can never see another customer's purchases.
  • Field naming: REST responses use camelCase field names (e.g., productName, downloadBought, remainingDownloads).
  • Computed field: remainingDownloads is calculated as downloadBought - downloadUsed - downloadCanceled. Returns null for unlimited downloads.

Released under the MIT License.