Skip to content

Get Customer Downloadable Products

Retrieve a paginated list of 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.

Query

graphql
query GetCustomerDownloadableProducts {
  customerDownloadableProducts(first: 10) {
    edges {
      cursor
      node {
        _id
        productName
        name
        fileName
        type
        downloadBought
        downloadUsed
        downloadCanceled
        status
        remainingDownloads
        order {
          _id
          incrementId
          status
        }
        createdAt
        updatedAt
      }
    }
    pageInfo {
      endCursor
      startCursor
      hasNextPage
      hasPreviousPage
    }
    totalCount
  }
}

Arguments

ArgumentTypeRequiredDescription
firstIntNoNumber of items to return from the start (default: 10)
lastIntNoNumber of items to return from the end
afterStringNoCursor to start pagination after
beforeStringNoCursor to start pagination before
statusStringNoFilter by status: available, expired, or pending

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
remainingDownloadsIntComputed remaining downloads (null if unlimited)
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

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 "http://localhost:8000/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 { customerDownloadableProducts(first: 10) { edges { cursor node { _id productName name fileName type downloadBought downloadUsed status remainingDownloads createdAt } } pageInfo { endCursor hasNextPage } totalCount } }"
  }'

Notes

  • Read-only API: Only GET / query operations are available.
  • Customer isolation: Purchases are automatically filtered by the authenticated customer. A customer can never see another customer's purchases.
  • Status filtering: Use the status parameter to filter by available, expired, or pending.
  • Cursor pagination: Uses cursor-based pagination. Use first/after for forward pagination and last/before for backward pagination.
  • Computed field: remainingDownloads is calculated as downloadBought - downloadUsed - downloadCanceled. Returns null for unlimited downloads.

Released under the MIT License.