karrioapi / karrio

Programmable Shipping API (self-hosted)
https://karrio.io
Apache License 2.0
407 stars 82 forks source link

Separate UPS shipper and shipfrom address #601

Closed mazzarito closed 1 month ago

mazzarito commented 1 month ago

UPS allows a ship from address as well as a shipper address in order to specify a separate pickup location and a separate shipper (return address) location. Currently these fields are filled out with the same address... How hard would it be to change this to allow for separate shipper and ship from addresses?


                ShipFrom=ups.ShipFromType(
                    Name=(shipper.company_name or shipper.person_name),
                    AttentionName=shipper.contact,
                    CompanyDisplayableName=shipper.company_name,
                    TaxIdentificationNumber=shipper.tax_id,
                    Phone=ups.ShipFromPhoneType(
                        Number=shipper.phone_number or "000-000-0000",
                    ),
                    FaxNumber=None,
                    Address=ups.AlternateDeliveryAddressAddressType(
                        AddressLine=shipper.address_line,
                        City=shipper.city,
                        StateProvinceCode=shipper.state_code,
                        PostalCode=shipper.postal_code,
                        CountryCode=shipper.country_code,
                        ResidentialAddressIndicator=(
                            "Y" if shipper.is_residential else None
                        ),
                    ),
                    VendorInfo=None,
                ),
danh91 commented 1 month ago

Hi @mazzarito , At first glance, if I understand correctly the use case, the simplest way to add it would be as a UPS option 🤔.

Are you using the dashboard or just the API? (If yes, the dashboard will also require adding a way to add address in options).

Otherwise, adding an official field for that at the top level of the shipment like shipper and recipient will require more thinking about how it affects (or what should be the expectations for) the other carriers and careful consideration to standardize the behaviour.

mazzarito commented 1 month ago

@danh91 thanks for your quick response- are you saying that this can be accomplished currently or that there would have to be a change to add a UPS option? FYI this is supported by a lot of carriers, Fedex for sure, probably most of them honestly.

It's how people create blind shipments, very common when shipping for ecommerce, etc.

danh91 commented 1 month ago

@mazzarito, Yes, I believe it can be accomplished by adding it as an option (it is not there currently).
That would be a quick short-term solution.

I know that most of the major carriers (UPS, FedEx, DHL...) have something similar. What I meant was making a higher-level field that maps to all the supported carriers that support that will take a little more work.

danh91 commented 1 month ago

I am reading a couple of carrier API docs. I will assess if see I might be able to add a shipping_from at the top level of the shipment object and gradually map it to carriers that support it.

mazzarito commented 1 month ago

@danh91 thanks again for the help, I hacked it for now... but this would be a nice option to have even if it was just via the API.