Skip to main content
Most monetary amounts Jinko returns — fares, monitoring prices, refunds, booking totals — are integers in minor units, with the scale alongside:
A few endpoints (trip and checkout totals, hotel rate amounts) instead return plain decimals in major units with no decimal_places field. The discriminator rule below covers both.
value is not a display value. Convert it before showing it to anyone:
15977 with decimal_places: 2 is **159.77not159.77** — not 15,977.
This is the single most common integration mistake with the Jinko API, and it is easy to miss: 15977 is a plausible long-haul business fare, so a page full of wrong prices looks like real data rather than a unit bug.

Convert it

Not every currency has 2 decimals

decimal_places usually matches the currency’s ISO 4217 digits: Hardcoding / 100 renders JPY and KRW 100× too small and Kuwaiti dinar 10× too high.
Always use the decimal_places sent with the amount — don’t derive it from the currency. Currency-converted prices (for example cached search results converted from USD) can carry a scale that differs from the currency’s ISO digits. Dividing by the accompanying decimal_places is always correct; assuming the ISO digits is not. Fall back to ISO digits only when the field is genuinely absent.

One rule: decimal_places is the discriminator

Depending on the endpoint, the integer field may be named value or amount, and some endpoints return plain decimal numbers. One rule covers everything:
If the money object carries decimal_places, its number is an integer in minor units — divide by 10 ** decimal_places (whether the field is named value or amount). If there is no decimal_places — a bare number with a separate currency — it is already in major units: display as-is.
value and amount never appear together on one object — they come from different backend shapes, not two views of the same number.
Apply the rule to the actual response object, not to the schema or this table. The OpenAPI schemas mark decimal_places as optional on every money shape (they describe the union of endpoints), so generated types always show decimal_places?: number — including for endpoints that never send it at runtime, such as checkout totals. Branch on whether the field is present in the response you received; the endpoint column above only describes today’s runtime behaviour.

Arithmetic: sum before you divide

When totalling several prices — legs of a trip, travelers in a group, a cart with flights and hotels — add the minor-unit integers and convert once at the end. Converting first introduces floating-point drift that shows up as totals being a cent off:
Only add amounts that share both a currency and a decimal_places — Jinko can return different currencies in one response (for example a multi-provider trip), and converted prices can carry a different scale. Rescale first if the decimal_places differ.

Common mistakes

Using the CLI or SDK?

The same rules apply unchanged. @gojinko/cli output (JSON is its default format) and @gojinko/api-client responses are the raw API body — neither converts money for you. A jinko flight-search --format json result carries the same { value, currency, decimal_places } objects described above; a jinko checkout total is the same major-units { amount, currency }.

Prices look 100× too high?

That symptom has exactly one common cause: value was rendered without dividing by 10 ** decimal_places. Check the raw JSON — if you see "value": 15977, "decimal_places": 2 for a fare you expect to be ~$160, that’s it. The mirror symptom — prices looking 100× too small — is usually a hardcoded / 100 applied to a decimal_places: 0 currency such as JPY.