{"openapi":"3.1.0","info":{"title":"Cambodia KHQR Builder API","version":"0.1.0","description":"Cambodia KHQR Builder wraps the railqr KHQR implementation, which reproduces the four sample payloads published in the National Bank of Cambodia KHQR SDK document. build_khqr_static builds a static KHQR for an individual account (tag 29) or a merchant account (tag 30) with no amount. build_khqr_dynamic adds an amount, the creation timestamp and an expiry timestamp in tag 99 (milliseconds)....\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://kh-khqr-builder.connectorbay.com/mcp.\n\nDisclaimer: General information only, not legal, tax, accounting or payment advice. Cambodia KHQR Builder is an independent tool: it is not affiliated with, endorsed by or operated by any government body, central bank, standards body or scheme operator. Rates, thresholds and rules change; check the cited official source and confirm with a qualified professional before you rely on a result.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/kh-khqr-builder/docs"},"termsOfService":"https://connectorbay.com/kh-khqr-builder/terms"},"servers":[{"url":"https://kh-khqr-builder.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/kh-khqr-builder/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/build_khqr_static":{"post":{"operationId":"build_khqr_static","summary":"Static KHQR payload (no amount, point of initiation 11) for an individual account (tag 29) or a merchant account (tag 30","description":"Static KHQR payload (no amount, point of initiation 11) for an individual account (tag 29) or a merchant account (tag 30), with the checksum and a self-check. Use for \"Build a static KHQR for my cafe.\". Test values only until you use the IDs your bank issued.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"account_type":{"description":"individual (tag 29, a person's Bakong account) or merchant (tag 30, a business with merchant ID and acquiring bank)","title":"Account Type","type":"string"},"account_id":{"description":"Bakong account ID in the form name@bank, at most 32 characters (use the ID your bank or PSP issued)","title":"Account Id","type":"string"},"merchant_name":{"description":"Merchant name as shown to the payer, at most 25 characters","title":"Merchant Name","type":"string"},"acquiring_bank":{"description":"Acquiring bank name, at most 32 characters","title":"Acquiring Bank","type":"string"},"account_information":{"description":"Merchant ID (merchant) or account information such as the phone number (individual), at most 32 characters","title":"Account Information","type":"string"},"city":{"default":"Phnom Penh","description":"Merchant city, at most 15 characters (default Phnom Penh)","title":"City","type":"string"},"currency":{"default":"KHR","description":"KHR (numeric 116) or USD (numeric 840); default KHR","title":"Currency","type":"string"},"mcc":{"default":"5999","description":"Merchant category code, 4 digits (default 5999, miscellaneous and specialty retail)","title":"Mcc","type":"string"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional bill or invoice number for tag 62 (at most 25 characters)","title":"Bill Number"},"store_label":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional store label for tag 62 (at most 25 characters)","title":"Store Label"},"include_svg":{"default":false,"description":"Also return an SVG image of the QR code (needs the optional qrcode package; default false)","title":"Include Svg","type":"boolean"}},"required":["account_type","account_id","merchant_name","acquiring_bank","account_information"],"title":"build_khqr_staticArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/build_khqr_dynamic":{"post":{"operationId":"build_khqr_dynamic","summary":"Dynamic KHQR payload (point of initiation 12) with an amount and creation and expiry timestamps in tag 99 (milliseconds)","description":"Dynamic KHQR payload (point of initiation 12) with an amount and creation and expiry timestamps in tag 99 (milliseconds), with checksum and self-check. Use for \"Build a KHQR for a 25,000 riel bill that expires in 10 minutes.\". Test values only until you use the IDs your bank issued.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"account_type":{"description":"individual (tag 29, a person's Bakong account) or merchant (tag 30, a business with merchant ID and acquiring bank)","title":"Account Type","type":"string"},"account_id":{"description":"Bakong account ID in the form name@bank, at most 32 characters (use the ID your bank or PSP issued)","title":"Account Id","type":"string"},"merchant_name":{"description":"Merchant name as shown to the payer, at most 25 characters","title":"Merchant Name","type":"string"},"acquiring_bank":{"description":"Acquiring bank name, at most 32 characters","title":"Acquiring Bank","type":"string"},"account_information":{"description":"Merchant ID (merchant) or account information such as the phone number (individual), at most 32 characters","title":"Account Information","type":"string"},"amount":{"description":"Amount to pay as a plain decimal string: whole riel for KHR (25000), up to 2 decimals for USD (12.50)","title":"Amount","type":"string"},"currency":{"default":"KHR","description":"KHR (numeric 116) or USD (numeric 840); default KHR","title":"Currency","type":"string"},"expires_in_minutes":{"default":15,"description":"Minutes from now until the QR expires, 1 to 10080 (default 15)","title":"Expires In Minutes","type":"integer"},"city":{"default":"Phnom Penh","description":"Merchant city, at most 15 characters (default Phnom Penh)","title":"City","type":"string"},"mcc":{"default":"5999","description":"Merchant category code, 4 digits (default 5999, miscellaneous and specialty retail)","title":"Mcc","type":"string"},"bill_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional bill or invoice number for tag 62 (at most 25 characters)","title":"Bill Number"},"store_label":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional store label for tag 62 (at most 25 characters)","title":"Store Label"},"include_svg":{"default":false,"description":"Also return an SVG image of the QR code (needs the optional qrcode package; default false)","title":"Include Svg","type":"boolean"}},"required":["account_type","account_id","merchant_name","acquiring_bank","account_information","amount"],"title":"build_khqr_dynamicArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/parse_khqr":{"post":{"operationId":"parse_khqr","summary":"Decode every tag of a KHQR payload, list problems found and say whether a dynamic QR has expired at the moment asked. Us","description":"Decode every tag of a KHQR payload, list problems found and say whether a dynamic QR has expired at the moment asked. Use for \"What does this KHQR text contain?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"payload":{"description":"The full KHQR text (starts with 000201), as read from a QR code","title":"Payload","type":"string"},"on_date":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Moment for the expiry check, ISO date YYYY-MM-DD or a full UTC timestamp (default now, UTC)","title":"On Date"}},"required":["payload"],"title":"parse_khqrArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/verify_khqr_crc":{"post":{"operationId":"verify_khqr_crc","summary":"Check the tag 63 checksum of a KHQR payload and show the expected value. Use for \"Is the checksum of this KHQR correct?\"","description":"Check the tag 63 checksum of a KHQR payload and show the expected value. Use for \"Is the checksum of this KHQR correct?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"payload":{"description":"The full KHQR text including the final 6304 and four hex checksum characters","title":"Payload","type":"string"}},"required":["payload"],"title":"verify_khqr_crcArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/khqr_field_guide":{"post":{"operationId":"khqr_field_guide","summary":"The KHQR tags with meaning, length limits, the source and the verification level of each rule. Use for \"What do the KHQR","description":"The KHQR tags with meaning, length limits, the source and the verification level of each rule. Use for \"What do the KHQR tags mean and how long can the merchant name be?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"Optional tag number to look up, for example 99 or 30; omit to list all tags","title":"Tag"}},"title":"khqr_field_guideArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/currency_codes":{"post":{"operationId":"currency_codes","summary":"KHR 116 and USD 840 with the tag 53 text and the amount rules. Use for \"What currency codes does KHQR use?\".","description":"KHR 116 and USD 840 with the tag 53 text and the amount rules. Use for \"What currency codes does KHQR use?\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"currency_codesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}