How can i pass this json through my app proxy into liquid

Hey,

I would like to pass through this json from my app proxy into liquid through my app extension, how can I do this…

[
  {
    "cost": {
      "totalAmount": {
        "amount": "49.9",
        "currencyCode": "GBP"
      },
      "subtotalAmount": {
        "amount": "49.9",
        "currencyCode": "GBP"
      },
      "amountPerQuantity": {
        "amount": "24.95",
        "currencyCode": "GBP"
      }
    },
    "quantity": 2,
    "merchandise": {
      "id": "gid://shopify/ProductVariant/49647205548366",
      "image": {
        "url": "https://cdn.shopify.com/s/files/1/0869/1928/3022/files/snowboard_wax.png?v=1730156104"
      },
      "price": {
        "amount": "24.95",
        "currencyCode": "GBP"
      },
      "title": "Selling Plans Ski Wax",
      "product": {
        "title": "Selling Plans Ski Wax"
      }
    }
  },
  {
    "cost": {
      "totalAmount": {
        "amount": "885.95",
        "currencyCode": "GBP"
      },
      "subtotalAmount": {
        "amount": "885.95",
        "currencyCode": "GBP"
      },
      "amountPerQuantity": {
        "amount": "885.95",
        "currencyCode": "GBP"
      }
    },
    "quantity": 1,
    "merchandise": {
      "id": "gid://shopify/ProductVariant/49807067939150",
      "image": {
        "url": "https://cdn.shopify.com/s/files/1/0869/1928/3022/files/Logos_Black_OTB.png?v=1732199538"
      },
      "price": {
        "amount": "885.95",
        "currencyCode": "GBP"
      },
      "title": "Test",
      "product": {
        "title": "The Minimal Snowboard"
      }
    }
  },
  {
    "cost": {
      "totalAmount": {
        "amount": "949.95",
        "currencyCode": "GBP"
      },
      "subtotalAmount": {
        "amount": "949.95",
        "currencyCode": "GBP"
      },
      "amountPerQuantity": {
        "amount": "949.95",
        "currencyCode": "GBP"
      }
    },
    "quantity": 1,
    "merchandise": {
      "id": "gid://shopify/ProductVariant/49647205089614",
      "image": {
        "url": "https://cdn.shopify.com/s/files/1/0869/1928/3022/files/snowboard_purple_hydrogen.png?v=1730156104"
      },
      "price": {
        "amount": "949.95",
        "currencyCode": "GBP"
      },
      "title": "Default Title",
      "product": {
        "title": "The Inventory Not Tracked Snowboard"
      }
    }
  }
]

Not sure if i got it right, but if you wanna fetch this data on frontend side from your app using the theme extension than you can use either the app-metafield or just hit an api on app side using proxy.

On the app side you can do this for proxy request if you need access to admin stuff.
const { admin, session } = await authenticate.public.appProxy(request);

Yeah sorry just got it, took a bit of getting used to with there liquid object you can pass back to the frontend but got hang off it in end :slight_smile:

2 Likes