Dart
Dart
Shopify Delete Product
See more Shopify Examples
Delete a product from the shop.Chilkat Dart Downloads
import 'package:chilkat/chilkat.dart';
void main() {
final rest = CkRest();
rest.setAuthBasic('SHOPIFY_PRIVATE_API_KEY', 'SHOPIFY_PRIVATE_API_SECRET_KEY');
try {
rest.connect('chilkat.myshopify.com', 443, true, true);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
final sbResponse = CkStringBuilder();
try {
rest.fullRequestNoBodySb('DELETE', '/admin/products/#{id}.json', sbResponse);
} on ChilkatException catch (e) {
print(e.lastErrorText);
return;
}
if (rest.responseStatusCode != 200) {
print('Received error response code: ${rest.responseStatusCode}');
print('Response body:');
print(sbResponse.getAsString());
return;
}
print('Example Completed.');
}