Lua
Lua
Shopify Delete Product
See more Shopify Examples
Delete a product from the shop.Chilkat Lua Downloads
local chilkat = require("chilkat")
local rest = chilkat.Rest.new()
rest:set_auth_basic("SHOPIFY_PRIVATE_API_KEY", "SHOPIFY_PRIVATE_API_SECRET_KEY")
local success = rest:connect("chilkat.myshopify.com", 443, true, true)
if not success then
print(rest.last_error_text)
return
end
local sbResponse = chilkat.StringBuilder.new()
success = rest:full_request_no_body_sb("DELETE", "/admin/products/#{id}.json", sbResponse)
if not success then
print(rest.last_error_text)
return
end
if rest.response_status_code ~= 200 then
print("Received error response code: " .. rest.response_status_code)
print("Response body:")
print(sbResponse:get_as_string())
return
end
print("Example Completed.")