Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with generating Czech shipments #11210

Open
bourka opened this issue Mar 26, 2025 · 5 comments
Open

Problem with generating Czech shipments #11210

bourka opened this issue Mar 26, 2025 · 5 comments

Comments

@bourka
Copy link

bourka commented Mar 26, 2025

Hello,
I have a problem with generating labels for packages for Czech Allegro. When generating packages, it keeps sending me the same error input.insurance.amount. No matter what I enter, without insurance, with insurance, price with a dot or a comma and different currencies, an error always pops up.

I don't have this problem on Polish Allegro.

TraceID for the requests I sent:
f3cfcb53cc732ce9
1af67fe33dc34f67
7e7e2f72d4475aec
1eb34b887f702f61
8abed362c687cfc3
4c944fdf6eea7f85

@AureliuszBrussy
Copy link
Collaborator

AureliuszBrussy commented Mar 26, 2025

You need to send the amount in the correct format - you need to send 2 numbers after the decimal point. That is, instead of 9999.9, send 9999.90. Remember to send it as a string.

@bourka
Copy link
Author

bourka commented Mar 26, 2025

I am sending in exactly this format. When I sent the traceid in the previous post, all the variants were there.
Here I entered exactly as requested and it still reports an error
I send this in the request
"insurance" => [
"amount" => "9999.90",
"currency" => "CZK"
],

Error:
HTTP 400, odpoved: HTTP/2 400
trace-id: 5875088c2f383c47
date: Wed, 26 Mar 2025 09:50:22 GMT
content-type: application/vnd.allegro.public.v1+json
content-length: 247
x-frame-options: DENY
strict-transport-security: max-age=15552000
x-content-type-options: nosniff

{"errors":[{"code":"VALIDATION_ERROR","message":"The amount must be in the 9999.99 or 9999,99 format","details":"Invalid value: 9999.9","path":"input.insurance.amount","userMessage":"Kwota musi byt w formacie 9999.99 lub 9999,99","metadata":{}}]}

@bourka
Copy link
Author

bourka commented Mar 26, 2025

When creating a shipment
https://api.allegro.pl/shipment-management/shipments/create-commands/{$commandId}
it gives me this error

Array
(
[commandId] => 87819748-5e04-4bd4-ba12-a6a5e5fbd659
[status] => ERROR
[errors] => Array
(
[0] => Array
(
[code] => VALIDATION_ERROR
[message] => Decimals are not supported by the selected currency
[details] =>
[path] => insurance.amount
[userMessage] => Podana waluta nie wspiera warto�ci dziesi�tnych
)

        [1] => Array
            (
                [code] => CURRENCY_AMOUNT_INCORRECT
                [message] => The specified amount must be a multiple of 1.0 for currency CZK
                [details] => currency amount is incorrect
                [path] => insurance.amount
                [userMessage] => Podana kwota musi by� wielokrotno�ci� 1.0 dla waluty CZK
            )

    )

[shipmentId] => 

)

@AureliuszBrussy
Copy link
Collaborator

So, in the case of CZK, due to the nature of the market and this currency, you should give the full value, without the decimal, so, valid example is: 9999.00. I understand that the issue regarding erroneous rounding (to one digit after the decimal point) no longer occurs in this case? Let us know if you have already created a shipment after these changes.

@bourka
Copy link
Author

bourka commented Mar 26, 2025

Thanx now is everything OK, but maybe is better this thing get to tuttorial for this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants