Skip to content

Get Customer Downloadable Product

Retrieve details of a specific downloadable product purchase by its ID. This is a read-only API — customers can view a single purchased downloadable link, check its download status, and see remaining downloads.

Endpoint

GET /api/shop/customer-downloadable-products/{id}

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesThe downloadable product purchase ID

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

cURL Example

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

Error Responses

Item Not Found (404)

json
{
  "message": "Customer downloadable product with ID \"999\" not found"
}

Accessing Another Customer's Purchase (404)

Requesting a purchase that belongs to a different customer returns the same 404 response, preventing enumeration attacks:

json
{
  "message": "Customer downloadable product with ID \"5\" not found"
}

Notes

  • Customer isolation: A customer can only access their own purchases. Requesting another customer's purchase returns a 404.
  • Computed field: remainingDownloads is calculated as downloadBought - downloadUsed - downloadCanceled. Returns null for unlimited downloads.

Released under the MIT License.