A domain pack teaches Haat one ONDC domain. It is data, not code, so you can add or improve one without writing TypeScript.
text
packs/
ondc-ret10-grocery/
pack.json # what the domain is
lexicon.json # how people ask for things in it#pack.json
json
{
"id": "ondc-ret10-grocery",
"name": "Grocery",
"domain": "ONDC:RET10",
"description": "Kirana and grocery: staples, dairy, vegetables, household items.",
"lexicon": "lexicon.json",
"quote_ttl_sec": 600,
"maintainers": ["your-github-username"]
}domainmust look likeONDC:RET10. ONDC retail domains include RET10 (grocery), RET11 (food and beverage), RET12 (fashion), RET13 (beauty and personal care), RET14 (electronics), RET15 (appliances), RET16 (home and kitchen), RET18 (health and wellness). Check the current list in ONDC's documentation before adding one.quote_ttl_secis how long an approval stays valid. Fresh food needs shorter holds than staples.
#lexicon.json
See lexicon.md for the format and rules.
#Adding a pack
- Copy
packs/_templatetopacks/ondc-retXX-yourdomain. - Fill in
pack.jsonand at least 10 lexicon entries. - Run
npm test.test/packs.test.tsvalidates every pack and rejects a variant claimed by two products. - Open a pull request using the "New domain pack" issue form first, so others can help.
Today the gateway routes orders to ONDC:RET10; making the domain selectable per request is tracked in the good first issues.