Skip to content

REST API create order POST /V1/orders #15652

@bibiseb

Description

@bibiseb

Preconditions

  1. Magento 2.2.4
  2. PHP 7.0.18

Steps to reproduce

POST http://magento2.test/index.php/rest/V1/orders

{ "entity": { "base_grand_total" : 100, "customer_email" : "user@domain.tld", "grand_total" : 100, "items" : [ { "sku" : "TESTSEB" } ] } }

Expected result

An order should have been created

Actual result

I received this json:

{ "messages": { "error": [ { "code": 500, "message": "Server internal error. See details in report api/487380499411" } ] } }

And in the report file I get this error:

Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\Paypal\Model\Adminhtml\Express\Interceptor::isOrderAuthorizationAllowed() must be an instance of Magento\Sales\Model\Order\Payment, null given, called in /home/forge/magento2.test/public/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php on line 41 and defined in /home/forge/magento2.infinity-mobile.io/public/generated/code/Magento/Paypal/Model/Adminhtml/Express/Interceptor.php:33
Stack trace:
#0 /home/forge/magento2.test/public/vendor/magento/module-paypal/Plugin/OrderCanInvoice.php(41): Magento\Paypal\Model\Adminhtml\Express\Interceptor->isOrderAuthorizationAllowed(NULL)
#1 /home/forge/magento2.test/public/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Paypal\Plugin\OrderCanInvoice->afterCanInvoice(Object(Magento\Sales\Model\Order\Interceptor), false)
#2 /home/forge/magento2.test/public/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Model\Order\Interce' in '/home/forge/magento2.test/public/generated/code/Magento/Paypal/Model/Adminhtml/Express/Interceptor.php' on line 33

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: PaymentComponent: WebapiUse with concrete module component label E.g. "Component: Webapi" + "Catalog"Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions