# Alamat Checkout Reference Beta · 0.1.0

Adds an optional ALMT reference to a purchase. This is not a location resolver, proof of ownership or delivery permission. Keep the ordinary postal address. A courier cannot navigate from this code alone. No connection to Shopee or Lazada is included.

## Universal checkout widget

Self-host `alamat-checkout.js` in a merchant-owned checkout. No framework, network request, analytics or browser storage. Both input and output are untrusted; validate again on your server and bind them to the authenticated order. Do not log the value unnecessarily.

```html
<script src="/assets/alamat-checkout.js" defer></script>
<alamat-checkout></alamat-checkout>
<script>
  const widget = document.querySelector('alamat-checkout');
  let reference = null;
  widget.addEventListener('alamat-change', event => {
    // null on edit/remove/reset; never keep the previous reference then.
    reference = event.detail;
  });
  // At order submission, use widget.value as the current source of truth.
  // Your existing authenticated checkout submits and validates it.
  // The widget does not submit, mutate address fields, or purchase anything.
</script>
```

Output: `{ version: 1, reference: "ALMT 7VFW 9ARC", status: "unverified-reference" }` or `null`.
Apply is explicit. Edits withdraw the previous value. A parent form reset clears it. On checkout success call `widget.clear()`; do not reuse it for a later purchase. Input permits eight ALMT alphabet characters, optionally prefixed ALMT and separated by spaces. It checks syntax only, never record existence/ownership. Avoid automatic suggestions or filling private resident data.

## WooCommerce plugin

Download `alamat-woocommerce.zip`, then install in a **test store** under WordPress → Plugins → Add plugin → Upload. Requires WooCommerce8.9+ for Checkout Blocks; also registers the separate classic shortcode-checkout flow. The field is optional and keeps the standard shipping address unchanged. Buyers see that the reference is shared with the store. No API key, external call or Alamat database is used.

Blocks store `alamat/reference` at location `order` (Woo order metadata `_wc_other/alamat/reference`); classic checkout stores `_alamat_reference`. This follows the merchant's order access/retention/export/deletion configuration. Woo's additional-field API can display the reference in order details and emails. It grants no new arrival access. Do not paste a private share token into this field.

This package has automated PHP contract/validation checks, not a live WordPress/Woo checkout certification. Test your chosen checkout theme, guest/customer order, order admin, email/export access, and retention before production. No store is configured or connected by downloading the plugin.

## Shopee / Lazada

Not connected. Seller application approval, authorized store and a supported order/fulfillment handoff must be established before real integration. These downloads do not add a button to their buyer checkout or read/update their orders. Do not replace a marketplace's required postal address with an ALMT code. A future carrier handoff must independently authenticate the carrier and obtain delivery-scoped resident approval.
