Skip to content

Get Customer Downloadable Product

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

Query

graphql
query GetCustomerDownloadableProduct {
  customerDownloadableProduct(id: "/api/shop/customer-downloadable-products/1") {
    _id
    productName
    name
    fileName
    type
    downloadBought
    downloadUsed
    downloadCanceled
    status
    downloadUrl
    remainingDownloads
    order {
      _id
      incrementId
      status
      grandTotal
    }
    createdAt
    updatedAt
  }
}

Arguments

ArgumentTypeRequiredDescription
idID!YesThe IRI of the downloadable product purchase (e.g., /api/shop/customer-downloadable-products/1). The numeric ID used in this IRI is the _id field from the Get Downloadable Products query.

Response Fields

FieldTypeDescription
_idIntDownloadable link purchase ID
productNameStringName of the purchased product
nameStringName of the downloadable link
fileNameStringDisplay name of the file
typeStringLink type: file or url
downloadBoughtIntTotal number of allowed downloads
downloadUsedIntNumber of times downloaded
downloadCanceledIntNumber of canceled downloads
statusStringPurchase status: available, expired, or pending
downloadUrlStringDirect REST API URL to download the purchased file. Use this URL with a GET request and customer authentication to download the file. See Download Downloadable Product.
remainingDownloadsIntComputed remaining downloads (null if unlimited)
orderObjectAssociated order details
createdAtDateTimePurchase creation date
updatedAtDateTimePurchase last update date

Request Headers

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

cURL Example

bash
curl -X POST "https://api-demo.bagisto.com/api/graphql" \
  -H "X-STOREFRONT-KEY: pk_storefront_your_key_here" \
  -H "Authorization: Bearer YOUR_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { customerDownloadableProduct(id: \"/api/shop/customer-downloadable-products/1\") { _id productName name fileName type downloadBought downloadUsed status downloadUrl remainingDownloads createdAt } }"
  }'

Error Responses

Item Not Found

json
{
  "errors": [
    {
      "message": "Customer downloadable product with ID \"999\" not found",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["customerDownloadableProduct"]
    }
  ]
}

Notes

  • IRI format: The id argument uses the IRI format /api/shop/customer-downloadable-products/{id}.
  • Customer isolation: A customer can only access their own purchases. Requesting another customer's purchase returns a not found error.
  • Computed field: remainingDownloads is calculated as downloadBought - downloadUsed - downloadCanceled. Returns null for unlimited downloads.

Released under the MIT License.