Giter Club home page Giter Club logo

Comments (13)

ThiagoRRamos avatar ThiagoRRamos commented on June 12, 2024

@claw68 We identified the problem and will resolve it soon.

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

Hello, any updates on this issue?

from shippo-php-client.

ThiagoRRamos avatar ThiagoRRamos commented on June 12, 2024

Hey, claw68.
Sorry for the delay on getting back to you.

We removed the dhl_express_worldwide_eu token. We updated the documentation to reflect so. There are some different services, and the one that maps to the same DHLExpress service is now called dhl_express_worldwide_eu_doc

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

Hi Thiago,

I tried both dhl_express_worldwide_eu and dhl_express_worldwide_eu_doc service level tokens and both returns
An error occurred when creating the label. Please contact Shippo support with the object ID 7ec02e2ebb7d4f04a4b969afb7e1c1e7

from shippo-php-client.

smkrz avatar smkrz commented on June 12, 2024

Hey @claw68 - we should take a look at your Shippo account to debug this specific issue. Would you mind reaching out to [email protected] or sharing your Shippo account address here? This helps us to look into the specific error in your account. Thanks!

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

Hi @simonkreuz, I assume you are asking for a Shippo email address. It's [email protected].

from shippo-php-client.

smkrz avatar smkrz commented on June 12, 2024

Perfect, thanks @claw68. We're investigating this specific error and I'll get back to you soon.

from shippo-php-client.

smkrz avatar smkrz commented on June 12, 2024

@claw68 with the single-label call (https://goshippo.com/docs/single-call) we can currently only support outbound US shipments. For DHL Express shipments originating from other countries you have to use the normal process via Shipment > Transaction (https://goshippo.com/docs/international). This is because DHL's service tokens aren't consistent internationally.

If you're only shipping from a specific set of countries I can check if there's a way to support those specifically.

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

@simonkreuz we would want to support EU countries.

To give a brief background, my goal is to filter the rate results by carrier, account id and service level token.

Since Rate is a part of Shipment, i tried using service level token filter on shipment but it doesn't work. I can only retrieve rates by object_id according to API docs. Can you give an example how to do it on the process you are suggesting (Shipment > Transaction)?

from shippo-php-client.

smkrz avatar smkrz commented on June 12, 2024

Absolutely In general, there are two ways you can create labels:

  • POST to /v1/transactions/ with a servicelevel_token, carrier_account and nested (inline) Shipment object. That's the process described here (https://goshippo.com/docs/single-call) and what you're currently using. This does currently not work with DHL Express for non-US countries.

    OR
  • Make 2 API calls, first POST to /v1/shipments/ to retrieve a list of available rates, then POST to /v1/transactions/ with the Rate object_id (without specifying the servicelevel_token and carrier_account explicitly, because it's implicitly given by the object_id) - see https://goshippo.com/docs/international. The following outlines a simple example:

First POST to /v1/shipments/ to get list of Rates

curl https://api.goshippo.com/v1/shipments/ \
    -H "Authorization: ShippoToken <PRIVATE_TOKEN>" \
    -d object_purpose="PURCHASE" \
    -d address_from="d799c2679e644279b59fe661ac8fa488" \
    -d address_to="42236bcf36214f62bcc6d7f12f02a849" \
    -d parcel="7df2ecf8b4224763ab7c71fae7ec8274" \
    -d customs_declaration="b741b99f95e841639b54272834bc478c" \
    -d async=false

(the the object_ids are samples, you will need to use your own object_ids)

You will get a response with a rates_list attribute:

{
    "object_id": "5e40ead7cffe4cc1ad45108696162e42",
    "object_owner": "[email protected]",
    "address_from": "d799c2679e644279b59fe661ac8fa488",
    "address_to": "42236bcf36214f62bcc6d7f12f02a849",
    "parcel": "7df2ecf8b4224763ab7c71fae7ec8274",
    "customs_declaration": "b741b99f95e841639b54272834bc478c",
    "rates_list": [
        {
            "object_created": "2013-12-01T06:24:21.121Z",
            "object_id": "545ab0a1a6ea4c9f9adb2512a57d6d8b",
            "shipment": "5e40ead7cffe4cc1ad45108696162e42",
            "amount": "5.50",
            "currency": "USD",
            "provider": "DHL Express",
            "servicelevel_name": "Worldwide",
            "servicelevel_token":"dhl_express_worldwide",
            "days": 2,
            "test": false
        },
        ...
    ]
}

The rates_list usually contains multiple rates - use your own business logic to filter out the rate you want to use and grab the corresponding's Rate's object_id.

Next POST to /v1/transactions/ with the Rate object_id

curl https://api.goshippo.com/v1/transactions \
    -H "Authorization: ShippoToken <PRIVATE_TOKEN>" \
    -d rate="545ab0a1a6ea4c9f9adb2512a57d6d8b"
    -d label_file_type="PDF"
    -d async=false

Using this process avoids DHL's inconsistency of the servicelevel_token in non-US countries.

I hope that helps - let me know if you have further questions!

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

Rate list contains multiple rates, correct, that's why we want to filter it out by service level token.
We want to use the dhl_express_worldwide_eu_doc rate. Is there a way to do this via your API? Or are you suggesting that I should loop through the rate list to find the rate?

from shippo-php-client.

smkrz avatar smkrz commented on June 12, 2024

Currently the API does not offer a filter by servicelevel_token but I will pass this on to our team to see if we can add it in the future. For now looping through the rates list is the best way to get the applicable rate.

from shippo-php-client.

claw68 avatar claw68 commented on June 12, 2024

Alright, Thank you so much @simonkreuz, @ThiagoRRamos and shippo team for resolving this issue and for the suggestions.

from shippo-php-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.