Skip to main content

Notifications

Supply chain | Supply Chain Management, Commerce
Unanswered

Create a Cart using postman

Posted on by 40

Hi experts,

I need to create a new Cart using postman, and I receive this error, 

pastedimage1669576067193v1.png

I'm using the USRT organisation because I'm in test phase, I need to create a new transaction in D365 Commerce using postman, I find the AddcartLines  here https://learn.microsoft.com/en-us/dynamics365/commerce/dev-itpro/retail-server-customer-consumer-api#cart-controller  but before to addcartLine I need to create a new Cart.

is there a way to do this using postman ?

Best regards

  • Suggested answer
    Create a Cart using postman
    Hi Ghofrane,
     
    I'm doing the same testings than you this days with the same contoso database.
    I've receive the same shift validation error, and I suppose there are no shift open in this store.
    For the moment I have resolve this using a online store instead physical store, because I have suppose that a shift have no sense in a online-store.
     
    You have to specify OUN in the headers with the identification of a online-store:
     
     
    In the Json body I have put the following:
    {
        "Id": "",
        "CartTypeValue": 2,
        "CartLines": [
            {        
            "ItemId": "0003",
            "ProductId": 22565421965,
            "Quantity": 1        
            }
            ]
    }
     
    doing this I've get a response with the new cart created. But I have seen that cart lines are empty in the response:
     
     
    I have try to create lines to this cart with the function API "AddCartLines" but I have no lucky. 
    I allways receipt a response with "malformed request" error:
     
     
    If you have resolve the creation of the cart adding some lines, can you explain me how you achieve this, please?
     
     
  • Charlotte X Profile Picture
    Charlotte X on at
    RE: Create a Cart using postman

    Hi Ghofrane,

    Please wait for someone with relevant development experience to answer this question.

    Best Regards,

    Charlotte

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans