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
urlStringSource URL of a url-type link. Absent on a file-type purchase.
fileStringStored path of a file-type link. Absent on a url-type purchase.
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)
orderStringPath of the order, e.g. /api/shop/customer-orders/384. Not a nested object.
customerStringPath of the owning customer.
downloadUrlStringAbsolute URL of the download route. It needs both auth headers, so it is a request URL rather than a shareable link.
createdAtDateTimePurchase creation date
updatedAtDateTimePurchase last update date

cURL Example

bash
curl -X GET "https://api-demo.bagisto.com/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.