This is the abridged developer documentation for thai-qr-payment
# thai-qr-payment
> Spec-faithful Thai QR Payment for JS — payload, QR, SVG card, React, CLI. Zero deps.
import { Card, CardGrid, Code } from '@astrojs/starlight/components';
## Why this exists
Every other Thai QR library on npm wraps the [`qrcode`](https://www.npmjs.com/package/qrcode) package, ties you to Node-only APIs, or ships a 30 KB blob. This one is in-house TypeScript end-to-end:
No `qrcode`, no `canvas`, no `crc16`. `npm install thai-qr-payment` pulls **one** tarball.
Browsers, Node ≥ 18, Bun, Deno, Cloudflare Workers, Vercel Edge — same bundle.
Full bundle 13.6 KB brotli. Payload-only sub-path 3 KB.
EMVCo MPM 1.1 + Bank of Thailand supplement, ISO/IEC 18004 QR Model 2, 337 vitest tests in the
payload package alone.
`` and `` SSR-safe, peer-dep React.
`npx thai-qr-payment 0812345678 --amount 50 -o qr.svg`
Bank-account PromptPay, OTA credit transfer, [TrueMoney Wallet QR](/guide/payload/), [VAT
TQRC](/reference/spec/#vat-tqrc-template-under-tag-80), cross-border bill payment, [Slip Verify
Mini-QR](/guide/slip-verify/), [BOT 1D barcode](/guide/barcode/).
## Quickstart

[→ Try it without installing](/demo/)
# colorLogo
> **colorLogo**(`name`): `string`
Defined in: [index.ts:39](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/index.ts#L39)
Get a color logo by name (returns the SVG string).
## Parameters
### name
`"PromptPay1"` \| `"PromptPay2"` \| `"Thai_QR_Payment_Logo-01"`
## Returns
`string`
# silhouetteLogo
> **silhouetteLogo**(`name`): `string`
Defined in: [index.ts:44](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/index.ts#L44)
Get a silhouette logo by name.
## Parameters
### name
`"PromptPay1"` \| `"Thai_QR_Payment_Logo-01"`
## Returns
`string`
# @thai-qr-payment/assets
## Type Aliases
- [ColorLogoName](/api/assets/typealiascolorlogoname/)
- [SilhouetteLogoName](/api/assets/typealiassilhouettelogoname/)
## Variables
- [COLOR\_LOGOS](/api/assets/variablecolor_logos/)
- [DEFAULT\_LOGOS](/api/assets/variabledefault_logos/)
- [SILHOUETTE\_LOGOS](/api/assets/variablesilhouette_logos/)
## Functions
- [colorLogo](/api/assets/functioncolorlogo/)
- [silhouetteLogo](/api/assets/functionsilhouettelogo/)
# ColorLogoName
> **ColorLogoName** = keyof *typeof* [`COLOR_LOGOS`](/api/assets/variablecolor_logos/)
Defined in: [generated.ts:21](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/generated.ts#L21)
`@thai-qr-payment/assets` — SVG brand marks for Thai QR Payment.
Each mark ships in two flavors:
- `COLOR_LOGOS[name]` — full-colour SVG path traced via vtracer.
True vector (no embedded raster), small enough to inline anywhere.
- `SILHOUETTE_LOGOS[name]` — monochrome path traced via potrace.
Even smaller, suitable for masks / icons / dark mode.
Only the canonical marks ship by default — `Thai_QR_Payment_Logo-01`
(the BOT/TBA primary Thai QR Payment logo) and `PromptPay1` (the
National ITMX PromptPay mark). If you need an alternative layout,
trace your own asset via the supplied `scripts/build-assets.sh` and
drop the result into `packages/assets/src/svg/`.
All exports are plain SVG strings — drop them into innerHTML, write
them to disk, or serve them with `Content-Type: image/svg+xml`.
Marks belong to their respective rights-holders:
- Thai QR Payment logo — Bank of Thailand / Thai Bankers' Association
- PromptPay logo — Bank of Thailand / National ITMX
Use of these marks is governed by Thai QR Payment Brand Guidelines.
This package merely redistributes the bitmap → SVG conversion;
downstream apps must comply with the official brand book.
# SilhouetteLogoName
> **SilhouetteLogoName** = keyof *typeof* [`SILHOUETTE_LOGOS`](/api/assets/variablesilhouette_logos/)
Defined in: [generated.ts:22](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/generated.ts#L22)
`@thai-qr-payment/assets` — SVG brand marks for Thai QR Payment.
Each mark ships in two flavors:
- `COLOR_LOGOS[name]` — full-colour SVG path traced via vtracer.
True vector (no embedded raster), small enough to inline anywhere.
- `SILHOUETTE_LOGOS[name]` — monochrome path traced via potrace.
Even smaller, suitable for masks / icons / dark mode.
Only the canonical marks ship by default — `Thai_QR_Payment_Logo-01`
(the BOT/TBA primary Thai QR Payment logo) and `PromptPay1` (the
National ITMX PromptPay mark). If you need an alternative layout,
trace your own asset via the supplied `scripts/build-assets.sh` and
drop the result into `packages/assets/src/svg/`.
All exports are plain SVG strings — drop them into innerHTML, write
them to disk, or serve them with `Content-Type: image/svg+xml`.
Marks belong to their respective rights-holders:
- Thai QR Payment logo — Bank of Thailand / Thai Bankers' Association
- PromptPay logo — Bank of Thailand / National ITMX
Use of these marks is governed by Thai QR Payment Brand Guidelines.
This package merely redistributes the bitmap → SVG conversion;
downstream apps must comply with the official brand book.
# COLOR_LOGOS
> `const` **COLOR\_LOGOS**: `object`
Defined in: [generated.ts:10](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/generated.ts#L10)
`@thai-qr-payment/assets` — SVG brand marks for Thai QR Payment.
Each mark ships in two flavors:
- `COLOR_LOGOS[name]` — full-colour SVG path traced via vtracer.
True vector (no embedded raster), small enough to inline anywhere.
- `SILHOUETTE_LOGOS[name]` — monochrome path traced via potrace.
Even smaller, suitable for masks / icons / dark mode.
Only the canonical marks ship by default — `Thai_QR_Payment_Logo-01`
(the BOT/TBA primary Thai QR Payment logo) and `PromptPay1` (the
National ITMX PromptPay mark). If you need an alternative layout,
trace your own asset via the supplied `scripts/build-assets.sh` and
drop the result into `packages/assets/src/svg/`.
All exports are plain SVG strings — drop them into innerHTML, write
them to disk, or serve them with `Content-Type: image/svg+xml`.
Marks belong to their respective rights-holders:
- Thai QR Payment logo — Bank of Thailand / Thai Bankers' Association
- PromptPay logo — Bank of Thailand / National ITMX
Use of these marks is governed by Thai QR Payment Brand Guidelines.
This package merely redistributes the bitmap → SVG conversion;
downstream apps must comply with the official brand book.
## Type Declaration
### PromptPay1
> `readonly` **PromptPay1**: "\"
### PromptPay2
> `readonly` **PromptPay2**: "\"
### Thai\_QR\_Payment\_Logo-01
> `readonly` **Thai\_QR\_Payment\_Logo-01**: "\" = `Thai_QR_Payment_Logo_01`
# DEFAULT_LOGOS
> `const` **DEFAULT\_LOGOS**: `object`
Defined in: [index.ts:49](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/index.ts#L49)
Default mark recommendations for downstream use.
## Type Declaration
### promptpay
> `readonly` **promptpay**: `"PromptPay1"` = `'PromptPay1'`
### promptpaySilhouette
> `readonly` **promptpaySilhouette**: `"PromptPay1"` = `'PromptPay1'`
### thaiQrPayment
> `readonly` **thaiQrPayment**: `"Thai_QR_Payment_Logo-01"` = `'Thai_QR_Payment_Logo-01'`
### thaiQrPaymentSilhouette
> `readonly` **thaiQrPaymentSilhouette**: `"Thai_QR_Payment_Logo-01"` = `'Thai_QR_Payment_Logo-01'`
# SILHOUETTE_LOGOS
> `const` **SILHOUETTE\_LOGOS**: `object`
Defined in: [generated.ts:16](https://github.com/uunw/thai-qr-payment/blob/main/packages/assets/src/generated.ts#L16)
`@thai-qr-payment/assets` — SVG brand marks for Thai QR Payment.
Each mark ships in two flavors:
- `COLOR_LOGOS[name]` — full-colour SVG path traced via vtracer.
True vector (no embedded raster), small enough to inline anywhere.
- `SILHOUETTE_LOGOS[name]` — monochrome path traced via potrace.
Even smaller, suitable for masks / icons / dark mode.
Only the canonical marks ship by default — `Thai_QR_Payment_Logo-01`
(the BOT/TBA primary Thai QR Payment logo) and `PromptPay1` (the
National ITMX PromptPay mark). If you need an alternative layout,
trace your own asset via the supplied `scripts/build-assets.sh` and
drop the result into `packages/assets/src/svg/`.
All exports are plain SVG strings — drop them into innerHTML, write
them to disk, or serve them with `Content-Type: image/svg+xml`.
Marks belong to their respective rights-holders:
- Thai QR Payment logo — Bank of Thailand / Thai Bankers' Association
- PromptPay logo — Bank of Thailand / National ITMX
Use of these marks is governed by Thai QR Payment Brand Guidelines.
This package merely redistributes the bitmap → SVG conversion;
downstream apps must comply with the official brand book.
## Type Declaration
### PromptPay1
> `readonly` **PromptPay1**: "\" = `PromptPay1_silhouette`
### Thai\_QR\_Payment\_Logo-01
> `readonly` **Thai\_QR\_Payment\_Logo-01**: "\" = `Thai_QR_Payment_Logo_01_silhouette`
# ThaiQRPaymentBuilder
Defined in: [builder.ts:127](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L127)
Thai QR Payment payload builder.
Three terminal methods:
- `.build()` returns the wire-format string ready for QR encoding.
- `.buildWithChecksum()` returns both the body and the checksum
separately — useful for debugging the CRC step.
- `.toBytes()` returns a `Uint8Array` of the ASCII-encoded payload
for callers that want to hash or sign it.
## Constructors
### Constructor
> **new ThaiQRPaymentBuilder**(): `ThaiQRPaymentBuilder`
Defined in: [builder.ts:136](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L136)
#### Returns
`ThaiQRPaymentBuilder`
## Methods
### additionalData()
> **additionalData**(`fields`): `this`
Defined in: [builder.ts:304](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L304)
Set sub-fields of the additional-data template (tag 62).
#### Parameters
##### fields
[`AdditionalDataFields`](/api/payload/interfaceadditionaldatafields/)
#### Returns
`this`
***
### amount()
> **amount**(`value`, `options?`): `this`
Defined in: [builder.ts:276](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L276)
Set the transaction amount in baht. Pass `{fromSatang: true}` to
supply integer satang instead. Omit / pass `undefined` to keep the
QR static (the consumer's banking app will prompt for an amount).
#### Parameters
##### value
`number` \| `bigint` \| `undefined`
##### options?
[`FormatAmountOptions`](/api/payload/interfaceformatamountoptions/)
#### Returns
`this`
***
### bankAccount()
> **bankAccount**(`bankCode`, `accountNo`): `this`
Defined in: [builder.ts:167](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L167)
Configure a PromptPay credit transfer to a bank account (sub-tag 04).
`bankCode` is the 3-digit BoT bank identifier; `accountNo` is the
variable-length numeric account.
#### Parameters
##### bankCode
`string`
##### accountNo
`string`
#### Returns
`this`
#### Example
```ts
new ThaiQRPaymentBuilder().bankAccount('014', '1234567890').amount(100).build()
```
***
### billPayment()
> **billPayment**(`input`): `this`
Defined in: [builder.ts:251](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L251)
Configure a BillPayment recipient (Cross-Bank BillPayment / R-Bill).
Pass `crossBorder: true` to emit the ASEAN-region remittance AID
(`A000000677012006`) instead of the domestic one (`A000000677010112`).
The template layout is otherwise identical — same sub-tags, same
value rules. Pair with the `purposeOfTransaction` additional-data
field (tag 62 sub-tag 08), which carries an 18-char triple in this
mode: currencyCode (3 digits) + localAmount (13 digits) +
countryCode (2 digits). The builder treats that field as opaque;
compose / parse the triple at the call site.
#### Parameters
##### input
###### billerId
`string`
###### crossBorder?
`boolean`
###### reference1?
`string`
###### reference2?
`string`
#### Returns
`this`
***
### build()
> **build**(): `string`
Defined in: [builder.ts:394](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L394)
Render the full wire-format payload with checksum appended.
#### Returns
`string`
***
### buildWithChecksum()
> **buildWithChecksum**(): `object`
Defined in: [builder.ts:442](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L442)
Render and split the body/CRC for inspection.
#### Returns
`object`
##### body
> **body**: `string`
##### checksum
> **checksum**: `string`
##### payload
> **payload**: `string`
***
### merchant()
> **merchant**(`info`): `this`
Defined in: [builder.ts:295](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L295)
Set merchant display info (tags 52, 59, 60, 61).
#### Parameters
##### info
[`MerchantInfo`](/api/payload/interfacemerchantinfo/)
#### Returns
`this`
***
### ota()
> **ota**(`otaCode`): `this`
Defined in: [builder.ts:182](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L182)
Attach a One-Time Authorization code (sub-tag 05, fixed 10 chars).
Flips the merchant template's AID from the standard PromptPay GUID to
the OTA GUID so scanners route the payload to the single-use flow.
#### Parameters
##### otaCode
`string`
#### Returns
`this`
#### Example
```ts
new ThaiQRPaymentBuilder().promptpay('0812345678').ota('1234567890').amount(50).build()
```
***
### pointOfInitiation()
> **pointOfInitiation**(`method`): `this`
Defined in: [builder.ts:339](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L339)
Force the point-of-initiation flag regardless of amount presence.
#### Parameters
##### method
`"static"` \| `"dynamic"`
#### Returns
`this`
***
### promptpay()
> **promptpay**(`recipient`, `type?`): `this`
Defined in: [builder.ts:149](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L149)
Configure a PromptPay recipient (mobile, national ID, or e-wallet).
Overrides any previously-set BillPayment / KShop template. Use
`.bankAccount()` for credit-transfer payloads — its wire value needs
the (bankCode, accountNo) split this single-string form cannot carry.
#### Parameters
##### recipient
`string`
##### type?
[`PromptPayRecipientType`](/api/payload/typealiaspromptpayrecipienttype/)
#### Returns
`this`
***
### tipPolicy()
> **tipPolicy**(`mode`): `this`
Defined in: [builder.ts:289](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L289)
Set the tip / convenience-fee policy (tags 55-57).
#### Parameters
##### mode
[`TipMode`](/api/payload/typealiastipmode/) \| `undefined`
#### Returns
`this`
***
### toBytes()
> **toBytes**(): `Uint8Array`
Defined in: [builder.ts:452](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L452)
UTF-8 byte view of the payload — useful for hashing or transport.
#### Returns
`Uint8Array`
***
### trueMoney()
> **trueMoney**(`mobileNo`, `options?`): `this`
Defined in: [builder.ts:213](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L213)
Configure a TrueMoney Wallet recipient. Same merchant template tag
(29) as PromptPay but with the literal `14` prefix on sub-tag 03 so
the TrueMoney app can disambiguate its own payloads from a plain
e-wallet QR. The mobile is zero-padded on the left to 13 digits
before the prefix is added (final value length is always 15).
The optional `message` is carried in tag 81 (UTF-16BE hex) and is
surfaced inside the TrueMoney app only; other scanners ignore it.
#### Parameters
##### mobileNo
`string`
##### options?
###### amount?
`number`
###### message?
`string`
#### Returns
`this`
***
### vatTqrc()
> **vatTqrc**(`input`): `this`
Defined in: [builder.ts:318](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L318)
Attach the Bank of Thailand VAT TQRC extension (tag 80). Promotes the
payment QR to an e-tax-receipt source. Pass `undefined` to clear.
Field-length rules come from the BOT extension spec:
- `sellerTaxBranchId` is exactly 4 characters
- `vatRate` is 1–5 characters when present (e.g. "7" or "7.00")
- `vatAmount` is 1–13 characters and required
#### Parameters
##### input
[`VATTQRCInput`](/api/payload/interfacevattqrcinput/) \| `undefined`
#### Returns
`this`
# buildBOTBarcode
> **buildBOTBarcode**(`input`): `string`
Defined in: [barcode.ts:69](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L69)
Build a BOT 1D bill-payment barcode payload.
Throws `TypeError` / `RangeError` for malformed input — the caller
never silently produces an unscannable barcode.
## Parameters
### input
[`BOTBarcodeInput`](/api/payload/interfacebotbarcodeinput/)
## Returns
`string`
## Examples
```ts
buildBOTBarcode({ billerId: '099999999999990', ref1: '111222333444' })
// → '|099999999999990\r111222333444\r\r0'
```
```ts
buildBOTBarcode({
billerId: '099400016550100',
ref1: '123456789012',
ref2: '670429',
amount: 3649.22,
})
// → '|099400016550100\r123456789012\r670429\r364922'
```
# buildSlipVerify
> **buildSlipVerify**(`input`): `string`
Defined in: [slip-verify.ts:83](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L83)
Build a Slip Verify Mini-QR payload. The output is a TLV string ending
in a tag-91 CRC (uppercase hex), suitable for embedding in a printed
slip and looking the transaction up via bank Open APIs.
## Parameters
### input
[`SlipVerifyInput`](/api/payload/interfaceslipverifyinput/)
## Returns
`string`
## Example
```ts
buildSlipVerify({ sendingBank: '002', transRef: '0002123123121200011' })
// → '004000060000010103002021900021231231212000115102TH91049C30'
```
# buildTrueMoneySlipVerify
> **buildTrueMoneySlipVerify**(`input`): `string`
Defined in: [slip-verify.ts:142](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L142)
Build a TrueMoney Slip Verify Mini-QR payload. Uses the same TLV
envelope as the standard variant but with a different sub-tag layout
and a **lowercase** hex CRC at tag 91.
## Parameters
### input
[`TrueMoneySlipVerifyInput`](/api/payload/interfacetruemoneyslipverifyinput/)
## Returns
`string`
## Example
```ts
buildTrueMoneySlipVerify({ eventType: 'P2P', transactionId: 'TXN0001234567', date: '25012024' })
// → '00480002010102010203P2P0313TXN00012345670408250120249104b425'
```
# checksum
> **checksum**(`input`): `string`
Defined in: [crc.ts:28](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/crc.ts#L28)
Compute the CRC-16/CCITT-FALSE checksum of an ASCII-encoded payload
and return it as a 4-character uppercase hex string. The EMVCo spec
requires the trailing zero-padding to keep the QR payload length stable.
## Parameters
### input
`string`
## Returns
`string`
# decodePersonalMessage
> **decodePersonalMessage**(`hex`): `string`
Defined in: [message.ts:23](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/message.ts#L23)
Decode a UTF-16BE hex string back to its source message.
## Parameters
### hex
`string`
## Returns
`string`
# encodeField
> **encodeField**(`tag`, `value`): `string`
Defined in: [tlv.ts:17](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L17)
Encode one TLV. The caller guarantees that `tag` is a valid 2-digit id.
## Parameters
### tag
`string`
### value
`string`
## Returns
`string`
# encodeFields
> **encodeFields**(`pairs`): `string`
Defined in: [tlv.ts:32](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L32)
Encode an array of `[tag, value]` pairs in registration order. Empty or
`null`/`undefined` values are filtered out so callers can compose
optional fields without an `if` chain.
## Parameters
### pairs
readonly readonly \[`string`, `string` \| `null` \| `undefined`\][]
## Returns
`string`
# encodePersonalMessage
> **encodePersonalMessage**(`message`): `string`
Defined in: [message.ts:13](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/message.ts#L13)
Encode a personal message string to UTF-16BE hex (uppercase).
## Parameters
### message
`string`
## Returns
`string`
# formatAmount
> **formatAmount**(`value`, `options?`): `string` \| `null`
Defined in: [amount.ts:21](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/amount.ts#L21)
Format an amount for the wire. Returns `null` for static QR (caller
intends a "scan and enter any amount" code).
## Parameters
### value
`number` \| `bigint` \| `null` \| `undefined`
### options?
[`FormatAmountOptions`](/api/payload/interfaceformatamountoptions/) = `{}`
## Returns
`string` \| `null`
# iterateFields
> **iterateFields**(`input`): `IterableIterator`\<[`TLVField`](/api/payload/interfacetlvfield/)\>
Defined in: [tlv.ts:50](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L50)
Walk a TLV-encoded string and return one field at a time. Stops cleanly
at end-of-input; throws on malformed length headers or truncated values.
Designed for parsing both the root payload and nested template values
— the same algorithm applies at any depth.
## Parameters
### input
`string`
## Returns
`IterableIterator`\<[`TLVField`](/api/payload/interfacetlvfield/)\>
# normaliseBankAccount
> **normaliseBankAccount**(`bankCode`, `accountNo`): [`NormalisedRecipient`](/api/payload/interfacenormalisedrecipient/)
Defined in: [recipient.ts:96](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L96)
Format a bank-account recipient for sub-tag 04 under the PromptPay
merchant template. The wire value is the 3-digit bank code followed by
the (variable-length, numeric) account number; total length must fit
EMVCo's 1–43-character cap on the sub-tag.
## Parameters
### bankCode
`string`
### accountNo
`string`
## Returns
[`NormalisedRecipient`](/api/payload/interfacenormalisedrecipient/)
## Example
```ts
normaliseBankAccount('014', '1234567890')
// → { subTag: '04', value: '0141234567890', type: 'bankAccount' }
```
# normaliseRecipient
> **normaliseRecipient**(`raw`, `explicit?`): [`NormalisedRecipient`](/api/payload/interfacenormalisedrecipient/)
Defined in: [recipient.ts:58](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L58)
Decide the recipient type from the digit count, then format the wire
value. Explicit `type` arg overrides the inference — useful if a
national ID happens to look like a long e-wallet id or vice versa.
Pass `'bankAccount'` to `normaliseBankAccount` instead; it needs two
pieces (bank code + account number) the single-string form can't carry.
## Parameters
### raw
`string`
### explicit?
`"mobile"` \| `"nationalId"` \| `"eWallet"`
## Returns
[`NormalisedRecipient`](/api/payload/interfacenormalisedrecipient/)
# parseBOTBarcode
> **parseBOTBarcode**(`barcode`): [`ParsedBOTBarcode`](/api/payload/interfaceparsedbotbarcode/) \| `null`
Defined in: [barcode.ts:108](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L108)
Parse a BOT 1D bill-payment barcode back into its component fields.
Returns `null` for any structural issue (missing prefix, wrong field
count, biller-id too short) so callers can branch without `try/catch`.
The trailing amount is decoded back to baht (e.g. `'364922'` → `3649.22`),
and the literal "0" sentinel surfaces as `undefined`.
## Parameters
### barcode
`string`
## Returns
[`ParsedBOTBarcode`](/api/payload/interfaceparsedbotbarcode/) \| `null`
## Examples
```ts
parseBOTBarcode('|099999999999990\r111222333444\r\r0')
// → { billerId: '099999999999990', ref1: '111222333444' }
```
```ts
parseBOTBarcode('|099400016550100\r123456789012\r670429\r364922')
// → {
// billerId: '099400016550100',
// ref1: '123456789012',
// ref2: '670429',
// amount: 3649.22,
// }
```
# parseFields
> **parseFields**(`input`): `Map`\<`string`, `string`\>
Defined in: [tlv.ts:75](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L75)
Convenience over `iterateFields` — collect into a Map by tag id.
## Parameters
### input
`string`
## Returns
`Map`\<`string`, `string`\>
# parsePayload
> **parsePayload**(`payload`, `options?`): [`ParsedPayload`](/api/payload/interfaceparsedpayload/)
Defined in: [parser.ts:372](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L372)
Parse a wire-format payload. By default throws on structural errors or
a hard checksum mismatch (with truncated-CRC auto-fix applied when
possible). In `strict: true` mode also throws when the CRC tag is
missing or its value fails to match.
## Parameters
### payload
`string`
### options?
[`ParsePayloadOptions`](/api/payload/interfaceparsepayloadoptions/) = `{}`
## Returns
[`ParsedPayload`](/api/payload/interfaceparsedpayload/)
# parseSlipVerify
> **parseSlipVerify**(`payload`): [`ParsedSlipVerify`](/api/payload/interfaceparsedslipverify/) \| `null`
Defined in: [slip-verify.ts:104](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L104)
Parse a Slip Verify Mini-QR payload. Returns `null` for any string that
isn't a valid slip-verify envelope — wrong root tag, wrong CRC tag, or
checksum mismatch. CRCs of 1-3 hex chars are auto-padded with leading
zeros (some bank apps drop characters when re-encoding).
## Parameters
### payload
`string`
## Returns
[`ParsedSlipVerify`](/api/payload/interfaceparsedslipverify/) \| `null`
## Example
```ts
parseSlipVerify('004000060000010103002021900021231231212000115102TH91049C30')
// → { sendingBank: '002', transRef: '0002123123121200011' }
```
# parseTrueMoneySlipVerify
> **parseTrueMoneySlipVerify**(`payload`): [`ParsedTrueMoneySlipVerify`](/api/payload/interfaceparsedtruemoneyslipverify/) \| `null`
Defined in: [slip-verify.ts:170](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L170)
Parse a TrueMoney Slip Verify Mini-QR payload. Returns `null` for any
string that doesn't carry the TrueMoney marker pair (sub-tags 00 + 01
both `'01'`) or whose CRC fails to verify. Comparison is
case-insensitive; truncated CRCs (1-3 chars) are auto-padded.
## Parameters
### payload
`string`
## Returns
[`ParsedTrueMoneySlipVerify`](/api/payload/interfaceparsedtruemoneyslipverify/) \| `null`
## Example
```ts
parseTrueMoneySlipVerify('00480002010102010203P2P0313TXN00012345670408250120249104b425')
// → { eventType: 'P2P', transactionId: 'TXN0001234567', date: '25012024' }
```
# payloadFor
> **payloadFor**(`input`): `string`
Defined in: [index.ts:67](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/index.ts#L67)
Shorthand for the common "make me a PromptPay QR for this recipient
with this amount" use case. Returns the wire payload string.
## Parameters
### input
#### amount?
`number`
#### fromSatang?
`boolean`
#### recipient
`string`
#### type?
[`PromptPayRecipientType`](/api/payload/typealiaspromptpayrecipienttype/)
## Returns
`string`
## Example
```ts
payloadFor({ recipient: '0812345678', amount: 100 })
// → '00020101021229370016A00000067701011101130066812345678530376454...'
```
# AdditionalDataFields
Defined in: [builder.ts:80](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L80)
## Properties
### billNumber?
> `optional` **billNumber?**: `string`
Defined in: [builder.ts:81](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L81)
***
### consumerDataRequest?
> `optional` **consumerDataRequest?**: `string`
Defined in: [builder.ts:89](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L89)
***
### customerLabel?
> `optional` **customerLabel?**: `string`
Defined in: [builder.ts:86](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L86)
***
### loyaltyNumber?
> `optional` **loyaltyNumber?**: `string`
Defined in: [builder.ts:84](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L84)
***
### mobileNumber?
> `optional` **mobileNumber?**: `string`
Defined in: [builder.ts:82](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L82)
***
### purposeOfTransaction?
> `optional` **purposeOfTransaction?**: `string`
Defined in: [builder.ts:88](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L88)
***
### referenceLabel?
> `optional` **referenceLabel?**: `string`
Defined in: [builder.ts:85](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L85)
***
### storeLabel?
> `optional` **storeLabel?**: `string`
Defined in: [builder.ts:83](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L83)
***
### terminalLabel?
> `optional` **terminalLabel?**: `string`
Defined in: [builder.ts:87](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L87)
# BOTBarcodeInput
Defined in: [barcode.ts:29](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L29)
## Properties
### amount?
> `optional` **amount?**: `number`
Defined in: [barcode.ts:40](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L40)
Baht amount. Omit (or pass `undefined`) for a counter-keyed total —
the literal "0" is then written and the cashier types the amount.
***
### billerId
> **billerId**: `string`
Defined in: [barcode.ts:31](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L31)
Cross-bank biller id (Tax ID + suffix). ≤ 15 chars, zero-padded on emit.
***
### ref1
> **ref1**: `string`
Defined in: [barcode.ts:33](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L33)
Customer / invoice reference. Must be non-empty.
***
### ref2?
> `optional` **ref2?**: `string`
Defined in: [barcode.ts:35](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L35)
Optional secondary reference. Empty string on the wire if omitted.
# FormatAmountOptions
Defined in: [amount.ts:12](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/amount.ts#L12)
## Properties
### fromSatang?
> `optional` **fromSatang?**: `boolean`
Defined in: [amount.ts:14](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/amount.ts#L14)
When true, treat the input as integer satang (1 baht = 100 satang).
# MerchantInfo
Defined in: [builder.ts:97](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L97)
## Properties
### categoryCode?
> `optional` **categoryCode?**: `string`
Defined in: [builder.ts:105](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L105)
4-digit Merchant Category Code from ISO 18245.
***
### city?
> `optional` **city?**: `string`
Defined in: [builder.ts:101](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L101)
Up to 15 alphanumeric characters.
***
### name?
> `optional` **name?**: `string`
Defined in: [builder.ts:99](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L99)
Up to 25 alphanumeric characters; truncated by the builder.
***
### postalCode?
> `optional` **postalCode?**: `string`
Defined in: [builder.ts:103](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L103)
Up to 10 chars.
# NormalisedRecipient
Defined in: [recipient.ts:20](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L20)
## Properties
### subTag
> `readonly` **subTag**: `"01"` \| `"02"` \| `"03"` \| `"04"`
Defined in: [recipient.ts:21](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L21)
***
### type
> `readonly` **type**: [`PromptPayRecipientType`](/api/payload/typealiaspromptpayrecipienttype/)
Defined in: [recipient.ts:27](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L27)
***
### value
> `readonly` **value**: `string`
Defined in: [recipient.ts:26](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L26)
# ParsedAdditionalData
Defined in: [parser.ts:111](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L111)
## Properties
### billNumber?
> `optional` **billNumber?**: `string`
Defined in: [parser.ts:112](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L112)
***
### consumerDataRequest?
> `optional` **consumerDataRequest?**: `string`
Defined in: [parser.ts:120](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L120)
***
### customerLabel?
> `optional` **customerLabel?**: `string`
Defined in: [parser.ts:117](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L117)
***
### loyaltyNumber?
> `optional` **loyaltyNumber?**: `string`
Defined in: [parser.ts:115](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L115)
***
### mobileNumber?
> `optional` **mobileNumber?**: `string`
Defined in: [parser.ts:113](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L113)
***
### purposeOfTransaction?
> `optional` **purposeOfTransaction?**: `string`
Defined in: [parser.ts:119](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L119)
***
### referenceLabel?
> `optional` **referenceLabel?**: `string`
Defined in: [parser.ts:116](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L116)
***
### storeLabel?
> `optional` **storeLabel?**: `string`
Defined in: [parser.ts:114](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L114)
***
### terminalLabel?
> `optional` **terminalLabel?**: `string`
Defined in: [parser.ts:118](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L118)
# ParsedBillPayment
Defined in: [parser.ts:90](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L90)
## Properties
### billerId
> `readonly` **billerId**: `string`
Defined in: [parser.ts:92](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L92)
***
### crossBorder
> `readonly` **crossBorder**: `boolean`
Defined in: [parser.ts:102](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L102)
`true` when the merchant template uses the ASEAN cross-border AID
(`A000000677012006`). In that mode the `purposeOfTransaction` field
(tag 62 sub-tag 08) carries an 18-char triple of currency + local
amount + country; the parser surfaces it verbatim under
`additionalData.purposeOfTransaction`.
***
### kind
> `readonly` **kind**: `"billPayment"`
Defined in: [parser.ts:91](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L91)
***
### reference1?
> `readonly` `optional` **reference1?**: `string`
Defined in: [parser.ts:93](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L93)
***
### reference2?
> `readonly` `optional` **reference2?**: `string`
Defined in: [parser.ts:94](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L94)
# ParsedBOTBarcode
Defined in: [barcode.ts:43](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L43)
## Properties
### amount?
> `optional` **amount?**: `number`
Defined in: [barcode.ts:47](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L47)
***
### billerId
> **billerId**: `string`
Defined in: [barcode.ts:44](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L44)
***
### ref1
> **ref1**: `string`
Defined in: [barcode.ts:45](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L45)
***
### ref2?
> `optional` **ref2?**: `string`
Defined in: [barcode.ts:46](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/barcode.ts#L46)
# ParsedCRC
Defined in: [parser.ts:131](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L131)
Bookkeeping for the trailing checksum — useful when reporting auto-fix.
## Properties
### truncated
> `readonly` **truncated**: `boolean`
Defined in: [parser.ts:137](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L137)
True when zero-padding was needed to recover a valid CRC.
***
### valid
> `readonly` **valid**: `boolean`
Defined in: [parser.ts:135](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L135)
True when the wire CRC matches the recomputed value (possibly after padding).
***
### value
> `readonly` **value**: `string`
Defined in: [parser.ts:133](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L133)
The CRC text as it appeared on the wire (may be 1–4 chars).
# ParsedPayload
Defined in: [parser.ts:140](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L140)
## Properties
### additionalData?
> `readonly` `optional` **additionalData?**: [`ParsedAdditionalData`](/api/payload/interfaceparsedadditionaldata/)
Defined in: [parser.ts:151](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L151)
***
### amount
> `readonly` **amount**: `number` \| `null`
Defined in: [parser.ts:144](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L144)
***
### country
> `readonly` **country**: `string`
Defined in: [parser.ts:146](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L146)
***
### crc
> `readonly` **crc**: [`ParsedCRC`](/api/payload/interfaceparsedcrc/)
Defined in: [parser.ts:153](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L153)
***
### currency
> `readonly` **currency**: `string`
Defined in: [parser.ts:145](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L145)
***
### merchant
> `readonly` **merchant**: [`ParsedPromptPay`](/api/payload/interfaceparsedpromptpay/) \| [`ParsedBillPayment`](/api/payload/interfaceparsedbillpayment/) \| [`ParsedTrueMoney`](/api/payload/interfaceparsedtruemoney/) \| `null`
Defined in: [parser.ts:143](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L143)
***
### merchantCategoryCode?
> `readonly` `optional` **merchantCategoryCode?**: `string`
Defined in: [parser.ts:149](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L149)
***
### merchantCity?
> `readonly` `optional` **merchantCity?**: `string`
Defined in: [parser.ts:148](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L148)
***
### merchantName?
> `readonly` `optional` **merchantName?**: `string`
Defined in: [parser.ts:147](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L147)
***
### payloadFormat
> `readonly` **payloadFormat**: `string`
Defined in: [parser.ts:141](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L141)
***
### pointOfInitiation
> `readonly` **pointOfInitiation**: `"static"` \| `"dynamic"`
Defined in: [parser.ts:142](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L142)
***
### postalCode?
> `readonly` `optional` **postalCode?**: `string`
Defined in: [parser.ts:150](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L150)
***
### rawTags
> `readonly` **rawTags**: readonly [`TLVField`](/api/payload/interfacetlvfield/)[]
Defined in: [parser.ts:155](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L155)
All top-level TLV fields, in wire order. Use for unknown / future tags.
***
### vatTqrc?
> `readonly` `optional` **vatTqrc?**: [`ParsedVATTQRC`](/api/payload/interfaceparsedvattqrc/)
Defined in: [parser.ts:152](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L152)
## Methods
### getTag()
> **getTag**(`id`): [`TLVField`](/api/payload/interfacetlvfield/) \| `undefined`
Defined in: [parser.ts:157](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L157)
Lookup a top-level TLV field by id. Returns `undefined` if absent.
#### Parameters
##### id
`string`
#### Returns
[`TLVField`](/api/payload/interfacetlvfield/) \| `undefined`
***
### getTagValue()
> **getTagValue**(`id`, `subId?`): `string` \| `undefined`
Defined in: [parser.ts:163](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L163)
Lookup a value by id. Pass `subId` to descend one level into a nested
template (tags 29–31, 62, 64 are templated). Returns `undefined` if
either the parent or the sub-field is missing.
#### Parameters
##### id
`string`
##### subId?
`string`
#### Returns
`string` \| `undefined`
# ParsedPromptPay
Defined in: [parser.ts:73](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L73)
## Properties
### accountNo?
> `readonly` `optional` **accountNo?**: `string`
Defined in: [parser.ts:85](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L85)
Account number. Present only when `recipientType === 'bankAccount'`.
***
### bankCode?
> `readonly` `optional` **bankCode?**: `string`
Defined in: [parser.ts:83](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L83)
Bank code (3 digits). Present only when `recipientType === 'bankAccount'`.
***
### kind
> `readonly` **kind**: `"promptpay"`
Defined in: [parser.ts:74](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L74)
***
### ota?
> `readonly` `optional` **ota?**: `string`
Defined in: [parser.ts:87](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L87)
One-Time Authorization code from sub-tag 05. Present only on OTA payloads.
***
### recipient
> `readonly` **recipient**: `string`
Defined in: [parser.ts:81](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L81)
Wire value for the recipient sub-tag. For `bankAccount` this is the
full `bankCode + accountNo` concatenation — split fields are exposed
separately below.
***
### recipientType
> `readonly` **recipientType**: [`PromptPayRecipientType`](/api/payload/typealiaspromptpayrecipienttype/)
Defined in: [parser.ts:75](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L75)
# ParsedSlipVerify
Defined in: [slip-verify.ts:52](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L52)
Decoded payload from `parseSlipVerify`.
## Properties
### sendingBank
> `readonly` **sendingBank**: `string`
Defined in: [slip-verify.ts:53](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L53)
***
### transRef
> `readonly` **transRef**: `string`
Defined in: [slip-verify.ts:54](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L54)
# ParsedTrueMoney
Defined in: [parser.ts:105](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L105)
## Properties
### kind
> `readonly` **kind**: `"trueMoney"`
Defined in: [parser.ts:106](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L106)
***
### message?
> `readonly` `optional` **message?**: `string`
Defined in: [parser.ts:108](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L108)
***
### mobileNo
> `readonly` **mobileNo**: `string`
Defined in: [parser.ts:107](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L107)
# ParsedTrueMoneySlipVerify
Defined in: [slip-verify.ts:68](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L68)
Decoded payload from `parseTrueMoneySlipVerify`.
## Properties
### date
> `readonly` **date**: `string`
Defined in: [slip-verify.ts:71](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L71)
***
### eventType
> `readonly` **eventType**: `string`
Defined in: [slip-verify.ts:69](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L69)
***
### transactionId
> `readonly` **transactionId**: `string`
Defined in: [slip-verify.ts:70](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L70)
# ParsedVATTQRC
Defined in: [parser.ts:124](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L124)
Decoded VAT TQRC template (tag 80).
## Properties
### sellerTaxBranchId
> `readonly` **sellerTaxBranchId**: `string`
Defined in: [parser.ts:125](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L125)
***
### vatAmount
> `readonly` **vatAmount**: `string`
Defined in: [parser.ts:127](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L127)
***
### vatRate?
> `readonly` `optional` **vatRate?**: `string`
Defined in: [parser.ts:126](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L126)
# ParsePayloadOptions
Defined in: [parser.ts:166](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L166)
## Properties
### strict?
> `readonly` `optional` **strict?**: `boolean`
Defined in: [parser.ts:173](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/parser.ts#L173)
When true, throw if the CRC tag is missing or its on-wire value
doesn't match the recomputed checksum. Defaults to false for
backwards compatibility with callers that need to consume the
truncated-CRC auto-fix path.
# SlipVerifyInput
Defined in: [slip-verify.ts:44](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L44)
Input for `buildSlipVerify`.
## Properties
### sendingBank
> `readonly` **sendingBank**: `string`
Defined in: [slip-verify.ts:46](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L46)
Bank code that issued the slip (e.g. `'002'` for Bangkok Bank).
***
### transRef
> `readonly` **transRef**: `string`
Defined in: [slip-verify.ts:48](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L48)
Transaction reference printed on the slip.
# TLVField
Defined in: [tlv.ts:11](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L11)
A parsed TLV field with its (possibly-nested) value text.
## Properties
### tag
> `readonly` **tag**: `string`
Defined in: [tlv.ts:12](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L12)
***
### value
> `readonly` **value**: `string`
Defined in: [tlv.ts:13](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tlv.ts#L13)
# TrueMoneySlipVerifyInput
Defined in: [slip-verify.ts:58](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L58)
Input for `buildTrueMoneySlipVerify`.
## Properties
### date
> `readonly` **date**: `string`
Defined in: [slip-verify.ts:64](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L64)
Transfer date as a `DDMMYYYY` 8-character string.
***
### eventType
> `readonly` **eventType**: `string`
Defined in: [slip-verify.ts:60](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L60)
Event classification (e.g. `'P2P'`).
***
### transactionId
> `readonly` **transactionId**: `string`
Defined in: [slip-verify.ts:62](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/slip-verify.ts#L62)
Wallet transaction identifier.
# VATTQRCInput
Defined in: [builder.ts:108](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L108)
## Properties
### sellerTaxBranchId
> **sellerTaxBranchId**: `string`
Defined in: [builder.ts:110](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L110)
Seller's tax branch identifier — exactly 4 characters.
***
### vatAmount
> **vatAmount**: `string`
Defined in: [builder.ts:114](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L114)
VAT amount as displayed on the receipt; 1–13 chars, required.
***
### vatRate?
> `optional` **vatRate?**: `string`
Defined in: [builder.ts:112](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L112)
VAT rate as displayed on the receipt (e.g. "7" or "7.00"); 1–5 chars.
# Tags
## Variables
- [COUNTRY\_TH](/api/payload/tagsvariablecountry_th/)
- [CURRENCY\_THB](/api/payload/tagsvariablecurrency_thb/)
- [GUID\_BILL\_PAYMENT](/api/payload/tagsvariableguid_bill_payment/)
- [GUID\_BILL\_PAYMENT\_CROSS\_BORDER](/api/payload/tagsvariableguid_bill_payment_cross_border/)
- [GUID\_PROMPTPAY](/api/payload/tagsvariableguid_promptpay/)
- [GUID\_PROMPTPAY\_OTA](/api/payload/tagsvariableguid_promptpay_ota/)
- [PAYLOAD\_FORMAT\_VERSION](/api/payload/tagsvariablepayload_format_version/)
- [POI\_DYNAMIC](/api/payload/tagsvariablepoi_dynamic/)
- [POI\_STATIC](/api/payload/tagsvariablepoi_static/)
- [SUB\_ADD\_BILL\_NUMBER](/api/payload/tagsvariablesub_add_bill_number/)
- [SUB\_ADD\_CONSUMER\_DATA\_REQUEST](/api/payload/tagsvariablesub_add_consumer_data_request/)
- [SUB\_ADD\_CUSTOMER\_LABEL](/api/payload/tagsvariablesub_add_customer_label/)
- [SUB\_ADD\_LOYALTY\_NUMBER](/api/payload/tagsvariablesub_add_loyalty_number/)
- [SUB\_ADD\_MOBILE\_NUMBER](/api/payload/tagsvariablesub_add_mobile_number/)
- [SUB\_ADD\_PURPOSE\_OF\_TRANSACTION](/api/payload/tagsvariablesub_add_purpose_of_transaction/)
- [SUB\_ADD\_REFERENCE\_LABEL](/api/payload/tagsvariablesub_add_reference_label/)
- [SUB\_ADD\_STORE\_LABEL](/api/payload/tagsvariablesub_add_store_label/)
- [SUB\_ADD\_TERMINAL\_LABEL](/api/payload/tagsvariablesub_add_terminal_label/)
- [SUB\_BILL\_BILLER\_ID](/api/payload/tagsvariablesub_bill_biller_id/)
- [SUB\_BILL\_REFERENCE\_1](/api/payload/tagsvariablesub_bill_reference_1/)
- [SUB\_BILL\_REFERENCE\_2](/api/payload/tagsvariablesub_bill_reference_2/)
- [SUB\_GUID](/api/payload/tagsvariablesub_guid/)
- [SUB\_PROMPTPAY\_BANK\_ACCOUNT](/api/payload/tagsvariablesub_promptpay_bank_account/)
- [SUB\_PROMPTPAY\_EWALLET](/api/payload/tagsvariablesub_promptpay_ewallet/)
- [SUB\_PROMPTPAY\_MOBILE](/api/payload/tagsvariablesub_promptpay_mobile/)
- [SUB\_PROMPTPAY\_NATIONAL\_ID](/api/payload/tagsvariablesub_promptpay_national_id/)
- [SUB\_PROMPTPAY\_OTA](/api/payload/tagsvariablesub_promptpay_ota/)
- [SUB\_TRUE\_MONEY](/api/payload/tagsvariablesub_true_money/)
- [SUB\_VAT\_AMOUNT](/api/payload/tagsvariablesub_vat_amount/)
- [SUB\_VAT\_RATE](/api/payload/tagsvariablesub_vat_rate/)
- [SUB\_VAT\_SELLER\_TAX\_BRANCH\_ID](/api/payload/tagsvariablesub_vat_seller_tax_branch_id/)
- [TAG\_ADDITIONAL\_DATA](/api/payload/tagsvariabletag_additional_data/)
- [TAG\_CHECKSUM](/api/payload/tagsvariabletag_checksum/)
- [TAG\_COUNTRY\_CODE](/api/payload/tagsvariabletag_country_code/)
- [TAG\_LANGUAGE\_TEMPLATE](/api/payload/tagsvariabletag_language_template/)
- [TAG\_MERCHANT\_ACCOUNT\_BILL\_PAYMENT](/api/payload/tagsvariabletag_merchant_account_bill_payment/)
- [TAG\_MERCHANT\_ACCOUNT\_KSHOP](/api/payload/tagsvariabletag_merchant_account_kshop/)
- [TAG\_MERCHANT\_ACCOUNT\_PROMPTPAY](/api/payload/tagsvariabletag_merchant_account_promptpay/)
- [TAG\_MERCHANT\_CATEGORY\_CODE](/api/payload/tagsvariabletag_merchant_category_code/)
- [TAG\_MERCHANT\_CITY](/api/payload/tagsvariabletag_merchant_city/)
- [TAG\_MERCHANT\_NAME](/api/payload/tagsvariabletag_merchant_name/)
- [TAG\_PAYLOAD\_FORMAT](/api/payload/tagsvariabletag_payload_format/)
- [TAG\_PERSONAL\_MESSAGE](/api/payload/tagsvariabletag_personal_message/)
- [TAG\_POINT\_OF\_INITIATION](/api/payload/tagsvariabletag_point_of_initiation/)
- [TAG\_POSTAL\_CODE](/api/payload/tagsvariabletag_postal_code/)
- [TAG\_TIP\_FIXED](/api/payload/tagsvariabletag_tip_fixed/)
- [TAG\_TIP\_OR\_CONVENIENCE\_INDICATOR](/api/payload/tagsvariabletag_tip_or_convenience_indicator/)
- [TAG\_TIP\_PERCENTAGE](/api/payload/tagsvariabletag_tip_percentage/)
- [TAG\_TRANSACTION\_AMOUNT](/api/payload/tagsvariabletag_transaction_amount/)
- [TAG\_TRANSACTION\_CURRENCY](/api/payload/tagsvariabletag_transaction_currency/)
- [TAG\_VAT\_TQRC](/api/payload/tagsvariabletag_vat_tqrc/)
- [TIP\_FIXED](/api/payload/tagsvariabletip_fixed/)
- [TIP\_PERCENTAGE](/api/payload/tagsvariabletip_percentage/)
- [TIP\_PROMPT](/api/payload/tagsvariabletip_prompt/)
- [TRUE\_MONEY\_PREFIX](/api/payload/tagsvariabletrue_money_prefix/)
# @thai-qr-payment/payload
## Namespaces
- [Tags](/api/payload/namespacetags/)
## Classes
- [ThaiQRPaymentBuilder](/api/payload/classthaiqrpaymentbuilder/)
## Interfaces
- [AdditionalDataFields](/api/payload/interfaceadditionaldatafields/)
- [BOTBarcodeInput](/api/payload/interfacebotbarcodeinput/)
- [FormatAmountOptions](/api/payload/interfaceformatamountoptions/)
- [MerchantInfo](/api/payload/interfacemerchantinfo/)
- [NormalisedRecipient](/api/payload/interfacenormalisedrecipient/)
- [ParsedAdditionalData](/api/payload/interfaceparsedadditionaldata/)
- [ParsedBillPayment](/api/payload/interfaceparsedbillpayment/)
- [ParsedBOTBarcode](/api/payload/interfaceparsedbotbarcode/)
- [ParsedCRC](/api/payload/interfaceparsedcrc/)
- [ParsedPayload](/api/payload/interfaceparsedpayload/)
- [ParsedPromptPay](/api/payload/interfaceparsedpromptpay/)
- [ParsedSlipVerify](/api/payload/interfaceparsedslipverify/)
- [ParsedTrueMoney](/api/payload/interfaceparsedtruemoney/)
- [ParsedTrueMoneySlipVerify](/api/payload/interfaceparsedtruemoneyslipverify/)
- [ParsedVATTQRC](/api/payload/interfaceparsedvattqrc/)
- [ParsePayloadOptions](/api/payload/interfaceparsepayloadoptions/)
- [SlipVerifyInput](/api/payload/interfaceslipverifyinput/)
- [TLVField](/api/payload/interfacetlvfield/)
- [TrueMoneySlipVerifyInput](/api/payload/interfacetruemoneyslipverifyinput/)
- [VATTQRCInput](/api/payload/interfacevattqrcinput/)
## Type Aliases
- [PromptPayRecipientType](/api/payload/typealiaspromptpayrecipienttype/)
- [TipMode](/api/payload/typealiastipmode/)
## Functions
- [buildBOTBarcode](/api/payload/functionbuildbotbarcode/)
- [buildSlipVerify](/api/payload/functionbuildslipverify/)
- [buildTrueMoneySlipVerify](/api/payload/functionbuildtruemoneyslipverify/)
- [checksum](/api/payload/functionchecksum/)
- [decodePersonalMessage](/api/payload/functiondecodepersonalmessage/)
- [encodeField](/api/payload/functionencodefield/)
- [encodeFields](/api/payload/functionencodefields/)
- [encodePersonalMessage](/api/payload/functionencodepersonalmessage/)
- [formatAmount](/api/payload/functionformatamount/)
- [iterateFields](/api/payload/functioniteratefields/)
- [normaliseBankAccount](/api/payload/functionnormalisebankaccount/)
- [normaliseRecipient](/api/payload/functionnormaliserecipient/)
- [parseBOTBarcode](/api/payload/functionparsebotbarcode/)
- [parseFields](/api/payload/functionparsefields/)
- [parsePayload](/api/payload/functionparsepayload/)
- [parseSlipVerify](/api/payload/functionparseslipverify/)
- [parseTrueMoneySlipVerify](/api/payload/functionparsetruemoneyslipverify/)
- [payloadFor](/api/payload/functionpayloadfor/)
# COUNTRY_TH
> `const` **COUNTRY\_TH**: `"TH"` = `'TH'`
Defined in: [tags.ts:68](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L68)
# CURRENCY_THB
> `const` **CURRENCY\_THB**: `"764"` = `'764'`
Defined in: [tags.ts:67](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L67)
# GUID_BILL_PAYMENT
> `const` **GUID\_BILL\_PAYMENT**: `"A000000677010112"` = `'A000000677010112'`
Defined in: [tags.ts:70](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L70)
# GUID_BILL_PAYMENT_CROSS_BORDER
> `const` **GUID\_BILL\_PAYMENT\_CROSS\_BORDER**: `"A000000677012006"` = `'A000000677012006'`
Defined in: [tags.ts:79](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L79)
# GUID_PROMPTPAY
> `const` **GUID\_PROMPTPAY**: `"A000000677010111"` = `'A000000677010111'`
Defined in: [tags.ts:69](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L69)
# GUID_PROMPTPAY_OTA
> `const` **GUID\_PROMPTPAY\_OTA**: `"A000000677010114"` = `'A000000677010114'`
Defined in: [tags.ts:74](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L74)
# PAYLOAD_FORMAT_VERSION
> `const` **PAYLOAD\_FORMAT\_VERSION**: `"01"` = `'01'`
Defined in: [tags.ts:64](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L64)
# POI_DYNAMIC
> `const` **POI\_DYNAMIC**: `"12"` = `'12'`
Defined in: [tags.ts:66](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L66)
# POI_STATIC
> `const` **POI\_STATIC**: `"11"` = `'11'`
Defined in: [tags.ts:65](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L65)
# SUB_ADD_BILL_NUMBER
> `const` **SUB\_ADD\_BILL\_NUMBER**: `"01"` = `'01'`
Defined in: [tags.ts:53](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L53)
# SUB_ADD_CONSUMER_DATA_REQUEST
> `const` **SUB\_ADD\_CONSUMER\_DATA\_REQUEST**: `"09"` = `'09'`
Defined in: [tags.ts:61](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L61)
# SUB_ADD_CUSTOMER_LABEL
> `const` **SUB\_ADD\_CUSTOMER\_LABEL**: `"06"` = `'06'`
Defined in: [tags.ts:58](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L58)
# SUB_ADD_LOYALTY_NUMBER
> `const` **SUB\_ADD\_LOYALTY\_NUMBER**: `"04"` = `'04'`
Defined in: [tags.ts:56](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L56)
# SUB_ADD_MOBILE_NUMBER
> `const` **SUB\_ADD\_MOBILE\_NUMBER**: `"02"` = `'02'`
Defined in: [tags.ts:54](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L54)
# SUB_ADD_PURPOSE_OF_TRANSACTION
> `const` **SUB\_ADD\_PURPOSE\_OF\_TRANSACTION**: `"08"` = `'08'`
Defined in: [tags.ts:60](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L60)
# SUB_ADD_REFERENCE_LABEL
> `const` **SUB\_ADD\_REFERENCE\_LABEL**: `"05"` = `'05'`
Defined in: [tags.ts:57](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L57)
# SUB_ADD_STORE_LABEL
> `const` **SUB\_ADD\_STORE\_LABEL**: `"03"` = `'03'`
Defined in: [tags.ts:55](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L55)
# SUB_ADD_TERMINAL_LABEL
> `const` **SUB\_ADD\_TERMINAL\_LABEL**: `"07"` = `'07'`
Defined in: [tags.ts:59](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L59)
# SUB_BILL_BILLER_ID
> `const` **SUB\_BILL\_BILLER\_ID**: `"01"` = `'01'`
Defined in: [tags.ts:48](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L48)
# SUB_BILL_REFERENCE_1
> `const` **SUB\_BILL\_REFERENCE\_1**: `"02"` = `'02'`
Defined in: [tags.ts:49](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L49)
# SUB_BILL_REFERENCE_2
> `const` **SUB\_BILL\_REFERENCE\_2**: `"03"` = `'03'`
Defined in: [tags.ts:50](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L50)
# SUB_GUID
> `const` **SUB\_GUID**: `"00"` = `'00'`
Defined in: [tags.ts:33](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L33)
# SUB_PROMPTPAY_BANK_ACCOUNT
> `const` **SUB\_PROMPTPAY\_BANK\_ACCOUNT**: `"04"` = `'04'`
Defined in: [tags.ts:37](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L37)
# SUB_PROMPTPAY_EWALLET
> `const` **SUB\_PROMPTPAY\_EWALLET**: `"03"` = `'03'`
Defined in: [tags.ts:36](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L36)
# SUB_PROMPTPAY_MOBILE
> `const` **SUB\_PROMPTPAY\_MOBILE**: `"01"` = `'01'`
Defined in: [tags.ts:34](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L34)
# SUB_PROMPTPAY_NATIONAL_ID
> `const` **SUB\_PROMPTPAY\_NATIONAL\_ID**: `"02"` = `'02'`
Defined in: [tags.ts:35](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L35)
# SUB_PROMPTPAY_OTA
> `const` **SUB\_PROMPTPAY\_OTA**: `"05"` = `'05'`
Defined in: [tags.ts:38](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L38)
# SUB_TRUE_MONEY
> `const` **SUB\_TRUE\_MONEY**: `"03"` = `'03'`
Defined in: [tags.ts:44](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L44)
# SUB_VAT_AMOUNT
> `const` **SUB\_VAT\_AMOUNT**: `"02"` = `'02'`
Defined in: [tags.ts:93](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L93)
# SUB_VAT_RATE
> `const` **SUB\_VAT\_RATE**: `"01"` = `'01'`
Defined in: [tags.ts:92](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L92)
# SUB_VAT_SELLER_TAX_BRANCH_ID
> `const` **SUB\_VAT\_SELLER\_TAX\_BRANCH\_ID**: `"00"` = `'00'`
Defined in: [tags.ts:91](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L91)
# TAG_ADDITIONAL_DATA
> `const` **TAG\_ADDITIONAL\_DATA**: `"62"` = `'62'`
Defined in: [tags.ts:27](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L27)
# TAG_CHECKSUM
> `const` **TAG\_CHECKSUM**: `"63"` = `'63'`
Defined in: [tags.ts:28](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L28)
# TAG_COUNTRY_CODE
> `const` **TAG\_COUNTRY\_CODE**: `"58"` = `'58'`
Defined in: [tags.ts:23](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L23)
# TAG_LANGUAGE_TEMPLATE
> `const` **TAG\_LANGUAGE\_TEMPLATE**: `"64"` = `'64'`
Defined in: [tags.ts:29](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L29)
# TAG_MERCHANT_ACCOUNT_BILL_PAYMENT
> `const` **TAG\_MERCHANT\_ACCOUNT\_BILL\_PAYMENT**: `"30"` = `'30'`
Defined in: [tags.ts:15](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L15)
# TAG_MERCHANT_ACCOUNT_KSHOP
> `const` **TAG\_MERCHANT\_ACCOUNT\_KSHOP**: `"31"` = `'31'`
Defined in: [tags.ts:16](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L16)
# TAG_MERCHANT_ACCOUNT_PROMPTPAY
> `const` **TAG\_MERCHANT\_ACCOUNT\_PROMPTPAY**: `"29"` = `'29'`
Defined in: [tags.ts:14](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L14)
# TAG_MERCHANT_CATEGORY_CODE
> `const` **TAG\_MERCHANT\_CATEGORY\_CODE**: `"52"` = `'52'`
Defined in: [tags.ts:17](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L17)
# TAG_MERCHANT_CITY
> `const` **TAG\_MERCHANT\_CITY**: `"60"` = `'60'`
Defined in: [tags.ts:25](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L25)
# TAG_MERCHANT_NAME
> `const` **TAG\_MERCHANT\_NAME**: `"59"` = `'59'`
Defined in: [tags.ts:24](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L24)
# TAG_PAYLOAD_FORMAT
> `const` **TAG\_PAYLOAD\_FORMAT**: `"00"` = `'00'`
Defined in: [tags.ts:12](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L12)
EMVCo Merchant-Presented-Mode QR Code Specification — tag registry.
Source: EMVCo MPM v1.1 §3 — public spec; Bank of Thailand and KASIKORN
adopt the same numbering with Thai-specific GUIDs under templates 29-31.
Tags are stringly-typed (two-character zero-padded decimal) on the wire
but exposed here as named constants so call sites stay readable.
# TAG_PERSONAL_MESSAGE
> `const` **TAG\_PERSONAL\_MESSAGE**: `"81"` = `'81'`
Defined in: [tags.ts:30](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L30)
# TAG_POINT_OF_INITIATION
> `const` **TAG\_POINT\_OF\_INITIATION**: `"01"` = `'01'`
Defined in: [tags.ts:13](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L13)
# TAG_POSTAL_CODE
> `const` **TAG\_POSTAL\_CODE**: `"61"` = `'61'`
Defined in: [tags.ts:26](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L26)
# TAG_TIP_FIXED
> `const` **TAG\_TIP\_FIXED**: `"56"` = `'56'`
Defined in: [tags.ts:21](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L21)
# TAG_TIP_OR_CONVENIENCE_INDICATOR
> `const` **TAG\_TIP\_OR\_CONVENIENCE\_INDICATOR**: `"55"` = `'55'`
Defined in: [tags.ts:20](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L20)
# TAG_TIP_PERCENTAGE
> `const` **TAG\_TIP\_PERCENTAGE**: `"57"` = `'57'`
Defined in: [tags.ts:22](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L22)
# TAG_TRANSACTION_AMOUNT
> `const` **TAG\_TRANSACTION\_AMOUNT**: `"54"` = `'54'`
Defined in: [tags.ts:19](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L19)
# TAG_TRANSACTION_CURRENCY
> `const` **TAG\_TRANSACTION\_CURRENCY**: `"53"` = `'53'`
Defined in: [tags.ts:18](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L18)
# TAG_VAT_TQRC
> `const` **TAG\_VAT\_TQRC**: `"80"` = `'80'`
Defined in: [tags.ts:90](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L90)
# TIP_FIXED
> `const` **TIP\_FIXED**: `"02"` = `'02'`
Defined in: [tags.ts:83](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L83)
# TIP_PERCENTAGE
> `const` **TIP\_PERCENTAGE**: `"03"` = `'03'`
Defined in: [tags.ts:84](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L84)
# TIP_PROMPT
> `const` **TIP\_PROMPT**: `"01"` = `'01'`
Defined in: [tags.ts:82](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L82)
# TRUE_MONEY_PREFIX
> `const` **TRUE\_MONEY\_PREFIX**: `"14"` = `'14'`
Defined in: [tags.ts:45](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/tags.ts#L45)
# PromptPayRecipientType
> **PromptPayRecipientType** = `"mobile"` \| `"nationalId"` \| `"eWallet"` \| `"bankAccount"`
Defined in: [recipient.ts:18](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/recipient.ts#L18)
# TipMode
> **TipMode** = \{ `mode`: `"prompt"`; \} \| \{ `fromSatang?`: `boolean`; `mode`: `"fixed"`; `value`: `number`; \} \| \{ `mode`: `"percentage"`; `value`: `number`; \}
Defined in: [builder.ts:92](https://github.com/uunw/thai-qr-payment/blob/main/packages/payload/src/builder.ts#L92)
# detectMode
> **detectMode**(`text`): [`EncodingMode`](/api/qr/typealiasencodingmode/)
Defined in: [mode.ts:49](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/mode.ts#L49)
Detect the narrowest mode that can encode the entire input.
## Parameters
### text
`string`
## Returns
[`EncodingMode`](/api/qr/typealiasencodingmode/)
# encodeQR
> **encodeQR**(`text`, `options?`): [`QRMatrix`](/api/qr/interfaceqrmatrix/)
Defined in: [encoder.ts:122](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L122)
Encode `text` as a QR Code matrix.
The returned matrix is a square 2-D boolean array (`true` = dark
module). Render with any output (SVG, canvas, PNG, terminal).
## Parameters
### text
`string`
### options?
[`EncodeOptions`](/api/qr/interfaceencodeoptions/) = `{}`
## Returns
[`QRMatrix`](/api/qr/interfaceqrmatrix/)
# EncodeOptions
Defined in: [encoder.ts:27](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L27)
## Properties
### errorCorrectionLevel?
> `optional` **errorCorrectionLevel?**: [`ErrorCorrectionLevel`](/api/qr/typealiaserrorcorrectionlevel/)
Defined in: [encoder.ts:28](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L28)
***
### forceMask?
> `optional` **forceMask?**: `number`
Defined in: [encoder.ts:31](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L31)
***
### maxVersion?
> `optional` **maxVersion?**: `number`
Defined in: [encoder.ts:30](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L30)
***
### minVersion?
> `optional` **minVersion?**: `number`
Defined in: [encoder.ts:29](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L29)
# QRMatrix
Defined in: [encoder.ts:34](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L34)
## Properties
### errorCorrectionLevel
> `readonly` **errorCorrectionLevel**: [`ErrorCorrectionLevel`](/api/qr/typealiaserrorcorrectionlevel/)
Defined in: [encoder.ts:38](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L38)
***
### mask
> `readonly` **mask**: `number`
Defined in: [encoder.ts:39](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L39)
***
### modules
> `readonly` **modules**: `boolean`[][]
Defined in: [encoder.ts:36](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L36)
***
### size
> `readonly` **size**: `number`
Defined in: [encoder.ts:35](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L35)
***
### version
> `readonly` **version**: `number`
Defined in: [encoder.ts:37](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/encoder.ts#L37)
# @thai-qr-payment/qr
## Interfaces
- [EncodeOptions](/api/qr/interfaceencodeoptions/)
- [QRMatrix](/api/qr/interfaceqrmatrix/)
## Type Aliases
- [EncodingMode](/api/qr/typealiasencodingmode/)
- [ErrorCorrectionLevel](/api/qr/typealiaserrorcorrectionlevel/)
## Functions
- [detectMode](/api/qr/functiondetectmode/)
- [encodeQR](/api/qr/functionencodeqr/)
# EncodingMode
> **EncodingMode** = `"numeric"` \| `"alphanumeric"` \| `"byte"`
Defined in: [mode.ts:15](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/mode.ts#L15)
# ErrorCorrectionLevel
> **ErrorCorrectionLevel** = `"L"` \| `"M"` \| `"Q"` \| `"H"`
Defined in: [version.ts:13](https://github.com/uunw/thai-qr-payment/blob/main/packages/qr/src/version.ts#L13)
Capacity tables + version metadata from ISO/IEC 18004 §6.5 and Annex D.
Each version 1-40 has 4 ECC levels (L, M, Q, H). For each (version, ECC)
the spec defines:
- Total data codewords (`dataCodewords`)
- Number of error-correction blocks (groups)
- Block sizes within each group
The matrix dimension is `(version - 1) * 4 + 21`.
# ThaiQRPayment
> **ThaiQRPayment**(`__namedParameters`): `ReactElement`
Defined in: [react/src/index.tsx:49](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L49)
Full Thai QR Payment card (header logo + QR + amount).
## Parameters
### \_\_namedParameters
[`ThaiQRPaymentProps`](/api/react/interfacethaiqrpaymentprops/)
## Returns
`ReactElement`
# ThaiQRPaymentMatrix
> **ThaiQRPaymentMatrix**(`__namedParameters`): `ReactElement`
Defined in: [react/src/index.tsx:86](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L86)
Just the QR matrix (no card chrome).
## Parameters
### \_\_namedParameters
[`ThaiQRPaymentMatrixProps`](/api/react/interfacethaiqrpaymentmatrixprops/)
## Returns
`ReactElement`
# ThaiQRPaymentMatrixProps
Defined in: [react/src/index.tsx:37](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L37)
## Extends
- `QRSvgOptions`
## Properties
### amount?
> `optional` **amount?**: `number`
Defined in: [react/src/index.tsx:39](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L39)
***
### ariaLabel?
> `optional` **ariaLabel?**: `string`
Defined in: [react/src/index.tsx:45](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L45)
***
### background?
> `optional` **background?**: `string`
Defined in: render/dist/matrix-svg.d.ts:19
Background colour (set to `transparent` to omit). Defaults to `#fff`.
#### Inherited from
`QRSvgOptions.background`
***
### className?
> `optional` **className?**: `string`
Defined in: [react/src/index.tsx:43](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L43)
***
### errorCorrectionLevel?
> `optional` **errorCorrectionLevel?**: `ErrorCorrectionLevel`
Defined in: [react/src/index.tsx:42](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L42)
***
### foreground?
> `optional` **foreground?**: `string`
Defined in: render/dist/matrix-svg.d.ts:17
Dark module colour. Defaults to `#000`.
#### Inherited from
`QRSvgOptions.foreground`
***
### fromSatang?
> `optional` **fromSatang?**: `boolean`
Defined in: [react/src/index.tsx:41](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L41)
***
### quietZone?
> `optional` **quietZone?**: `number`
Defined in: render/dist/matrix-svg.d.ts:15
Quiet-zone width in modules. EMVCo recommends 4.
#### Inherited from
`QRSvgOptions.quietZone`
***
### recipient
> **recipient**: `string`
Defined in: [react/src/index.tsx:38](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L38)
***
### recipientType?
> `optional` **recipientType?**: `PromptPayRecipientType`
Defined in: [react/src/index.tsx:40](https://github.com/uunw/thai-qr-payment/blob/main/packages/react/src/index.tsx#L40)
***
### rootAttributes?
> `optional` **rootAttributes?**: `Record`\<`string`, `string`\>
Defined in: render/dist/matrix-svg.d.ts:21
Additional attributes added verbatim to the root `