> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/developers-guides/scripting/endpoints/customer-provider-obsolete.md).

# Obsolete customerProvider script key

How the obsolete runtime.scriptable.customerProvider key still runs and how to move a script to the pass data provider.

{% hint style="warning" %}
**Deprecated.** Register `runtime.scriptable.passDataProvider.{scriptId}` instead, as described in [Pass data provider](https://docs.thewalletcrew.io/developers-guides/scripting/endpoints/pass-data-provider.md). Legacy names are listed in [Obsolete neostore names](https://docs.thewalletcrew.io/developers-guides/scripting/modules/obsolete-neo-names.md).
{% endhint %}

`runtime.scriptable.customerProvider.{scriptId}` is the former name of the [pass data provider](https://docs.thewalletcrew.io/developers-guides/scripting/endpoints/pass-data-provider.md). Scripts registered under it keep working, but the name is obsolete: new scripts register `runtime.scriptable.passDataProvider.{scriptId}`, and existing ones should be moved when they are next edited. This page explains how the obsolete key is still resolved, what changes with the new key (nothing in the configuration, more in the admin console) and how to migrate a script safely. The `customerProviders` setting in `server/account.yml` stays live; only the endpoint key is obsolete.

<details>

<summary><strong>Real-world examples</strong></summary>

* A CRM mapping script written years ago fills the points balance of a loyalty pass; it is renamed to the new key in one line, and a `Describe` is added so the pass template editor lists its fields.
* A tenant has the same script id registered under both keys after a partial migration; the old registration is removed so that only one implementation remains.

</details>

## Registration

The obsolete key is `runtime.scriptable.customerProvider.{scriptId}`. It is wired exactly like its replacement, by the same configuration entries, which do not change during a migration:

```yaml
# server/passes/<passType>.yml
dataProviders:
  - provider: script
    scriptId: crm
```

```yaml
# server/account.yml
customerProviders:
  - type: script
    scriptId: crm
```

The handlers are the same too: `Fill(entity)`, required, and `Describe()`, optional and synchronous. Their parameters and return values are described on the [pass data provider](https://docs.thewalletcrew.io/developers-guides/scripting/endpoints/pass-data-provider.md) page.

## When it runs

Each time an entry with `scriptId: crm` runs, The Wallet Crew looks for an implementation in this order:

1. `runtime.scriptable.passDataProvider.crm`: when it is registered, it runs and the search stops.
2. `runtime.scriptable.customerProvider.crm`: when only the obsolete key is registered, it runs, and a warning is recorded stating that the endpoint is obsolete and naming the key to register instead.
3. Neither is registered: the entry runs nothing and counts as having found data.

The same order applies to `Describe`, which the admin console calls to list the script's variables and identifiers.

The warning is recorded once per platform version and tenant for each obsolete key, rather than at every call, so it remains visible in the platform's monitoring without flooding it. The script editor of the advanced configuration also marks the obsolete key as deprecated in its typings.

## Errors and edge cases

* **Both keys registered for the same script id**, in one file or two: the pass data provider runs whatever the load order, and the obsolete registration is ignored, silently. Leaving both in place is a source of confusion, because editing the old one changes nothing.
* **A script id registered under the obsolete key only**: it runs, with the obsolete warning.
* Errors thrown by `Fill` behave as described on the [pass data provider](https://docs.thewalletcrew.io/developers-guides/scripting/endpoints/pass-data-provider.md#errors-and-edge-cases) page.

## Example

Moving a script is a one-line change of the registered key. The configuration keeps its `scriptId`, so the pass types and the account file need no edit.

Before:

```js
async function fill(entity) {
  // reads the CRM and writes entity keys
  return true;
}

export default function (context) {
  context.register('runtime.scriptable.customerProvider.crm', {
    Fill: fill
  });
}
```

After:

```js
async function fill(entity) {
  // reads the CRM and writes entity keys
  return true;
}

function describe() {
  return {
    namespace: 'crm',
    identifiers: [{ key: 'crm.customerId' }],
    fields: [{ path: 'loyaltyPoints', type: 'number', description: 'Current points balance' }]
  };
}

export default function (context) {
  context.register('runtime.scriptable.passDataProvider.crm', {
    Fill: fill,
    Describe: describe
  });
}
```

A safe migration follows four steps:

1. Search the advanced configuration for `runtime.scriptable.customerProvider.` to find every obsolete registration, including duplicates in other files.
2. Change the key to `runtime.scriptable.passDataProvider.` with the same script id, in one file only, and delete any other registration of the same script id.
3. Optionally add `Describe`. A `scriptId` with a hyphen is not a valid namespace: either rename the script id to camelCase in the configuration and the registration, or return a valid `namespace` from `Describe`; otherwise pass types listing the script cannot be saved.
4. Save the configuration and check one pass with the pass data inspection (below).

## Checking the result

`GET /api/{tenantId}/passes/{passId}/data` reports, for a pass, each data provider with its status and the values it wrote; after the migration the script's entry still finds its data and writes the same values. In the admin console, the pass template editor lists the script with its namespace and, once `Describe` is added, its fields. The obsolete warning stops appearing in the platform's monitoring once no entry resolves to the old key.

## FAQ

<details>

<summary><strong>Does the migration change the template variables?</strong></summary>

No. The values are published under the same keys and the same namespace as before, as long as `Describe` does not choose another namespace. When `Describe` returns a namespace different from the `scriptId`, templates that read the namespaced form must be updated to the new namespace.

</details>


---

# 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.thewalletcrew.io/developers-guides/scripting/endpoints/customer-provider-obsolete.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.
