Sample code for 30+ languages & platforms
Delphi ActiveX

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
rest: TChilkatRest;
sbResponse: TChilkatStringBuilder;

begin
success := 0;

rest := TChilkatRest.Create(Self);

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

success := rest.Connect('chilkat.myshopify.com',443,1,1);
if (success <> 1) then
  begin
    Memo1.Lines.Add(rest.LastErrorText);
    Exit;
  end;

sbResponse := TChilkatStringBuilder.Create(Self);
success := rest.FullRequestNoBodySb('DELETE','/admin/products/#{id}.json',sbResponse.ControlInterface);
if (success <> 1) then
  begin
    Memo1.Lines.Add(rest.LastErrorText);
    Exit;
  end;

if (rest.ResponseStatusCode <> 200) then
  begin
    Memo1.Lines.Add('Received error response code: ' + IntToStr(rest.ResponseStatusCode));
    Memo1.Lines.Add('Response body:');
    Memo1.Lines.Add(sbResponse.GetAsString());
    Exit;
  end;

Memo1.Lines.Add('Example Completed.');
end;