Sample code for 30+ languages & platforms
Objective-C

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat Objective-C Downloads

Objective-C
#import <CkoRest.h>
#import <CkoStringBuilder.h>

BOOL success = NO;

CkoRest *rest = [[CkoRest alloc] init];

[rest SetAuthBasic: @"SHOPIFY_PRIVATE_API_KEY" password: @"SHOPIFY_PRIVATE_API_SECRET_KEY"];

success = [rest Connect: @"chilkat.myshopify.com" port: [NSNumber numberWithInt: 443] tls: YES autoReconnect: YES];
if (success != YES) {
    NSLog(@"%@",rest.LastErrorText);
    return;
}

CkoStringBuilder *sbResponse = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"DELETE" uriPath: @"/admin/products/#{id}.json" sb: sbResponse];
if (success != YES) {
    NSLog(@"%@",rest.LastErrorText);
    return;
}

if ([rest.ResponseStatusCode intValue] != 200) {
    NSLog(@"%@%d",@"Received error response code: ",[rest.ResponseStatusCode intValue]);
    NSLog(@"%@",@"Response body:");
    NSLog(@"%@",[sbResponse GetAsString]);
    return;
}

NSLog(@"%@",@"Example Completed.");