Marketplaces / Tesco (on Marketplacer) / Tesco Technical Scope / Tesco Product Management / Tesco Stock Update

Tesco Stock Update

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

The stock update is done variant by variant and we don’t have the option to do bulk stock updates.

All triggers, validations etc are as per abstration - Stock Update general requirements

GraphQL Query :

mutation VariantUpdate($input: VariantUpdateMutationInput!) {
    variantUpdate(input: $input) {
        variant {
          id
            displayable        
        }
        errors {
            field
            messages
        }
    }
}

Query Variables :

{
    "input": {
        "variantId": "VmFyaWFudC0xMDU2MTA=", 
        "attributes": {
            "countOnHand": 0
        }
    }
}

Variables Mapping :

Integration Field Hemi Mapping Hemi Notes
input
variantId Product Account Tesco > Variant ID
attributes
countOnHand Product Account > Quantity

Example Success Response :

{
    "data": {
        "variantUpdate": {
            "variant": {
                "id": "VmFyaWFudC0xMDU2NDI=",
                "displayable": true
            },
            "errors": null
        }
    }
}

Example Error Response :

{
    "data": {
        "variantUpdate": {
            "variant": null,
            "errors": [
                {
                    "field": "count_on_hand",
                    "messages": [
                        "must be greater than or equal to 0"
                    ]
                }
            ]
        }
    }
}

We don’t need to map anything from the success response.If we have errors want to concatenate the field and messages and store the error message as per the abstraction Product Listing general requirements

Is this article helpful?
0 0 0