Updating the supplier product variant details

I’ve been speaking to Calum about how to update cost prices for particular product variants now that we have more complicated supplier integration in Veeqo.

I managed to get it to work successfully by POSTing to: https://api.veeqo.com/supplier_product_variants

The JSON data structure is as follows:

{
	"supplier_product_variant": {
		"product_variant_id": ":variant_id",
		"supplier_id": "supplier_id",
		"cost": "cost_price",
		"reference_number": "reference_number"
	}
}

I just realised that I could update the reference number via the API which is awesome and so added that in. I presume we can use this as a field for the supplier code we have for this particular product?

Also, I can see some extra data in the endpoint, like “default_supplier” - are we able to push a “true” or “false” up to this? Or is this not advised?

Wasn’t sure how to categorise this as it’s a different endpoint. Having great fun playing with the API! :smiley:

1 Like

I’d give default_supplier a go but be prepared for some unexpected behaviour. There a reason why these end points are undocumented at the moment!

Let me know how you get on!

I would like to update the cost prices for products variants via API. Is this a valid way to update the product cost price? Is there a way to find some documentation on this endpoint?

Hey @neo_kit.

There’s no documentation on this part of the API I don’t think, we were told we are able to post to it but it’s not a supported endpoint! We didn’t do the “default_supplier” work in the end, and just pushed up cost prices and it works as expected.

You just need to get the correct product variant ID, and post an array up to https://api.veeqo.com/supplier_product_variants:
$fields[‘product_variant_id’] = $variantId;
$fields[‘supplier_id’] = $supplierId;
$fields[‘cost’] = $cost;
$fields[‘reference_number’] = $supplierRef;

this endpoint is not working anymore is it ?

Hi, @marhyno.
I’ve tested this endpoint and I can confirm it does in fact still return information.

I’d suggest making a response similar to this, to see what the response body is:
https://api.veeqo.com/supplier_product_variants?page_size=1

I would say, The current response structure is different to the example given above.

Kris.