Sample code for 30+ languages & platforms
Go

Shopify Delete Product

See more Shopify Examples

Delete a product from the shop.

Chilkat Go Downloads

Go
    success := false

    rest := chilkat.NewRest()

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

    success = rest.Connect("chilkat.myshopify.com",443,true,true)
    if success != true {
        fmt.Println(rest.LastErrorText())
        rest.DisposeRest()
        return
    }

    sbResponse := chilkat.NewStringBuilder()
    success = rest.FullRequestNoBodySb("DELETE","/admin/products/#{id}.json",sbResponse)
    if success != true {
        fmt.Println(rest.LastErrorText())
        rest.DisposeRest()
        sbResponse.DisposeStringBuilder()
        return
    }

    if rest.ResponseStatusCode() != 200 {
        fmt.Println("Received error response code: ", rest.ResponseStatusCode())
        fmt.Println("Response body:")
        fmt.Println(*sbResponse.GetAsString())
        rest.DisposeRest()
        sbResponse.DisposeStringBuilder()
        return
    }

    fmt.Println("Example Completed.")

    rest.DisposeRest()
    sbResponse.DisposeStringBuilder()