Create a new field on the sales shipment table using the db-schema.xml file Then add the newfield on the extension attributes file app/code/JJ/DocumentNumber/etc extension_attributes.xml <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework/Extension/etc/extension_attributes.xsd”> <extension_attributes for=”MagentoSalesApiDataShipmentCreationArgumentsInterface”> <attribute code=”document_number” type=”string”/> </extension_attributes> </config> For saving the field di.xml <config xsi:noNamespaceSchemaLocation=”urn:magento:framework/ObjectManager/etc/config.xsd”> <type name=”MagentoSalesApiShipmentRepositoryInterface”> <plugin name=”custom_shipment_repository_plugin” type=”JJDocumentNumberPluginShipmentRepositoryPlugin”/> </type> </config> ShipmentRepositoryPlugin.php <?php namespace JJDocumentNumberPlugin; use MagentoSalesApiDataShipmentExtensionFactory; use MagentoSalesApiDataShipmentInterface; use MagentoSalesApiShipmentRepositoryInterface; class ShipmentRepositoryPlugin… Continue reading How to include a new field on the Shipment API in Magento2
Tag: Magento Rest API
How can to restrict SPECIFIC CMS pages from being seen by non-logged-in customers?
Need to block some CMS pages from the non-logged-in customersUsing an observer and Events Getting the page ID or page identifier
API to update the inventory to Magento without manging stock
Here we’re having a REST API which is used to update the inventory from any external Source of integrationHere we have considered NetSuite API: https://example.com/rest/default/V1/inventory/stocks/{stockId} body { “stock”: { “stock_id”: 0, “name”: “string”, “extension_attributes”: {} } } Response Example
Magento 2 api – How to get layer navigation filters available in rest api?
get layer navigation data available in product collection ( current category , search product ) . To get layer navigation from the API Sample Output will be :
Creating Magento 2 Cron Job Cloudways
To create a Magento 2 cron job, you must log in as a user with root privileges (as mentioned earlier) and run the following command: crontab -u -e Now since the following commands are long and there is a chance of a mistake, I recommend using a text editor. The first command reindexes the indexers,… Continue reading Creating Magento 2 Cron Job Cloudways
error code: INVALID_REQUEST error message: The request could not be understood by the server due to malformed syntax. Magento Error
This error is caused due to the signature method error or auth expired from the auth method provided, Recently we have noticed that the hmac_sha1 signature method has expired for some of the projects. it can be resolved by modifying the signature method to hmac_sha256 replace the ouath_signature_method to hmac_sha256. the error will be reolved
Magento REST API Search Criteria
Search criterias can be added to GET request API to get required data from magento. The basic pattern for specifying the criteria is: searchCriteria[filter_groups][][filters][][field]=<field_name> searchCriteria[filter_groups][][filters][][value]=<search_value> searchCriteria[filter_groups][][filters][][condition_type]=<operator> where: field is an attribute name. value specifies the value to search for. condition_type is one of the following values: CONDITION NOTES eq Equal finset A value within a… Continue reading Magento REST API Search Criteria
Get Sales Rep — Restlet
This article helps to get sales rep details from NetSuite.
Magento Rest API – Customer creation in NS.
Create a Restlet to create a customer in NetSuite on customer registration in Magento.