2

When should I use the PUT /carts/{cartId} when I’m log as a customer to assign a guest cart to the customer https://devdocs.magento.com/redoc/2.3/customer-rest-api.html#operation/quoteCartManagementV1AssignCustomerPut. If I’m trying right after I’ve log in I got a error because the customer already have a cart assign and if I try right after proccess the transaction, I’m getting 404 saying there’s not entity at the cartId

1

When should I use the PUT /carts/{cartId}

This API end point is used when you want edit the cart.

I’m getting 404 saying there’s not entity at the cartId

It means that might be Order is placed on that cart id.

For more resolution please run below API

  • GET /V1/carts/{cartId}

Which will return cart related data.

{
  "id": 0,
  "createdAt": "string",
  "updatedAt": "string",
  "convertedAt": "string",
  "isActive": true,
  "isVirtual": true,
  "items": [
    {
      "itemId": 0,
      "sku": "string",
      "qty": 0,
      "name": "string",
      "price": 0,
      "productType": "string",
      "quoteId": "string",
      "productOption": {
        "extensionAttributes": {
          "customOptions": [
            {
              "optionId": "string",
              "optionValue": "string",
              "extensionAttributes": {
                "fileInfo": {
                  "base64EncodedData": "string",
                  "type": "string",
                  "name": "string"
                }
              }
            }
          ],
          "downloadableOption": {
            "downloadableLinks": [
              0
            ]
          },
          "giftcardItemOption": {
            "giftcardAmount": 0,
            "customGiftcardAmount": 0,
            "giftcardSenderName": "string",
            "giftcardRecipientName": "string",
            "giftcardSenderEmail": "string",
            "giftcardRecipientEmail": "string",
            "giftcardMessage": "string",
            "extensionAttributes": {}
          },
          "configurableItemOptions": [
            {
              "optionId": "string",
              "optionValue": 0,
              "extensionAttributes": {}
            }
          ],
          "bundleOptions": [
            {
              "optionId": 0,
              "optionQty": 0,
              "optionSelections": [
                0
              ],
              "extensionAttributes": {}
            }
          ]
        }
      },
      "extensionAttributes": {}
    }
  ],
  "itemsCount": 0,
  "itemsQty": 0,
  "customer": {
    "id": 0,
    "groupId": 0,
    "defaultBilling": "string",
    "defaultShipping": "string",
    "confirmation": "string",
    "createdAt": "string",
    "updatedAt": "string",
    "createdIn": "string",
    "dob": "string",
    "email": "string",
    "firstname": "string",
    "lastname": "string",
    "middlename": "string",
    "prefix": "string",
    "suffix": "string",
    "gender": 0,
    "storeId": 0,
    "taxvat": "string",
    "websiteId": 0,
    "addresses": [
      {
        "id": 0,
        "customerId": 0,
        "region": {
          "regionCode": "string",
          "region": "string",
          "regionId": 0,
          "extensionAttributes": {}
        },
        "regionId": 0,
        "countryId": "string",
        "street": [
          "string"
        ],
        "company": "string",
        "telephone": "string",
        "fax": "string",
        "postcode": "string",
        "city": "string",
        "firstname": "string",
        "lastname": "string",
        "middlename": "string",
        "prefix": "string",
        "suffix": "string",
        "vatId": "string",
        "defaultShipping": true,
        "defaultBilling": true,
        "extensionAttributes": {},
        "customAttributes": [
          {
            "attributeCode": "string",
            "value": "string"
          }
        ]
      }
    ],
    "disableAutoGroupChange": 0,
    "extensionAttributes": {},
    "customAttributes": [
      {
        "attributeCode": "string",
        "value": "string"
      }
    ]
  },
  "billingAddress": {
    "id": 0,
    "region": "string",
    "regionId": 0,
    "regionCode": "string",
    "countryId": "string",
    "street": [
      "string"
    ],
    "company": "string",
    "telephone": "string",
    "fax": "string",
    "postcode": "string",
    "city": "string",
    "firstname": "string",
    "lastname": "string",
    "middlename": "string",
    "prefix": "string",
    "suffix": "string",
    "vatId": "string",
    "customerId": 0,
    "email": "string",
    "sameAsBilling": 0,
    "customerAddressId": 0,
    "saveInAddressBook": 0,
    "extensionAttributes": {
      "giftRegistryId": 0
    },
    "customAttributes": [
      {
        "attributeCode": "string",
        "value": "string"
      }
    ]
  },
  "reservedOrderId": 0,
  "origOrderId": 0,
  "currency": {
    "globalCurrencyCode": "string",
    "baseCurrencyCode": "string",
    "storeCurrencyCode": "string",
    "quoteCurrencyCode": "string",
    "storeToBaseRate": 0,
    "storeToQuoteRate": 0,
    "baseToGlobalRate": 0,
    "baseToQuoteRate": 0,
    "extensionAttributes": {}
  },
  "customerIsGuest": true,
  "customerNote": "string",
  "customerNoteNotify": true,
  "customerTaxClassId": 0,
  "storeId": 0,
  "extensionAttributes": {}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.