Marketplaces / Tesco (on Marketplacer) / Tesco Technical Scope / Tesco Product Management / Tesco Product Delete

Tesco Product Delete

Version Date Created / Updated Notes
v1.0 Hristiyan Georgiev Initial version

When we are talking about product delete on Tesco we again have to distinguish them by Advert level and Variant level. Tesco allows us to do both operations so we will cover both cases in this scope.

The deletion is not an de-activation but rather full removal of the product from the Tesco backend.

This is pretty much deleting the whole listing along with all variants attached to it. We are not able to delete multiple adverts (we can’t send more than one ID at a time) so we will need to do it listing by listing.

All triggers, validations etc are as per the abstraction for product full removal - Product Listing general requirements

GraphQL Query :

mutation advertDelete($input: AdvertDeleteMutationInput!){
    advertDelete(input: $input)
    {
        status
        errors{
            field
            messages
        }
        advert{
            id
        }
    }
}

Query Variables:

{
    "input": {
        "id": "QWR2ZXJ0LTEwMDA5NTcwOQ=="
    }
}

Variables Mapping :

Integration Field Hemi Mapping Hemi Notes
input
id Product Account > Channel Item ID

Example success response :

{
    "data": {
        "advertDelete": {
            "status": 200,
            "errors": null,
            "advert": {
                "id": "QWR2ZXJ0LTEwMDA5NTcwOQ=="
            }
        }
    }
}

Example error response :

{
    "errors": [
        {
            "message": "No object found for `id: \"VmFyaWFudC0xMDU2NDg=\"`",
            "locations": [
                {
                    "line": 2,
                    "column": 2
                }
            ],
            "path": [
                "advertDelete"
            ]
        }
    ],
    "data": {
        "advertDelete": null
    }
}

We don’t need to map anything from the success response. We just need to remove all Tesco IDs associated with this listing (Product Account > Channel Item ID and Product Account Tesco > Variant ID on all products in the variation) and update the statuses as per the abstraction.

From the error response we want to store the errors > message into Product Account > Update Item Error and update the statuses accordingly per abstraction.

Variant Delete

We have the possibility to delete a single variation from a product as well. Same as the advert delete, we are not able to delete more than one variant at a time so we should send separate calls for each variant.

Since there is not much information about Variant deletion in the abstraction, I will mention the triggers and actions.

The triggers will be : Product Account > Delete Variant = Yes

Product Account > Closed = No

Product Account > Channel Item ID ≠ ‘’

Product Account > Product Status = Product Published

Product Account Tesco > Variant ID ≠ ‘’

Product Account > Variation Group ≠ ‘’

GraphQL Query :

mutation variantDelete($input: VariantDeleteMutationInput!){
    variantDelete(input: $input)
    {
        status
        errors{
            field
            messages
        }
        variant{
            id
            sku
        }
    }
}

Query Variables :

{
    "input": {
        "id": "VmFyaWFudC0xMDU2NDg="
    }
}

Variables Mapping:

Integration Field Hemi Mapping Hemi Notes
input
id Product Account Tesco > Variant ID

Example success response :

{
    "data": {
        "variantDelete": {
            "status": 200,
            "errors": null,
            "variant": {
                "id": "VmFyaWFudC0xMDU2NDg=",
                "sku": "1234561"
            }
        }
    }
}

Example error response :

{
    "errors": [
        {
            "message": "No object found for `id: \"VmFyaWFudC0xMDU2NDg\"`",
            "locations": [
                {
                    "line": 2,
                    "column": 2
                }
            ],
            "path": [
                "variantDelete"
            ]
        }
    ],
    "data": {
        "variantDelete": null
    }
}

We don’t need to map anything from the success response. We just need to remove all Tesco IDs associated with this variant (Product Account > Channel Item ID and Product Account Tesco > Variant ID) and update the product statuses : Product Account > Listing Status = Inactive and Product Account > Product Status = Product Removed

From the error response we want to store the errors > message into Product Account > Update Item Error and set the Product Account > List/Update the whole item = Error

Is this article helpful?
0 0 0