← ClaudeAtlas

typescript-calling-endpointslisted

Call operations on the PayPal Server SDK TypeScript SDK. Load before the first call, and when building a request body or reading a response. The signature won't tell you controllers are constructed rather than accessed off the client, that an operation takes either positional parameters or one options object, or where `requestOptions` sits.
MuHamza30/paypal-api-plugin · ★ 0 · API & Backend · score 70
Install: claude install-skill MuHamza30/paypal-api-plugin
# Calling endpoints on an APIMatic TypeScript SDK Operations are **async methods on a controller class that you instantiate yourself** — they are *not* properties on the client: ```typescript import { Client, {Controller} } from 'paypal-server-sdklib'; const client = new Client({ /* ... */ }); const api = new {Controller}(client); // you construct this const response = await api.{operation}(/* ... */); ``` There is no `client.{apiGroup}.{operation}(...)` accessor and no operation sitting directly on the client. Controllers live in `src/controllers/`, one file per API group, each extending a shared base class. **Read the exported class name from that file** — the suffix varies per SDK (`Api`, `Controller`, …). Operation names follow no fixed verb/resource pattern — take the real name from the source. ## Method signature convention Every endpoint method is `async` (they all return a `Promise`), and there are **two parameter forms**. Which one an operation uses is decided at generation time, so **read the method signature in `src/controllers/` before writing the call** — both forms end with `requestOptions`. ```typescript // Form A — positional, in declaration order async {operation}( {requiredParam}: {RequestType}, {optionalParam}?: string, requestOptions?: RequestOptions ): Promise<ApiResponse<{ReturnType}>> // Form B — one destructured options object, when parameters are collapsed async {operation}( { {requiredParam}, {optionalParam} }: { {requiredPar