Try our conversational search powered by Generative AI!

How to delete a shipment from a cart using content delivery api?

Vote:
 

We are working on a basket page and we are allowing the user to remove line items from any shipment he has in his cart. However, we came across a problem where we can't delete a shipment object using the Cart Edit Content Delivery API.

The api we use is: 

PUT  /api/episerver/v3.0/me/cart

and our shipment array is as follow:

"shipments": [
        {
            "id": -1,
            "shippingAddress": {
                "firstName": "test1",
                "lastName": "test2",
                "line1": "1 Angelica Road",
                "line2": "Kirkby",
                "city": "LIVERPOOL",
                "countryName": "united kingdom",
                "countryCode": "UK",
                "postalCode": "L32 1BQ",
                "regionName": "Merseyside",
                "email": "testUser1@test.com",
                "phoneNumber": "01123456789",
                "name": "72a21f34-cf0d-4358-9aee-164721c559a6"
            },
            "shippingMethodId": "00000000-0000-0000-0000-000000000000",
            "lineItems": []

          }

Is there a way to be able to delete the shipment?

#312886
Edited, Nov 21, 2023 10:45
Quan Mai - Nov 24, 2023 7:06
not really, those are for customer/customer address
Vote:
 

I would suppose that if you get the cart, remove the shipment you want to delete, then PUT it back, it will delete that shipment, although I'm not quite sure

#313048
Nov 24, 2023 7:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.