@cosmosapp/pay_sdkServer

The Client

The Client object: the managers it exposes, its constructor options, and the self-acting structures it returns.

Almost everything you do goes through a single Client instance. It groups the API into one manager per resource and returns objects that can act on themselves.

import { Client } from '@cosmosapp/pay_sdk';
const client = new Client({ apiKey: process.env.COSMOS_PAY_API_KEY });

One client exposes every resource through its own manager.

ManagerResourceKey methods
client.paymentIntentsStellar SEP-7 intentscreateTx · createPay · fetch · list · update · delete · validate
client.webhooksEndpoints + deliveries + event listenercreate · list · fetch · update · delete · rotateSecret · ping · fetchDeliveries · redeliver · on(...) · process · createHandler · middleware
client.productsProducts / pricescreate · list · fetch · update · delete
client.customersCustomers and their walletscreate · list · fetch · update · delete · addWallet · removeWallet
client.privatePaymentsPrivate payments (amounts hidden on-chain; Stellar Testnet for now)create · list · fetch · config
client.usdt0USDT0 from Stellar to EVM networks (LayerZero, mainnet only)routes · quote · create · list · fetch · submit
client.analyticsRead-only metricssummary · series · balances · apiLogs · webhookLogs
client.healthLiveness / readinessliveness · readiness

Returned objects are "structures"

Manager methods return rich instances (PaymentIntent, PrivatePayment, Usdt0Transfer, WebhookEndpoint, Product, Customer) that can act on themselves and expose typed accessors — e.g. intent.isPay, intent.assetLabel, await intent.validate(txHash), await endpoint.disable(). Call .toJSON() for the raw payload.

References

  • Client: The main entry point of the SDK — a single, atomic client that exposes every resource through its own manager — an atomic, single-client design.
  • Customer: A customer record, optionally enriched with on-chain payment stats.
  • PaymentIntent: A Stellar SEP-7 payment intent
  • PrivatePayment: A private payment, from client.privatePayments: an amount in XLM whose value is hidden on-chain
  • Product: A product / price the consumer can charge for.
  • Usdt0Transfer: A USDT0 transfer from Stellar to an EVM network through LayerZero, from client.usdt0
  • WebhookEndpoint: A registered webhook endpoint

On this page