Skip to content

IDR money and PPN evidence

Represent rupiah as integer minor units, calculate PMK 131/2024 PPN adjustments, and export reconcilable audit evidence.

Adocommerce Kit represents money as an integer amount plus an ISO currency code. For IDR, the currency exponent is 0: Money.of(125000n, "IDR") means Rp125.000, not Rp1.250,00.

Keep rupiah exact

import { Money } from "@adocommercekit/core"

const subtotal = Money.of(125_000n, "IDR")

Use strings or integers at HTTP and database boundaries. Do not pass rupiah through binary floating-point arithmetic, divide by 100, or infer decimal precision from a generic frontend currency component. Format for display only after calculation.

The money and ledger model records discounts, shipping, tax, payment-specific charges, and other effects as ordered adjustments. PPN is therefore persisted evidence, not a total silently recomputed when an old order is read.

Register the PPN calculator

pnpm add @adocommercekit/id
node ace configure @adocommercekit/id
node ace migration:run
import { ppnCalculator } from "@adocommercekit/id"

taxes: {
  calculators: {
    indonesia_ppn: ppnCalculator(),
  },
}

The calculator returns no lines for a non-ID address. For Indonesian lines it records:

  • the statutory rate and regulation label;
  • ordinary or ppn_luxury category;
  • DPP numerator and denominator;
  • taxable net, computed DPP, and tax amounts;
  • inclusive or exclusive price mode;
  • half-up rupiah rounding; and
  • an explicit ppnbmIncluded: false boundary.

The default ordinary-goods calculation uses the PMK 131/2024 statutory rate and DPP fraction implemented by the package. A ppn_luxury category changes the DPP fraction used for PPN evidence; it does not calculate PPnBM.

Inclusive and exclusive pricing

Choose one price mode deliberately for each host price list:

  • Exclusive: tax is calculated from the line net amount and added as an adjustment.
  • Inclusive: tax is extracted from the customer-facing amount and the persisted evidence records both taxable net and tax.

Do not switch modes during order display or invoice generation. The order adjustment is the historical result; changes to rates or catalog classification apply to a new calculation, not an already placed order.

Export monthly audit evidence

node ace commerce:id:ppn-audit --month 2026-08

The CSV reconciles persisted tax adjustments by placed order and includes the schema version, order state, category, price mode, statutory rate, DPP fraction, computed DPP, tax amount, currency, and regulation. Generation fails if adjustment metadata does not reconcile with the stored tax amount.

Treat the export as engineering and accounting evidence, not a tax filing. The host remains responsible for taxable-person status, product classification, invoices, credits, returns, filing periods, certified e-Faktur/Coretax integration, and legal interpretation.

Launch checks

  1. Test representative inclusive and exclusive lines with the merchant’s accountant-approved expected results.
  2. Include discounts, shipping, returns, refunds, and rounding boundaries in reconciliation fixtures.
  3. Confirm every Indonesian amount is stored and serialized as exponent-0 IDR.
  4. Generate the audit CSV for a controlled month and reconcile it to persisted order adjustments.
  5. Document PPnBM and Coretax as host-owned integrations unless separately implemented and reviewed.

Continue

Navigation

Type to search…

↑↓ navigate↵ selectEsc close