Sample code for 30+ languages & platforms
Rust

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat Rust Downloads

Rust

let rest = chilkat::Rest::new();

let _ = rest.set_auth_basic("SHOPIFY_PRIVATE_API_KEY", "SHOPIFY_PRIVATE_API_SECRET_KEY");

if rest.connect("chilkat.myshopify.com", 443, true, true).is_err() {
    println!("{}", rest.last_error_text());
    return;
}

let sb_response = chilkat::StringBuilder::new();
if rest.full_request_no_body_sb("DELETE", "/admin/products/#{id}.json", &sb_response).is_err() {
    println!("{}", rest.last_error_text());
    return;
}

if rest.response_status_code() != 200 {
    println!("Received error response code: {}", rest.response_status_code());
    println!("Response body:");
    println!("{}", sb_response.get_as_string().unwrap_or_default());
    return;
}

println!("Example Completed.");