npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cliniq360/ondc-credit-cli

v1.0.0

Published

Official CLI for the ONDC credit and loan API workflow.

Readme

ondc-credit CLI

CLI for the ONDC credit and loan API workflow.


Features

  • Calls the ONDC credit backend APIs directly
  • Preserves the same CLI structure and error handling pattern as the base ONDC CLI
  • Validates the credit payloads used by the existing ONDC and haqdarshak flows
  • Supports human-readable and JSON output
  • Includes a raw tool caller for the built-in ONDC credit API tool set
  • Uses https://prod.cliniq360.com as the default API base URL
  • Uses the same ONDC_API_BASE_URL and ONDC_API_KEY configuration pattern
  • Can print the strict credit AI workflow prompt via ondc-credit workflow prompt

Installation

Install globally:

npm install -g @cliniq360/ondc-credit-cli

Or run without installing:

npx @cliniq360/ondc-credit-cli --help

Quick Start

# 1. Inspect the strict workflow before calling tools
ondc-credit workflow prompt

# 2. Start a credit journey
ondc-credit journey start --user-id 1

# 3. Submit the base loanForm payload
ondc-credit forms application \
  --txn-id <TXN_ID> \
  --first-name Jane \
  --last-name Doe \
  --dob 1992-01-15 \
  --gender female \
  --pan ABCDE1234F \
  --contact-number 9876543210 \
  --email [email protected] \
  --official-email [email protected] \
  --employment-type salaried \
  --end-use Education \
  --income 50000 \
  --company-name ExampleCorp \
  --address-l1 "12 MG Road" \
  --address-l2 "Near Metro" \
  --city Bengaluru \
  --state Karnataka \
  --pincode 560001

# 4. Move to approved offers
ondc-credit offers select-application --txn-id <TXN_ID>
ondc-credit offers approved --txn-id <TXN_ID>

# 5. Submit amount for a chosen offer
ondc-credit forms loan-amount \
  --txn-id <TXN_ID> \
  --request-amount 250000 \
  --request-term "24 months" \
  --form-id <FORM_ID>

Use A Different API Endpoint

Override the default hosted API base URL with a shell environment variable:

ONDC_API_BASE_URL=http://localhost:7600 ondc-credit tools list

Or export it for the current shell session:

export ONDC_API_BASE_URL=http://localhost:7600
export ONDC_API_KEY=your_api_key_if_required
ondc-credit config show

You can also place these values in a .env file in the directory where you run ondc-credit:

ONDC_API_BASE_URL=http://localhost:7600
ONDC_API_KEY=your_api_key_if_required

Command Groups

ondc-credit config

  • ondc-credit config set-format <pretty|json>
  • ondc-credit config show

ondc-credit workflow

  • ondc-credit workflow list
  • ondc-credit workflow prompt
  • ondc-credit workflow happy-path
  • ondc-credit workflow aa-fallback
  • ondc-credit workflow show <NAME>

ondc-credit journey

  • ondc-credit journey start [--user-id <USER_ID>]

ondc-credit forms

  • ondc-credit forms application ...
  • ondc-credit forms loan-amount ...
  • ondc-credit forms bank-details ...

ondc-credit offers

  • ondc-credit offers select-application --txn-id <TXN_ID>
  • ondc-credit offers approved [--txn-id <TXN_ID> | --user-id <USER_ID> | --customer-id <CUSTOMER_ID> | --mobile-number <PHONE>]
  • ondc-credit offers aa-url --txn-id <TXN_ID> --aa-id <AA_ID>
  • ondc-credit offers aa-consent --txn-id <TXN_ID>
  • ondc-credit offers detailed --txn-id <TXN_ID>
  • ondc-credit offers select --txn-id <TXN_ID> --offer-item-id <OFFER_ID>

ondc-credit orders

  • ondc-credit orders transaction-status --txn-id <TXN_ID>
  • ondc-credit orders form-url --txn-id <TXN_ID> --offer-item-id <OFFER_ID>
  • ondc-credit orders init --txn-id <TXN_ID> --offer-item-id <OFFER_ID>
  • ondc-credit orders confirm --txn-id <TXN_ID> --offer-item-id <OFFER_ID>
  • ondc-credit orders status --txn-id <TXN_ID> --offer-item-id <OFFER_ID>
  • ondc-credit orders loan-document --txn-id <TXN_ID> --offer-item-id <OFFER_ID>

ondc-credit policy

  • ondc-credit policy notify --order-id <ORDER_ID> --channel <whatsapp|sms> --mobile-number <PHONE>

ondc-credit tools

  • ondc-credit tools list
  • ondc-credit tools inspect <NAME>
  • ondc-credit tools call <NAME> --input '{...}'

Validated Payloads

The CLI validates the same request shapes used by the current credit flows in ONDC and haqdarshak.

  • loanForm required fields: firstName, lastName, dob, gender, pan, contactNumber, email, officialEmail, employmentType, endUse, income, companyName, addressL1, addressL2, city, state, pincode
  • loanForm optional fields: udyamNumber
  • loanForm required fields also include aa_id
  • loanAmountForm required fields: requestAmount, requestTerm, form_id
  • accountDetails required fields: accHolderName, acctype, accNo, ifscCode
  • accountDetails optional fields: aaMonitoringConsent

The CLI also validates common field formats:

  • PAN: AAAAA9999A
  • mobile number: 10 digits without country code
  • pincode: 6 digits
  • IFSC: Indian IFSC pattern
  • date of birth: YYYY-MM-DD
  • booleans passed as strings: true or false
  • bureauConsent is always sent as true for base application submission

Notes

  • ondc-credit-cli calls the ONDC backend REST APIs directly.
  • The default base URL and API key behavior remain the same as the existing ONDC CLI implementation.
  • ondc-credit workflow prompt prints the strict CREDIT_WORKFLOW_TEMPLATE guidance for AI-assisted execution.
  • The CLI prints parsed tool payloads by default. Use --json for clean automation output.
  • For raw tool execution, use ondc-credit tools inspect <NAME> before ondc-credit tools call <NAME>.