typescript-calling-endpointslisted
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