Skip to content

Data types

How the Baiyar API writes amounts, currency, times, booleans, null values and text.


Amounts are integers in the currency’s minor unit. For rupiah, Rp10.000 is 1000000, because ISO 4217 gives rupiah two decimals. Send amount and currency together, and never a decimal.

{ "amount": 1000000, "currency": "IDR" }

Payments are in whole rupiah, so an amount is a multiple of 100.

In rupiah amount to send
Rp1.000 100000
Rp10.000 1000000
Rp125.000 12500000
Rp1.500.000 150000000

To go from rupiah to amount, multiply by 100. To show an amount, divide by 100, and never do money sums in floating point.

Currencies are ISO 4217 codes in capital letters. The Merchant API takes payments in IDR.

Times are ISO 8601 in UTC, with milliseconds and a Z:

{ "created_at": "2026-10-26T03:04:05.000Z" }

The created field of a webhook event is in Unix seconds instead. Show times to your users in their own time zone (Indonesia uses WIB, WITA and WIT).

true or false, never a string. livemode says whether an object belongs to live (true) or to the sandbox (false).

A field that has no value is null: it is still there. A payment that was not made through a link has "payment_link_id": null, and one that is not paid has "paid_at": null. A request may leave an optional field out.

Text is UTF-8. A field with a fixed set of values, like a payment status, uses lowercase words (created, pending, paid, failed, expired); the reference page of the operation lists them.

An object of your own text: see Metadata.