Australia Post real time rates for letter doesn't return rate

cs-cart mve ult 16.2

The real time rate works ok for packages but not for letters.

It appears to be because dimensions are sent for letters, this conflicts with the api specification (linked). I have reviewed logic of app/Tygh/Shippings/Services/Aup.php and this sends dimension for both letters and packages
packages = required
letters = invalid

to replicate

  • set up a real time postage method to a package type.
  • set product box dimensions to minimum e.g. 1 x 1 x 1
  • test works ok, live package in store works ok,
  • switch real time postage method to a letter type
  • test works ok but live product will not.

Test requests sent to Australia Post from the storefront and from the admin panel (when using “test”) use the same data structure, so there should be no difference. Please check that all other settings are correct.

I don’t believe the test structure sends dimensions, which is why I think the live provides an error, whatever the reason it doesn’t work when letters are selected but does work when package selects. The item being tested from storefront (as opposed to test calculation within admin panel) weight is set too 0.05 and length of 1x1x1

You can check the last HTTP/HTTPS requests at the Administration > Logs page of your admin panel. It will contain both the parameters that were sent in the request and its response.

Please check them and let me know the results.

Ta. Both the admin panel test and cart request seem to include dimensions. It seems the bug is that the weight is being sent as 250kg for the letter but .250kg for the package … that said it works ok for the admin panel test. Saids that service code is wrong, but it is the same service code for the admin panel test!!! Maybe it is that the cart test adds a decimal point and the admin panel test doesn’t.

Letter no work
Requests (Shipping request)
URL: https://digitalapi.auspost.com.au/postage/letter/domestic/calculate.json
Request: array ( ‘country_code’ => ‘AU’, ‘service_code’ => ‘AUS_LETTER_REGULAR_LARGE_500’, ‘weight’ => 250.0, ‘from_postcode’ => ‘5114’, ‘to_postcode’ => ‘5114’, ‘length’ => 1, ‘width’ => 1, ‘height’ => 1, )
Response: {“error”:{“errorMessage”:“Please enter a valid Service code.”}}
Shipping: aup

Package works
Requests (http/https request)
URL: https://digitalapi.auspost.com.au/postage/parcel/domestic/calculate.json
Request: ‘country_code=AU&service_code=AUS_PARCEL_REGULAR_PACKAGE_SMALL&weight=0.25&from_postcode=5114&to_postcode=5000&length=1&width=1&height=1’
Response: {“postage_result”:{“service”:“Small”,“delivery_time”:“Delivered in 2-3 business days”,“total_cost”:“10.60”,“costs”:{“cost”:{“item”:“Small”,“cost”:“10.60”}}}}

Admin panel test (works)
Requests (http/https request)
URL: https://digitalapi.auspost.com.au/postage/letter/domestic/calculate.json
Request: ‘country_code=AU&service_code=AUS_LETTER_REGULAR_LARGE_500&weight=500&from_postcode=5114&to_postcode=5000&length=10&width=10&height=10’
Response: {“postage_result”:{“service”:“Large Letter”,“delivery_time”:“Delivered in 2 to 3 business days, dependent on point of origin and destination”,“total_cost”:“6.00”,“costs”:{“cost”:{“item”:“Large Letter”,“cost”:“6.00”}}}}

I place my bid that it is caused by the fact that delivery is requested from the place ‘A’ back to the place ‘A’ again.

‘from_postcode’ => ‘5114’, ‘to_postcode’ => ‘5114’

Weight is specified in grams, so you don’t need to be afraid of large numbers :smiley:

Same result with different postcode

Requests (http/https request)
URL: https://digitalapi.auspost.com.au/postage/parcel/domestic/calculate.json
Request: ‘country_code=AU&service_code=AUS_PARCEL_REGULAR_PACKAGE_SMALL&weight=0.25&from_postcode=5114&to_postcode=5072&length=1&width=1&height=1’
Response: {“postage_result”:{“service”:“Small”,“delivery_time”:“Delivered in 2-3 business days”,“total_cost”:“10.60”,“costs”:{“cost”:{“item”:“Small”,“cost”:“10.60”}}}} — 23/02/2024, 00:41

Requests (Shipping request)
URL: https://digitalapi.auspost.com.au/postage/letter/domestic/calculate.json
Request: array ( ‘country_code’ => ‘AU’, ‘service_code’ => ‘AUS_LETTER_REGULAR_LARGE_500’, ‘weight’ => 250.0, ‘from_postcode’ => ‘5114’, ‘to_postcode’ => ‘5072’, ‘length’ => 1, ‘width’ => 1, ‘height’ => 1, )
Response: {“error”:{“errorMessage”:“Please enter a valid Service code.”}}
Shipping: aup — 23/02/2024, 00:

cs-cart has confirmed this as a bug via the helpdesk.

I’m sorry but I am unable to find any messages from my colleagues that they confirm this bug in the Help Desk.

You have selected Domestic Letters: Large Letter 500g and are attempting to calculate shipping for a weight of 250 grams.

In summary, the Australia Post shipping method is working as intended and no bugs have been found at this time. For further assistance on this topic, please either contact us via Help Desk with an active Customer Care subscription, or contact Australia Post Support.

I’m closing this topic.