API Referencesdks@platform/sdk-cash

@platform/sdk-cash

Typed TypeScript client for services/cash. The page is generated from the SDK package source plus its generated OpenAPI types.

Installation

npm install @platform/sdk-cash

You’ll also need the shared auth/client helpers:

npm install @platform/hosts @platform/sdk

Quick start

import { LoopClient } from "@platform/sdk";
import { platformHost, SERVICE_NAMES } from "@platform/hosts";
import { createCashClient } from "@platform/sdk-cash";
 
const loop = new LoopClient({
  clientId: process.env.LOOP_CLIENT_ID!,
  clientSecret: process.env.LOOP_CLIENT_SECRET!,
  redirectUri: "https://your-app.example.com/auth/loop/callback",
});
 
const cash = createCashClient({
  baseUrl: platformHost({ service: SERVICE_NAMES.CASH }),
  accessToken: tokens.access_token,
});

Use the convenience helpers below when the SDK exposes them, or call the typed endpoint methods directly with GET / POST / PATCH / DELETE.

Convenience helpers

This SDK does not add convenience helpers beyond the typed endpoint calls below.

Endpoint calls

GET /health/deep

Underlying REST endpoint: GET /health/deep

Parameters

None

Return type

Promise<{
  data?: paths["/health/deep"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.GET("/health/deep");

GET /readyz

Underlying REST endpoint: GET /readyz

Parameters

None

Return type

Promise<{
  data?: paths["/readyz"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.GET("/readyz");

GET /v1/cash/balance

Underlying REST endpoint: GET /v1/cash/balance

Parameters

  • query: paths["/v1/cash/balance"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/cash/balance"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.GET("/v1/cash/balance", {
  params: {
    query: {
      /* paths["/v1/cash/balance"]["get"]["parameters"]["query"] */
    },
  },
});

POST /v1/cash/grants

Underlying REST endpoint: POST /v1/cash/grants

Parameters

  • header: paths["/v1/cash/grants"]["post"]["parameters"]["header"]
  • body: paths["/v1/cash/grants"]["post"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/cash/grants"]["post"]["responses"]["201"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.POST("/v1/cash/grants", {
  params: {
    header: {
      /* paths["/v1/cash/grants"]["post"]["parameters"]["header"] */
    },
  },
  body: {
    /* paths["/v1/cash/grants"]["post"]["requestBody"]["content"]["application/json"] */
  },
});

GET /v1/cash/ledger

Underlying REST endpoint: GET /v1/cash/ledger

Parameters

  • query: paths["/v1/cash/ledger"]["get"]["parameters"]["query"]

Return type

Promise<{
  data?: paths["/v1/cash/ledger"]["get"]["responses"]["200"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.GET("/v1/cash/ledger", {
  params: {
    query: {
      /* paths["/v1/cash/ledger"]["get"]["parameters"]["query"] */
    },
  },
});

POST /v1/cash/spend

Underlying REST endpoint: POST /v1/cash/spend

Parameters

  • header: paths["/v1/cash/spend"]["post"]["parameters"]["header"]
  • body: paths["/v1/cash/spend"]["post"]["requestBody"]["content"]["application/json"]

Return type

Promise<{
  data?: paths["/v1/cash/spend"]["post"]["responses"]["201"]["content"]["application/json"];
  error?: unknown;
  response: Response;
}>

Example

const result = await cash.POST("/v1/cash/spend", {
  params: {
    header: {
      /* paths["/v1/cash/spend"]["post"]["parameters"]["header"] */
    },
  },
  body: {
    /* paths["/v1/cash/spend"]["post"]["requestBody"]["content"]["application/json"] */
  },
});