Search code examples
ruby-on-railsapishippo

How to access return label pdf via API?


When I create an instance of Shippo::Transaction, I get access to transaction pdf from label_url field. How can I get access to pdf for return label?

I tried to create an instance of Shippo::Shipment with address_return or/and return_of fields and I received any link to my return label pdf from API response. I can do it only using web version.

I haven't found anything about this issue in API documentation.


Solution

  • Check out the Shippo return label docs.

    The process of creating a return label is the same as the outbound label, just with the addition of the return_of field in the Shipment.

    1. Create a Shippo::Shipment with return_of set to the object_id of the outbound Transaction object.
    2. Purchase one of the returned rates by creating a Shippo::Transaction.

    (Altrnatively you can also purchase return labels in one API call with the Shippo Single Label Call Creation.)