Get Credit memo details by creditmemo id Magento 2.

Magento 2 contains Out of the Box Native feature of Credit memo generation from admin panel for an order after invoice generated.

What is a Credit Memo?

After a customer places and pays for an order for an online payment method and an invoice has been issued for the specific order, Merchant can create a credit memo to refund all or part of the amount paid for any returned or undelivered items.

The memo restores funds to the customer account or refunds to the customer bank account used for an order so that the customer can make future purchases. Continue reading “Get Credit memo details by creditmemo id Magento 2.”

Get Shipment data by order increment id Magento 2.

You can get the Shipment collection for the specific order by order increment id in Magento 2.

Using Magento\Sales\Api\ShipmentRepositoryInterface interface, you need to use getList() function to fetch no. of Shipment by sales order increment id.

When you check the sales_shipment table, one field order_id is available in sales_shipment table so you first fetch the order id from the order increment id. Continue reading “Get Shipment data by order increment id Magento 2.”

Get Shipment collection details by order id Magento 2.

You can get the Shipment data or collection for the specific order by order id in Magento 2.

Using Magento\Sales\Api\ShipmentRepositoryInterface interface, you need to use getList() function to fetch no. of Shipment by sales order id.

Using SearchCriteriaBuilder Class, You need to use addFilter() method, filter by order id and pass searchCriteria object to getList() method of ShipmentRepositoryInterface. Continue reading “Get Shipment collection details by order id Magento 2.”