Tools
Node.js SDK
Official zero-dependency Node.js client, with automatic retries and idempotency.
@pineplechain/node runs on Node 18.17 or newer, is ESM and ships TypeScript types.
npm install @pineplechain/nodeAvailability
The package lands on npm when the MVP opens. Payment links are not in the SDK yet: use the HTTP calls in Payment links.Setup
import { Pineplechain } from "@pineplechain/node"
const pineple = new Pineplechain(process.env.PINEPLECHAIN_API_KEY, {
baseUrl: "https://api.pineplechain.com/v1",
timeoutMs: 30_000,
maxRetries: 3,
})
const me = await pineple.me()- Every POST carries an
Idempotency-Key, reused across retries. - Network errors, timeouts, 429 and 5xx are retried with growing backoff.
- 4xx is never retried.
Typed errors
import { ConflictError, RateLimitError, ValidationError } from "@pineplechain/node"
try {
await pineple.payments.release(paymentId, { reason: "delivered" }, { idempotencyKey: "release-1842" })
} catch (err) {
if (err instanceof ValidationError) console.log(err.errors) // [{ path, message }]
else if (err instanceof ConflictError) console.log(err.detail) // e.g. escrow-expired
else if (err instanceof RateLimitError) console.log("retry later")
else throw err
}Lists and metrics
for await (const payment of pineple.payments.listAll({ status: "released" })) {
console.log(payment.id, payment.amount.value)
}
const summary = await pineple.metrics.summary({ start_date: "2026-10-01T00:00:00Z" })Escrow payments (beta)
For orders with delivery and an identified customer. The customer needs a connected wallet and an active verification (KYC) before paying.
const payment = await pineple.payments.create(
{ customer_id: "cus_…", amount: { value: "25", asset: { type: "XRP" } }, description: "Order #1842" },
{ idempotencyKey: "order-1842" },
)
// payment.next_action.qr_png / deeplink: the payer signs in their wallet
const locked = await pineple.payments.waitFor(payment.id, { status: "locked", timeoutMs: 600_000 })
if (locked.status === "locked") {
await pineple.payments.release(payment.id, { reason: "delivered" }, { idempotencyKey: "release-1842" })
}Resources
| Resource | Methods |
|---|---|
payments | create, retrieve, list, listAll, release, waitFor |
customers | create, retrieve, list, listAll, waitFor |
kycSessions | create, retrieve, list, listAll, submit, addDocument |
disputes | create, retrieve, list, listAll |
wallets | retrieve, balances |
signatureRequests | list, listAll, retrieve, cancel, waitFor |
metrics | summary, timeseries |
| Other | me(), credentials.list, ledgerTransactions, network.retrieve, assets.list |