cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2: retrieving Shipping Labels

Magento 2: retrieving Shipping Labels

Hi,

 

I've been developping a CanadaPost module for a while now and i've reached a point where I don't know where to get the information. I've tried to look into what Magento is doing with fedex, usps and UPS via their modules to retrieve the pdf labels for shipping products but I don't understand how that's done.

 

When I post a REST call to CanadaPost, i'll get this xml response.:

 

    <?xml version="1.0" encoding="UTF-8"?>
    <non-contract-shipment-info xmlns="http://www.canadapost.ca/ws/ncshipment-v4">
    <shipment-id>182021490539686334</shipment-id>
    <tracking-pin>123456789012</tracking-pin>
    <links>
      <link rel="self" href="https://ct.soa-gw.canadapost.ca/rs/00085533536/ncshipment/182021490539686334" media-type="application/vnd.cpc.ncshipment-v4+xml"/>
      <link rel="details" href="https://ct.soa-gw.canadapost.ca/rs/00085533536/ncshipment/182021490539686334/details" media-type="application/vnd.cpc.ncshipment-v4+xml"/>
      <link rel="receipt" href="https://ct.soa-gw.canadapost.ca/rs/00085533536/ncshipment/182021490539686334/receipt" media-type="application/vnd.cpc.ncshipment-v4+xml"/>
      <link rel="refund" href="https://ct.soa-gw.canadapost.ca/rs/00085533536/ncshipment/182021490539686334/refund" media-type="application/vnd.cpc.ncshipment-v4+xml"/>
      <link rel="label" href="https://ct.soa-gw.canadapost.ca/rs/artifact/4c37814e54a550fc/100003876755/0" media-type="application/pdf" index="0"/>
    </links>
    </non-contract-shipment-info>

The "label" is what i'm trying to store for that specified order so that I can print it from the backend.

 

Any clue?

Thanks!