> For the complete documentation index, see [llms.txt](https://docs.pandium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandium.com/getting-started/integration-patterns/cassettes.md).

# Cassettes

The cassette integration pattern: code you write that runs inside a third-party platform's own runtime, such as a Magento module, NetSuite SuiteScript, or Salesforce Apex, backed by a Pandium-hosted s

"Cassette" is our name for the pattern where the platform runs code you wrote inside its own runtime, rather than Pandium running it inside ours, the way a tape deck runs whatever is on the cassette you hand it. A Magento module, a NetSuite SuiteScript, a Salesforce Apex component, a Shopify Function: each one is code that lives and executes on the third party's infrastructure, not on Pandium's.

<figure><img src="https://4017407078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfJn-9R_dn6dvcGNcdk%2Fuploads%2Fgit-blob-bc483b503689c4e8a211a5ed2327ad9065d87ff1%2F04-cassette.png?alt=media" alt="A platform event inside the third party&#x27;s runtime invokes your cassette, which calls a Pandium-hosted service that holds the real logic and talks to your API"><figcaption></figcaption></figure>

## Why this pattern exists

Some hooks are only available from inside the platform. Intercepting a record before it saves, or reading data where it already lives without a network hop, is not possible from an external job or webhook. The platform has to be the one running your code.

Cassettes are also often the route to an app store listing. Some marketplaces, NetSuite's among them, expect a native component installed in the customer's account rather than an integration that only talks to the API from outside. See [Listing in External Marketplaces](https://docs.pandium.com/marketplaces/listing-in-external-marketplaces.md) for the marketplaces Pandium supports directly.

## How it works on Pandium

Keep the cassette thin. The code that ships into the platform should do the minimum the platform requires, then hand off over HTTPS to a service hosted on Pandium that holds the real business logic and talks to your API. That keeps one copy of the logic in a place you control, and keeps the in-platform artifact small enough to version and upgrade without pain.

## The trade-off

You are building in the platform's language, inside its sandbox limits, on its release cycle. Every customer install becomes a deployed artifact you have to version, upgrade, and support out in the wild, rather than something running centrally on Pandium's infrastructure. That is why, outside of app store requirements, most of the NetSuite integrations we build use the [batch pattern](https://docs.pandium.com/getting-started/integration-patterns/batch-and-api-triggered-syncs.md) against the NetSuite API instead.

## Where this shows up

* A Magento module that surfaces your app inside the merchant's admin and intercepts cart or order events
* A NetSuite SuiteScript bundle built to qualify for the SuiteApp marketplace
* A Salesforce Apex component running your logic inside a customer's org

## When to use it

Reach for a cassette when the platform gives no other way in, or the integration needs to live inside its UI. Like provider APIs, this is usually the platform's requirement rather than a genuine choice between patterns.

## Related reading

* [Listing in External Marketplaces](https://docs.pandium.com/marketplaces/listing-in-external-marketplaces.md)
* [App marketplace-ready connectors](https://www.pandium.com/blogs/app-marketplace-ready-connectors)
* [Provider API (Reverse Webhook)](https://docs.pandium.com/getting-started/integration-patterns/provider-api.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pandium.com/getting-started/integration-patterns/cassettes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
