Sample code for 30+ languages & platforms
C#

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Rest rest = new Chilkat.Rest();

rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY");

success = rest.Connect("chilkat.myshopify.com",443,true,true);
if (success != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

Chilkat.StringBuilder sbResponse = new Chilkat.StringBuilder();
success = rest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",sbResponse);
if (success != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

if (rest.ResponseStatusCode != 200) {
    Debug.WriteLine("Received error response code: " + Convert.ToString(rest.ResponseStatusCode));
    Debug.WriteLine("Response body:");
    Debug.WriteLine(sbResponse.GetAsString());
    return;
}

Debug.WriteLine("Example Completed.");