Generate REST call code
pc_generate_callGenerate ready-to-adapt code for Partner Center REST scenarios in your chosen language, including token exchange, retry, polling, and pagination boilerplate. Returns code as text; never executes.
Instructions
Emit ready-to-adapt code for one Partner Center scenario in the language you ask for, plus the Secure Application Model token exchange, 429 retry, 202 polling, and pagination boilerplate. Use this when you want code. For a structured method/url/headers/body object to send yourself, use pc_build_request; for the underlying facts and gotchas, use pc_get_scenario. Only current REST is emitted — never the archived .NET SDK. Read-only, offline, deterministic: the code is returned as text and is never executed, and the placeholder credentials it contains are read from environment variables at your end. An unknown id returns ok:false with suggestions listing every valid id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Exact scenario id in kebab-case, e.g. "create-cart". Case-sensitive; discover ids with pc_list_scenarios or any pc_plan_* tool. | |
| language | Yes | Target language for the snippet. Required — there is no default. "curl", "csharp", and "typescript" come from curated per-scenario examples; "powershell" is generated from the endpoint definition and is therefore more skeletal. | |
| includeHelpers | No | Whether to append the reusable boilerplate — token exchange, 429/Retry-After handling, 202 polling, pagination — as a separate `helpers` field. Defaults to true. Set false when you already have that plumbing and only want the call itself. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the call succeeded and `data` is populated; false when `error` explains why not. | |
| data | No | The result payload. Present only when `ok` is true. | |
| error | No | Human-readable reason the call failed. Present only when `ok` is false. | |
| suggestions | No | Valid values to retry with, returned alongside `error` when the requested identifier was not found. |