Open APIs

 View Only
  • 1.  Establish relationship between cart items in POST request

    TM Forum Member
    Posted Jan 24, 2022 07:34
    Hi Experts,

    In Shopping cart, we use cartItemRelationship to establish relationship between various cart items using cart item id.
    During POST, these ids will not be available, as these are internally generated and provided back as part of response, for any further updates using PATCH
    What is the recommendation in such scenarios, if cart items are to be created and establish relationship among them in a single request?
    Can we use any temporary id to achieve this, when cart item id has not been generated yet



    ------------------------------
    Bharathi V

    ------------------------------


  • 2.  RE: Establish relationship between cart items in POST request

    TM Forum Member
    Posted Jan 25, 2022 02:30
    Edited by Ludovic Robert Jan 25, 2022 02:39
    Hello Bharathi
    The use of the word id to identify shoppingCartItem is probably confusing. For me this is more some kind of Index. As ShoppingCartItem are not managed as resource or sub ressource for me it is perfectly valid to value them in a POST request and keep this value in the created resource. In my company, I always recommend this pattern (item id provided in the POST request).
    Hope it helps

    ------------------------------
    Ludovic Robert
    Orange
    My answer are my own & don't represent necessarily my company or the TMF
    ------------------------------