Jump to content

Products - catalog_item_type_id


 Share

Recommended Posts

Hello, 

I hope someone can help me on this.

When I am creating or updating a product via the API   ( https://api.accounting.sage.com/v3.1/products/{key}

Using Body data as per below:-


I am able to update the "Description" successfully but the API seemingly ignores the catalog_item_type_id.

I have validated the PRODUCT is a correct id. I also note the following:-

The syntax for the body in the API Spec states "catalog_item_type_id"  (Products & Services Endpoint Reference | Sage Developer | Accounting)

However, the response file states it as catalog_item_type.

I have tried resubmitting with either id/value and it seemingly ignores either (and doesn't not throw any error, the description updates just fine).

So I know my connection and data is valid (well, the description) but I cannot get the catalog_item_type_id to update.

This behaviour seems to be the same if I am posting a new product or just updating.

Appreciate any help or pointers?

Best Regards

Andrew

Link to comment
Share on other sites

  • Administrators

Hi Andrew,

Thanks a lot for getting in touch. I've been investigating this today and can replicate the behaviour you have found. 

I'll escalate this to be looked at further by the development teams. 

 

It's important to consider the impact of changing the catalog type of a product, especially if it's already a stock item, with quantities recorded. In the UI you will receive a warning when attempting to do this, asking you to consider any existing stock etc. Similar considerations should be applied when doing this via the API (I will investigate our side of validation etc) - are you planning to validate this in your app?

 

Thanks!

 

Ben

Link to comment
Share on other sites

Hi Ben,

Thanks for the reply - I don't actually plan to update the field.

I only went down the path to update the field because my initial insert of catalog_item_type_id was ignored.

So please note, the field seems to be ignored on the "Create Product" (and also, the update.)

Thanks for the cautionary note.

Best Regards

Andrew

Link to comment
Share on other sites

  • Administrators

*Update*

Just so that anyone else looking at this post is made aware,

If you are looking to make a POST request to create a product that should be a STOCK_ITEM, you must use the /stock_items endpoint. This means you don't need to pass a catalog_type_id and it will 100% be a stock item. 

When the endpoints were exposed we have different ones for products and stock items.

The catalog_type_id isn't exposed via the /stock_items endpoint, but you can see the product also via the /products endpoint, which does expose the catalog_type_id and will show a "STOCK_ITEM".

Any questions please reach out,

 

Ben

  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...