> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketsflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code blocks

> How to write inline code, syntax-highlighted blocks, code groups, and API examples in Pocketsflow documentation.

Clear, copy-pasteable code is central to the API and integration docs. This
**contributor reference** shows every code component available on this site.

## Inline code

Wrap a `word` or `phrase` in backticks:

```md theme={null}
Wrap a `word` or `phrase` in backticks.
```

Use inline code for endpoints (`POST /checkout/sessions`), field names
(`metadata`), values (`pk_test_…`), and file paths (`apps/docs/docs.json`).

## Code blocks

Fence code with triple backticks and a **language** for syntax highlighting.
Optionally add a **filename/title** after the language:

```javascript checkout.js theme={null}
const res = await fetch("https://api.pocketsflow.com/checkout/sessions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POCKETSFLOW_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ productId, successUrl, cancelUrl }),
});
```

The Markdown for the block above:

````md theme={null}
```javascript checkout.js
const res = await fetch("https://api.pocketsflow.com/checkout/sessions", { ... });
```
````

<Tip>
  Always set a language tag — it drives highlighting and helps screen readers.
  Use realistic values (`pk_test_…`, a real endpoint), never real secrets.
</Tip>

## Code groups (multiple languages)

Use `<CodeGroup>` to show the same task in several languages as tabs — the
standard way integration examples are documented here:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.pocketsflow.com/checkout/sessions \
    -H "Authorization: Bearer pk_test_xxx" \
    -H "Content-Type: application/json" \
    -d '{ "productId": "65a1b2c3d4e5f6a7b8c9d0e1" }'
  ```

  ```js Node.js theme={null}
  const res = await fetch("https://api.pocketsflow.com/checkout/sessions", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.POCKETSFLOW_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ productId: "65a1b2c3d4e5f6a7b8c9d0e1" }),
  });
  ```

  ```php PHP theme={null}
  $response = wp_remote_post( 'https://api.pocketsflow.com/checkout/sessions', array(
    'headers' => array( 'Authorization' => 'Bearer ' . POCKETSFLOW_API_KEY ),
    'body'    => wp_json_encode( array( 'productId' => '65a1b2c3d4e5f6a7b8c9d0e1' ) ),
  ) );
  ```
</CodeGroup>

````md theme={null}
<CodeGroup>
```bash cURL
...
```
```js Node.js
...
```
</CodeGroup>
````

## Request & response examples

For API endpoint pages, `<RequestExample>` and `<ResponseExample>` render the
request and a sample response side-by-side:

<RequestExample>
  ```bash Create checkout session theme={null}
  curl -X POST https://api.pocketsflow.com/checkout/sessions \
    -H "Authorization: Bearer pk_test_xxx" \
    -H "Content-Type: application/json" \
    -d '{ "productId": "65a1b2c3d4e5f6a7b8c9d0e1", "metadata": { "external_order_id": "WC-1043" } }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "cs_9f2a…",
    "url": "https://yourstore.pocketsflow.com/checkout?session=cs_9f2a…"
  }
  ```
</ResponseExample>

## Highlighting, line numbers, and focus

Mintlify supports meta options after the language for emphasis:

````md theme={null}
```js Node.js {2-3} showLineNumbers
const key = process.env.POCKETSFLOW_API_KEY; // highlighted
const url = "https://api.pocketsflow.com";   // highlighted
```
````

## Conventions for these docs

* **Real, runnable examples.** Use the real base URL
  (`https://api.pocketsflow.com`) and realistic IDs.
* **Never include real secrets.** Use `pk_test_…` placeholders and read keys
  from environment variables in examples.
* **Keep server-side secrets server-side** in every sample — never show an API
  key or webhook signing secret in browser code.
* **Match existing examples** — the integration guides standardize on cURL /
  Node.js / PHP tabs.

## Related topics

* [Docs configuration](/essentials/settings)
* [Images & embeds](/essentials/images)
* [Custom platforms](/integrations/custom-platforms) — real code examples in context
