How can we add Tracking number using third party API in order when shipment create in Magento 2.3.5?

magento.stackexchange https://magento.stackexchange.com/questions/316374

문제

I want to add a Tracking number using third party API when creating shipment from admin. Also, how can we override that observer? I am using Magento 2.3.5. I have referred one link but it is for Magento 1.9. (How do I add tracking number to current order shipment in Magento 2?)

Please help me.

도움이 되었습니까?

해결책

You can use the REST API provided by Magento.

In this case use this webservice http://yoursite.com/index.php/rest/V1/shipment/track

{
  "entity": {
    "order_id":     your order id,
    "parent_id":    your shipment id,
    "track_number": "track number",
    "tittle": "carrier tittle",
    "carrier_code": "carrier code"
  }
}

Include in the header the following information: Content-Type application/json Authorization Bearer your_auth_token

Any help needed feel free to ask !

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top