Magento 2 How to get purchased customer’s downloadable products using GraphQL

In this article we will show you how to get purchased customer's downloadable products using GraphQL. Use the customerDownloadableProducts query to retrieve the list of purchased downloadable products for logged in customer.

Syntax

saveCopyzoom_out_map
{
  customerDownloadableProducts {
    CustomerDownloadableProducts
  }
}

The following query returns the list of purchased downloadable products for logged in customer.

Request

saveCopyzoom_out_map
{
  customerDownloadableProducts {
    items {
      date
      download_url
      order_increment_id
      remaining_downloads
      status
    }
  }
}

Response

saveCopyzoom_out_map
{
  "data": {
    "customerDownloadableProducts": {
      "items": [
        {
          "date": "2020-07-15 09:57:54",
          "download_url": "https://domain.com/downloadable/download/link/id/MC40MDc0MjcwMCAxNTk1NTg0Njc0MTM1Mg%2C%2C/",
          "order_increment_id": "000000003",
          "remaining_downloads": "Unlimited",
          "status": "pending"
        },
        {
          "date": "2020-07-15 09:57:54",
          "download_url": "https://domain.com/downloadable/download/link/id/MC40NDA1ODQwMCAxNTk1NTg0Njc0MjQ0Nw%2C%2C/",
          "order_increment_id": "000000003",
          "remaining_downloads": "Unlimited",
          "status": "pending"
        }
      ]
    }
  }
}

That's it!!

If you are looking for more GraphQL solutions then check out our another article which is List of GraphQL Queries and Mutations for Magento 2.

I hope this article helps you to find what you were looking for.

Bookmark it for your future reference. Do comment below if you have any other questions on that.

P.S. Do share this article with your team.




Recent Articles
Tags
Newsletter
Copyright © 2023 devhooks.in All rights reserved.
Ads OFF toggle_off
wifi_off