Advertisement
xrobau

Updated Kmart

Mar 13th, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. $postcode = "4680"
  2. $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
  3. $r = Invoke-WebRequest -UseBasicParsing -Uri "https://api.kmart.com.au/gateway/graphql" `
  4. -Method POST `
  5. -WebSession $session `
  6. -UserAgent "undefined" `
  7. -Headers @{
  8. "Accept" = "*/*"
  9. "Accept-Language" = "en-US,en;q=0.5"
  10. "Accept-Encoding" = "gzip, deflate, br, zstd"
  11. "Referer" = "https://www.kmart.com.au/"
  12. "Origin" = "https://www.kmart.com.au"
  13. "Sec-Fetch-Dest" = "empty"
  14. "Sec-Fetch-Mode" = "cors"
  15. "Sec-Fetch-Site" = "same-site"
  16. "Priority" = "u=4"
  17. } `
  18. -ContentType "application/json" `
  19. -Body "{`"operationName`":`"getProductAvailability`",`"variables`":{`"input`":
  20. {`"country`":`"AU`",`"postcode`":`"$postcode`",`"products`":[{`"keycode`":`"43172382`",`"quantity`":1,`"isNationalInventory`":false,`"isClickAndCollectOnly`":false}],`"fulfilmentMethods`":[`"HOME_DELIVERY`",`"CLICK_AND_COLLECT`"]}},`"query`":`"query getProductAvailability(`$input: ProductAvailabilityQueryInput!) {\n getProductAvailability(input: `$input) {\n postcode\n country\n availability {\n HOME_DELIVERY {\n keycode\n poolName\n stock {\n available\n __typename\n }\n __typename\n }\n CLICK_AND_COLLECT {\n keycode\n stock {\n totalAvailable\n __typename\n }\n locations {\n fulfilment {\n isBuddyLocation\n locationId\n stock {\n available\n __typename\n }\n __typename\n }\n location {\n locationId\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n`"}"
  21. $o = $r.Content | ConvertFrom-Json
  22.  
  23. $o.data.getProductAvailability.postcode
  24. $o.data.getProductAvailability.availability.HOME_DELIVERY | ConvertTo-Json
  25. $o.data.getProductAvailability.availability.CLICK_AND_COLLECT | ConvertTo-Json
  26.  
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement