Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-7098

Headless Delivery Cart APIs - Cannot set custom fields

Details

    Description

      Issue description:

      We're not able to set custom fields through the POST/PATCH APIs:

      POST /o/headless-commerce-delivery-cart/v1.0/carts/:cartId
      PATCH /o/headless-commerce-delivery-cart/v1.0/carts/:cartId

      this seems related to the rest-openapi.yaml where property "customFields" of model "Cart" is declared as "readonly".

      Steps to reproduce:

      create a new custom field (input field) named "testField", for Commerce Order entity

      create a new site based on Speedwell Accelerator

      create a new user with the minimum required fields (no roles/organizations/user groups assigned to it)

      create a new Commerce Account (Personal) and associate it to the user created before

      with Postman (or any other http client) invoke this API authenticating it with the user created before

      curl --location --request POST 'http://localhost:8080/o/headless-commerce-delivery-cart/v1.0/channels/40046/carts' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Basic bXJvc3NpOjAwMDAwMDAw' \
      --header 'Cookie: COOKIE_SUPPORT=true; GUEST_LANGUAGE_ID=en_US; JSESSIONID=737A350A843ECC45D46E04D6EC949872' \
      --data-raw '{
      "accountId": "44323",
      "billingAddress": null,
      "billingAddressId": 0,
      "couponCode": null,
      "currencyCode": "EUR",
      "cartItems": [
      
      ],
      "customFields": {
      "testField": "test"
      },
      "notes": [],
      "orderTypeId": 0,
      "paymentMethod": null,
      "printedNote": null,
      "shippingAddress": null,
      "shippingAddressId": 0,
      "shippingMethod": null,
      "shippingOption": null,
      "useAsBilling": true
      }'
      

      go to Order Management - Orders section of control panel and check the tab "Custom fields" of the newly created order. The custom field "testField" is empty and not filled with the value "test" passed in the API call.

      Master: 6a8dfd1ee8958aab2bc6d86a5cfdda718072a99f

      Attachments

        Issue Links

          Activity

            People

              andrea.sbarra Andrea Sbarra
              il.kim Brian I. Kim
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Packages

                  Version Package
                  7.3.X
                  7.4 DXP U4