magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Unable to create order with configurable product using salesOrderRepositoryV1 rest api #20440

Closed nareshjiva closed 3 years ago

nareshjiva commented 5 years ago

HI Team

Preconditions (*)

1.Magento 2.3.0

Steps to reproduce (*)

  1. Install Magento with sample Data
  2. Place order using rest for configrble product

Expected result (*)

  1. order has to be placed for child along with custom options https://www.screencast.com/t/CC8k0GD8H07

Actual result (*)

  1. it's not displaying selected options in line item
  2. https://www.screencast.com/t/nLqy17ot7XNj here is the data i used
{
  "entity": {
    "base_currency_code": "EUR",
    "base_discount_amount": 0,
    "base_grand_total": 38,
    "base_shipping_amount": 5,
    "base_shipping_incl_tax": 5,
    "base_shipping_tax_amount": 0,
    "base_shipping_discount_amount": 0,
    "base_subtotal": 33,
    "base_subtotal_incl_tax": 33,
    "base_total_due": 0,
    "base_total_paid" : 38,
    "base_to_global_rate": 1,
    "base_to_order_rate": 1,
    "discount_tax_compensation_amount": 0,
    "base_discount_tax_compensation_amount": 0,
    "shipping_discount_tax_compensation_amount": 0,
    "customer_is_guest": 0,
    "customer_email": "nicola@gmail.com",
    "customer_firstname": "Nicola",
    "customer_group_id": 1,
    "customer_id": 4,
    "customer_lastname": "Neri",
    "customer_note_notify": 1,
    "discount_amount": 0,
    "email_sent": 1,
    "global_currency_code": "EUR",
    "grand_total": 38,
    "order_currency_code": "EUR",
    "shipping_amount": 5,
    "shipping_tax_amount": 0,
    "shipping_description": "Flat Rate - Fixed",
    "shipping_discount_amount": 0,
    "shipping_incl_tax": 5,
    "state": "pending",
    "status": "processing",
    "store_currency_code": "EUR",
    "store_to_base_rate": 0,
    "store_to_order_rate": 0,
    "store_id": 1,
    "subtotal": 33,
    "subtotal_incl_tax": 33,
    "total_due": 0,
    "total_paid" : 38,
    "total_item_count": 1,
    "total_qty_ordered": 1,
    "tax_amount": 0,
    "weight": 1,
    "items": [{ 
          "base_original_price": 33,
          "base_price": 33,
          "base_price_incl_tax": 33,
          "base_row_total": 33,
          "name": "un belllissimo prodotto",
          "original_price": 33,
          "price": 33,
          "price_incl_tax": 33,
                   "product_type": "configurable",
          "qty_ordered": 1,
          "row_total": 33,
          "row_total_incl_tax": 33,
          "sku": "MH01-S-Gray",
          "store_id": 1,
          "weight": 1,
        "product_option": {
            "extension_attributes": {
                "configurable_item_options": [
                    {"option_id":"179","option_value":187},
                    {"option_id":"61","option_value":93}]
            }
        }
    }],
    "billing_address": {
      "address_type": "billing",
      "city": "Urbino",
      "company": "",
      "country_id": "IT",
      "customer_address_id": 4,
      "email": "francoverdi@mail.com",
      "firstname": "franco",
      "lastname": "Ciani",
      "postcode": "61029",
      "region": "ca",
      "street": ["via milano 21"],
      "telephone": "071982939"
    },
    "payment": {
      "amount_ordered": 38,
      "amount_paid":38,
      "base_amount_ordered": 38,
      "base_amount_paid" : 38,
      "base_shipping_amount": 5,
      "method": "checkmo",
      "shipping_amount": 5
    },
    "status_histories": [{
      "comment" : "new order",
      "status": "processing"
    }],
    "extension_attributes": {
      "shipping_assignments": [{
        "shipping": {
          "address": {
            "address_type": "shipping",
            "city": "Urbino",
            "company": "mycompany",
            "country_id": "IT",
            "customer_address_id": 4,
            "email": "mariorossi@gmail.com",
            "firstname": "mario",
            "lastname": "Rossi",
            "postcode": "12345",
            "region": "CA",
            "street": ["via roma 823"],
            "telephone": "3469730878"
          },
          "method": "flatrate_flatrate",
          "total": {
            "base_shipping_amount": 5,
            "base_shipping_incl_tax": 5,
            "shipping_amount": 5,
            "shipping_incl_tax": 5
          },
          "extension_attributes": []
        },
        "items": [{ 
          "base_original_price": 33,
          "base_price": 33,
          "base_price_incl_tax": 33,
          "base_row_total": 33,
          "name": "un belllissimo prodotto",
          "original_price": 33,
          "price": 33,
          "price_incl_tax": 33,
          "product_id": 11,
          "product_type": "configurable",
          "qty_ordered": 1,
          "row_total": 33,
          "row_total_incl_tax": 33,
          "sku": "MH01-S-Gray",
          "store_id": 1,
          "weight": 1,
        "product_option": {
            "extension_attributes": {
                "configurable_item_options": [
                    {"option_id":"179","option_value":187},
                    {"option_id":"61","option_value":93}]
            }
        }
    }],
        "extension_attributes": []
      }],
      "applied_taxes": [],
      "item_applied_taxes": [],
      "converting_from_quote": false
    }
  }
}

