How do I set up this view?
Follow the following steps:
Part one:
1. Install Views field view module and REST Export Nested (https://www.drupal.org/project/rest_export_nested)
2. First Create a View filtered by the content type mentioned, selecting Rest Export View.
3. Then Add nid, title and the special field Called "View" https://screencast.com/t/3la2zG6llfi
4. Duplicate this view as Rest Export Nested.



Part two:


Go and create another view filtered by taxonomy terms of your type(Product Availability), selecting Rest Export View.
Add as fields what you want to display for each term. For example, you can add the title of the term, and other fields.


I added 2 fields for example.
3. Add as the relationship the field name which is referenced to the taxonomy (Product Availability) from your content type(Products).
My content type is article and it has field_taxonomy which is a reference to the taxonomy term.
4. The last step on configuring this view is to add a contextual filter: Add "ID" and select to use the relationship created before,
selecting the "Provide default value" and choosing "Content id from URL".

5. Save this view.

Return to the first view created and configure the "View" field as the print screen is showed:
Choose the second view created in the "View " drop-down and o display "rest export". For contextual fields write the {{ raw_fields.nid }} . It will work only if you were added the node id as a field in this view above the "View" field.


The result will be the following:

Node id 1 has 2 field taxonomy terms assigned: "term 1" and "term 2", and in the view object, you can see that there 2 arrays, each array represents a taxonomy term with the fields values.