Magento Shipment option Fetch

Fetch Shipment Details Using Magento API

After an order is placed and processed, you can fetch the shipment details via the Magento REST API.

Endpoint:

http

Copy code
GET /rest/V1/shipment/{shipment_id}

Example API Call:

bash

Copy code
curl -X GET "https://yourmagento.com/rest/V1/shipment/25" 
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" 
-H "Content-Type: application/json"

2. Fetch Shipments for an Order

To fetch all shipments related to a particular order:

http

Copy code
GET /rest/V1/orders/{order_id}/shipments

Example:

bash

Copy code
curl -X GET "https://yourmagento.com/rest/V1/orders/1001/shipments" 
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" 
-H "Content-Type: application/json"

3. Retrieve Shipment Tracking Information

If you need tracking details for a shipment:

http

Copy code
GET /rest/V1/shipment/track/{track_id}

4. Automating Fetch After Success

You can set up a webhook in Magento to automatically fetch shipment details after a successful RMA or order shipment.

Leave a comment

Your email address will not be published. Required fields are marked *