Note: please correct me if anything wrong in data object

magento-engcom-team commented 5 years ago

Hi @nareshjiva. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop). For more details, please, review the Magento Contributor Assistant documentation.

@nareshjiva do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

magento-engcom-team commented 5 years ago

Hi @engcom-backlog-nazar. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ghost commented 5 years ago

Hi @nareshjiva i'm not able to reproduce following steps you described i'm using this payload ->

{
  "base_currency_code": "USD",
  "base_discount_amount": 0,
  "base_grand_total": 17,
  "base_discount_tax_compensation_amount": 0,
  "base_shipping_amount": 5,
  "base_shipping_discount_amount": 0,
  "base_shipping_discount_tax_compensation_amnt": 0,
  "base_shipping_incl_tax": 5,
  "base_shipping_tax_amount": 0,
  "base_subtotal": 12,
  "base_subtotal_incl_tax": 12,
  "base_tax_amount": 0,
  "base_total_due": 17,
  "base_to_global_rate": 1,
  "base_to_order_rate": 1.3887,
  "billing_address_id": 19,
  "created_at": "2019-01-21 12:44:25",
  "customer_email": "fgh@ad.com",
  "customer_group_id": 0,
  "customer_is_guest": 1,
  "customer_note_notify": 1,
  "discount_amount": 0,
  "email_sent": 1,
  "entity_id": 10,
  "global_currency_code": "USD",
  "grand_total": 23.61,
  "discount_tax_compensation_amount": 0,
  "increment_id": "000000029",
  "is_virtual": 0,
  "order_currency_code": "AUD",
  "protect_code": "f47d779644f0f823385329c663b3d7d2",
  "quote_id": 33,
  "remote_ip": "127.0.0.1",
  "shipping_amount": 6.94,
  "shipping_description": "Flat Rate - Fixed",
  "shipping_discount_amount": 0,
  "shipping_discount_tax_compensation_amount": 0,
  "shipping_incl_tax": 6.94,
  "shipping_tax_amount": 0,
  "state": "new",
  "status": "pending",
  "store_currency_code": "USD",
  "store_id": 1,
  "store_name": "Main Website\nMain Website Store\n",
  "store_to_base_rate": 0,
  "store_to_order_rate": 0,
  "subtotal": 16.67,
  "subtotal_incl_tax": 16.67,
  "tax_amount": 0,
  "total_due": 23.61,
  "total_item_count": 1,
  "total_qty_ordered": 1,
  "updated_at": "2019-01-21 12:49:08",
  "weight": 12,
  "items": [
    {
      "amount_refunded": 0,
      "base_amount_refunded": 0,
      "base_discount_amount": 0,
      "base_discount_invoiced": 0,
      "base_discount_tax_compensation_amount": 0,
      "base_original_price": 12,
      "base_price": 12,
      "base_price_incl_tax": 12,
      "base_row_invoiced": 0,
      "base_row_total": 12,
      "base_row_total_incl_tax": 12,
      "base_tax_amount": 0,
      "base_tax_invoiced": 0,
      "created_at": "2019-01-21 12:44:25",
      "discount_amount": 0,
      "discount_invoiced": 0,
      "discount_percent": 0,
      "free_shipping": 0,
      "discount_tax_compensation_amount": 0,
      "is_qty_decimal": 0,
      "is_virtual": 0,
      "item_id": 10,
      "name": "configurable",
      "no_discount": 0,
      "order_id": 10,
      "original_price": 16.665,
      "price": 16.67,
      "price_incl_tax": 16.67,
      "product_id": 611,
      "product_type": "configurable",
      "qty_canceled": 0,
      "qty_invoiced": 0,
      "qty_ordered": 1,
      "qty_refunded": 0,
      "qty_shipped": 0,
      "quote_item_id": 30,
      "row_invoiced": 0,
      "row_total": 16.67,
      "row_total_incl_tax": 16.67,
      "row_weight": 12,
      "sku": "configurable-red",
      "store_id": 1,
      "tax_amount": 0,
      "tax_invoiced": 0,
      "tax_percent": 0,
      "updated_at": "2019-01-21 12:49:08",
      "weight": 12,
      "product_option": {
        "extension_attributes": {
          "configurable_item_options": [
            {
              "option_id": "93",
              "option_value": 7
            }
          ]
        }
      }
    },
    {
      "amount_refunded": 0,
      "base_amount_refunded": 0,
      "base_discount_amount": 0,
      "base_discount_invoiced": 0,
      "base_price": 0,
      "base_row_invoiced": 0,
      "base_row_total": 0,
      "base_row_total_incl_tax": 0,
      "base_tax_amount": 0,
      "base_tax_invoiced": 0,
      "created_at": "2019-01-21 12:44:25",
      "discount_amount": 0,
      "discount_invoiced": 0,
      "discount_percent": 0,
      "free_shipping": 0,
      "is_qty_decimal": 0,
      "is_virtual": 0,
      "item_id": 11,
      "name": "configurable-red",
      "no_discount": 0,
      "order_id": 10,
      "original_price": 0,
      "parent_item_id": 10,
      "price": 0,
      "product_id": 608,
      "product_type": "simple",
      "qty_canceled": 0,
      "qty_invoiced": 0,
      "qty_ordered": 1,
      "qty_refunded": 0,
      "qty_shipped": 0,
      "quote_item_id": 31,
      "row_invoiced": 0,
      "row_total": 0,
      "row_total_incl_tax": 0,
      "row_weight": 0,
      "sku": "configurable-red",
      "store_id": 1,
      "tax_amount": 0,
      "tax_invoiced": 0,
      "tax_percent": 0,
      "updated_at": "2019-01-21 12:49:08",
      "weight": 12,
      "parent_item": {
        "amount_refunded": 0,
        "base_amount_refunded": 0,
        "base_discount_amount": 0,
        "base_discount_invoiced": 0,
        "base_discount_tax_compensation_amount": 0,
        "base_original_price": 12,
        "base_price": 12,
        "base_price_incl_tax": 12,
        "base_row_invoiced": 0,
        "base_row_total": 12,
        "base_row_total_incl_tax": 12,
        "base_tax_amount": 0,
        "base_tax_invoiced": 0,
        "created_at": "2019-01-21 12:44:25",
        "discount_amount": 0,
        "discount_invoiced": 0,
        "discount_percent": 0,
        "free_shipping": 0,
        "discount_tax_compensation_amount": 0,
        "is_qty_decimal": 0,
        "is_virtual": 0,
        "item_id": 10,
        "name": "configurable",
        "no_discount": 0,
        "order_id": 10,
        "original_price": 16.665,
        "price": 16.67,
        "price_incl_tax": 16.67,
        "product_id": 611,
        "product_type": "configurable",
        "qty_canceled": 0,
        "qty_invoiced": 0,
        "qty_ordered": 1,
        "qty_refunded": 0,
        "qty_shipped": 0,
        "quote_item_id": 30,
        "row_invoiced": 0,
        "row_total": 16.67,
        "row_total_incl_tax": 16.67,
        "row_weight": 12,
        "sku": "configurable-red",
        "store_id": 1,
        "tax_amount": 0,
        "tax_invoiced": 0,
        "tax_percent": 0,
        "updated_at": "2019-01-21 12:44:25",
        "weight": 12,
        "product_option": {
          "extension_attributes": {
            "configurable_item_options": [
              {
                "option_id": "93",
                "option_value": 7
              }
            ]
          }
        }
      }
    }
  ],
  "billing_address": {
    "address_type": "billing",
    "city": "Alabama",
    "company": "company",
    "country_id": "US",
    "email": "fgh@ad.com",
    "entity_id": 19,
    "firstname": "firstname",
    "lastname": "lastname",
    "parent_id": 10,
    "postcode": "12345",
    "region": "Alabama",
    "region_code": "AL",
    "region_id": 1,
    "street": [
      "street 0",
      "street 1"
    ],
    "telephone": "1234586789"
  },
  "payment": {
    "account_status": null,
    "additional_information": [],
    "amount_ordered": 23.61,
    "base_amount_ordered": 17,
    "base_shipping_amount": 5,
    "cc_last4": null,
    "entity_id": 10,
    "method": "checkmo",
    "parent_id": 10,
    "shipping_amount": 6.94
  },
  "status_histories": [],
  "extension_attributes": {
    "shipping_assignments": [
      {
        "shipping": {
          "address": {
            "address_type": "shipping",
            "city": "Alabama",
            "company": "company",
            "country_id": "US",
            "email": "fgh@ad.com",
            "entity_id": 18,
            "firstname": "firstname",
            "lastname": "lastname",
            "parent_id": 10,
            "postcode": "12345",
            "region": "Alabama",
            "region_code": "AL",
            "region_id": 1,
            "street": [
              "street 0",
              "street 1"
            ],
            "telephone": "1234586789"
          },
          "method": "flatrate_flatrate",
          "total": {
            "base_shipping_amount": 5,
            "base_shipping_discount_amount": 0,
            "base_shipping_discount_tax_compensation_amnt": 0,
            "base_shipping_incl_tax": 5,
            "base_shipping_tax_amount": 0,
            "shipping_amount": 6.94,
            "shipping_discount_amount": 0,
            "shipping_discount_tax_compensation_amount": 0,
            "shipping_incl_tax": 6.94,
            "shipping_tax_amount": 0
          }
        },
        "items": [
          {
            "amount_refunded": 0,
            "base_amount_refunded": 0,
            "base_discount_amount": 0,
            "base_discount_invoiced": 0,
            "base_discount_tax_compensation_amount": 0,
            "base_original_price": 12,
            "base_price": 12,
            "base_price_incl_tax": 12,
            "base_row_invoiced": 0,
            "base_row_total": 12,
            "base_row_total_incl_tax": 12,
            "base_tax_amount": 0,
            "base_tax_invoiced": 0,
            "created_at": "2019-01-21 12:44:25",
            "discount_amount": 0,
            "discount_invoiced": 0,
            "discount_percent": 0,
            "free_shipping": 0,
            "discount_tax_compensation_amount": 0,
            "is_qty_decimal": 0,
            "is_virtual": 0,
            "item_id": 10,
            "name": "configurable",
            "no_discount": 0,
            "order_id": 10,
            "original_price": 16.665,
            "price": 16.67,
            "price_incl_tax": 16.67,
            "product_id": 611,
            "product_type": "configurable",
            "qty_canceled": 0,
            "qty_invoiced": 0,
            "qty_ordered": 1,
            "qty_refunded": 0,
            "qty_shipped": 0,
            "quote_item_id": 30,
            "row_invoiced": 0,
            "row_total": 16.67,
            "row_total_incl_tax": 16.67,
            "row_weight": 12,
            "sku": "configurable-red",
            "store_id": 1,
            "tax_amount": 0,
            "tax_invoiced": 0,
            "tax_percent": 0,
            "updated_at": "2019-01-21 12:44:25",
            "weight": 12,
            "product_option": {
              "extension_attributes": {
                "configurable_item_options": [
                  {
                    "option_id": "93",
                    "option_value": 7
                  }
                ]
              }
            }
          },
          {
            "amount_refunded": 0,
            "base_amount_refunded": 0,
            "base_discount_amount": 0,
            "base_discount_invoiced": 0,
            "base_price": 0,
            "base_row_invoiced": 0,
            "base_row_total": 0,
            "base_row_total_incl_tax": 0,
            "base_tax_amount": 0,
            "base_tax_invoiced": 0,
            "created_at": "2019-01-21 12:44:25",
            "discount_amount": 0,
            "discount_invoiced": 0,
            "discount_percent": 0,
            "free_shipping": 0,
            "is_qty_decimal": 0,
            "is_virtual": 0,
            "item_id": 11,
            "name": "configurable-red",
            "no_discount": 0,
            "order_id": 10,
            "original_price": 0,
            "parent_item_id": 10,
            "price": 0,
            "product_id": 608,
            "product_type": "simple",
            "qty_canceled": 0,
            "qty_invoiced": 0,
            "qty_ordered": 1,
            "qty_refunded": 0,
            "qty_shipped": 0,
            "quote_item_id": 31,
            "row_invoiced": 0,
            "row_total": 0,
            "row_total_incl_tax": 0,
            "row_weight": 0,
            "sku": "configurable-red",
            "store_id": 1,
            "tax_amount": 0,
            "tax_invoiced": 0,
            "tax_percent": 0,
            "updated_at": "2019-01-21 12:44:25",
            "weight": 12,
            "parent_item": {
              "amount_refunded": 0,
              "base_amount_refunded": 0,
              "base_discount_amount": 0,
              "base_discount_invoiced": 0,
              "base_discount_tax_compensation_amount": 0,
              "base_original_price": 12,
              "base_price": 12,
              "base_price_incl_tax": 12,
              "base_row_invoiced": 0,
              "base_row_total": 12,
              "base_row_total_incl_tax": 12,
              "base_tax_amount": 0,
              "base_tax_invoiced": 0,
              "created_at": "2019-01-21 12:44:25",
              "discount_amount": 0,
              "discount_invoiced": 0,
              "discount_percent": 0,
              "free_shipping": 0,
              "discount_tax_compensation_amount": 0,
              "is_qty_decimal": 0,
              "is_virtual": 0,
              "item_id": 10,
              "name": "configurable",
              "no_discount": 0,
              "order_id": 10,
              "original_price": 16.665,
              "price": 16.67,
              "price_incl_tax": 16.67,
              "product_id": 611,
              "product_type": "configurable",
              "qty_canceled": 0,
              "qty_invoiced": 0,
              "qty_ordered": 1,
              "qty_refunded": 0,
              "qty_shipped": 0,
              "quote_item_id": 30,
              "row_invoiced": 0,
              "row_total": 16.67,
              "row_total_incl_tax": 16.67,
              "row_weight": 12,
              "sku": "configurable-red",
              "store_id": 1,
              "tax_amount": 0,
              "tax_invoiced": 0,
              "tax_percent": 0,
              "updated_at": "2019-01-21 12:44:25",
              "weight": 12,
              "product_option": {
                "extension_attributes": {
                  "configurable_item_options": [
                    {
                      "option_id": "93",
                      "option_value": 7
                    }
                  ]
                }
              }
            }
          }
        ]
      }
    ],
    "payment_additional_info": [
      {
        "key": "method_title",
        "value": "Check / Money order"
      }
    ],
    "applied_taxes": [],
    "item_applied_taxes": []
  }
ghost commented 5 years ago

@nareshjiva selection_283 selection_282

nareshjiva commented 5 years ago

@engcom-backlog-nazar

Can you please recheck your screen capture in that it's not displaying selected color, it's just created an order for child SKU "configurable-red" Thanks for your quick responce

ghost commented 5 years ago

@nareshjiva wow.. :) :+1: yes seems like when i updates order via rest api, attributes removed .

magento-engcom-team commented 5 years ago

@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-97853 were created

magento-engcom-team commented 5 years ago

Hi @milindsingh. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

nareshjiva commented 5 years ago

Hi Team,

Thanks for the reopening issue and providing support, can you please update me the status as we are waiting for a fix

milindsingh commented 5 years ago

dmcdindia1

milindsingh commented 5 years ago

@magento-engcom-team give me 2.3-develop instance

magento-engcom-team commented 5 years ago

Hi @milindsingh. Thank you for your request. I'm working on Magento 2.3-develop instance for you

magento-engcom-team commented 5 years ago

Hi @milindsingh, here is your Magento instance. Admin access: https://i-20440-2-3-develop.instances.magento-community.engineering/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

magento-engcom-team commented 3 years ago

Hi @nareshjiva.

Thank you for your report and collaboration!

The related internal Jira ticket MC-24308 was closed as Fixed.

The fix will be available with the upcoming 2.4.3 release.