pinelabs-cli
v0.1.1
Published
Pine Labs command-line interface — auto-generated from public/openapi.yaml on top of the Fern-generated TypeScript SDK (pinelabs-node).
Readme
pinelabs-cli
A flat, Stripe-CLI–style command-line interface for the Pine Labs Online Payment Gateway (Plural). Built on top of pinelabs-node.
The CLI ships 74 commands spanning Authentication, Orders, Payments, Refunds, Customers, Settlements, Subscriptions (Plans + Subscriptions + Presentations), Payouts, Checkout & Payment Links, Card Payments, BNPL, Apple Pay, Tokenization, Convenience Fee, Affordability Suite, Split Settlements, and more.
Install
npm install -g pinelabs-cli
# or
pnpm add -g pinelabs-cliRequires Node.js ≥ 18.
pinelabs --help
pinelabs --versionAuthenticate
The CLI uses OAuth2 client_credentials and refreshes the token automatically per invocation.
export PINELABS_CLIENT_ID=your_client_id
export PINELABS_CLIENT_SECRET=your_client_secretOr pass per command:
pinelabs --client-id $ID --client-secret $SECRET get-order-by-id --order_id v1-...Environments
| Flag | Default | Notes |
| --------------------- | -------------------------------- | ------------------ |
| (none) | https://pluraluat.v2.pinepg.in | UAT (default) |
| --base-url <url> | — | Override per call |
For production, pass --base-url https://api.pluralpay.in or set it once via a shell alias.
Quickstart
# Create an order for ₹11.00
pinelabs create-order \
--json merchant_order_reference=ord-1 \
--json order_amount.value=1100 \
--json order_amount.currency=INR \
--json pre_auth=false \
--json 'allowed_payment_methods[0]=CARD' \
--json 'allowed_payment_methods[1]=UPI' \
--json [email protected]
# Look it up
pinelabs get-order-by-merchant-reference --merchant_order_reference ord-1
# Capture
pinelabs capture-order --order_id v1-... \
--json amount.value=1100 --json amount.currency=INR
# Refund
pinelabs create-refund --order_id v1-... \
--json refund_amount.value=1100 --json refund_amount.currency=INR \
--json merchant_refund_reference=rfd-1Sending a request body
Use repeatable --json key=value with dot + bracket notation:
pinelabs create-payment-link \
--json merchant_order_reference=link-1 \
--json amount.value=50000 \
--json amount.currency=INR \
--json [email protected] \
--json customer.mobile_number=9999999999 \
--json 'notification_channels[0]=EMAIL' \
--json 'notification_channels[1]=SMS' \
--json expiry_in_minutes=60true / false / null and bare numbers are auto-coerced. Quote-wrap to keep strings: --json order_amount.value='"1100"'.
You can also pass a complete JSON body or load it from a file:
pinelabs create-order --json '{"merchant_order_reference":"ord-2","order_amount":{"value":1100,"currency":"INR"}}'
pinelabs create-order --json @./order.jsonPath & query parameters
Path params become required flags; query params optional flags:
pinelabs get-order-by-id --order_id v1-4405071524-aa-qlAtAf
pinelabs get-refund-order-details --order_id v1-...
pinelabs get-settlements-by-utr --utr 410092786849
pinelabs cancel-subscription --subscription_id sub_123Output
| Flag | Effect |
| --------- | --------------------------------------- |
| (default) | Pretty-printed JSON to stdout |
| --raw | Compact single-line JSON (per command) |
Pipe into jq for filtering:
pinelabs get-all-settlements --raw | jq '.data[].utr'Global options
| Flag | Description |
| ----------------------------- | ---------------------------------------------- |
| --client-id <id> | Overrides PINELABS_CLIENT_ID |
| --client-secret <secret> | Overrides PINELABS_CLIENT_SECRET |
| --base-url <url> | Override base URL (default: UAT) |
| -V, --version | Print version |
| -h, --help | Print help (also per command) |
Discoverability
pinelabs --help # all 74 commands
pinelabs create-order --help # flags for one command
pinelabs --help | grep -i refund # find by keywordExamples by domain
# Auth
pinelabs generate-token
# Settlements
pinelabs get-all-settlements
pinelabs get-settlements-by-utr --utr 410092786849
# Subscriptions
pinelabs create-plan \
--json plan_name=Gold \
--json amount.value=49900 \
--json amount.currency=INR \
--json frequency=MONTHLY
pinelabs pause-subscription --subscription_id sub_123
pinelabs resume-subscription --subscription_id sub_123
# Payouts
pinelabs get-payout-balance
pinelabs create-payout \
--json amount.value=10000 \
--json amount.currency=INR \
--json beneficiary_id=ben_1Troubleshooting
401 Unauthorized— verifyPINELABS_CLIENT_ID/PINELABS_CLIENT_SECRETand that you're hitting the correct--base-url.Unknown option— runpinelabs <command> --helpto see the exact flag spelling (params follow the OpenAPI casing, usuallysnake_case).pinelabs: command not found— the-gglobal install bin directory may not be onPATH. Runnpm bin -gand add it.- Inspect requests — set
NODE_DEBUG=httpto dump request/response.
License
MIT
