Sample code for 30+ languages & platforms
Visual FoxPro

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loRest
LOCAL loSbResponse

lnSuccess = 0

loRest = CreateObject('Chilkat.Rest')

loRest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_SECRET_KEY")

lnSuccess = loRest.Connect("chilkat.myshopify.com",443,1,1)
IF (lnSuccess <> 1) THEN
    ? loRest.LastErrorText
    RELEASE loRest
    CANCEL
ENDIF

loSbResponse = CreateObject('Chilkat.StringBuilder')
lnSuccess = loRest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",loSbResponse)
IF (lnSuccess <> 1) THEN
    ? loRest.LastErrorText
    RELEASE loRest
    RELEASE loSbResponse
    CANCEL
ENDIF

IF (loRest.ResponseStatusCode <> 200) THEN
    ? "Received error response code: " + STR(loRest.ResponseStatusCode)
    ? "Response body:"
    ? loSbResponse.GetAsString()
    RELEASE loRest
    RELEASE loSbResponse
    CANCEL
ENDIF

? "Example Completed."

RELEASE loRest
RELEASE loSbResponse