---
title: "Stock Provider"
canonical_url: "https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/stock"
markdown_url: "https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/stock.md"
last_updated: "2026-10-22T13:00:29Z"
---

# Stock Provider

The **stock** data provider loads Custom Bet offering and odds calculation from Sportradar and enriches market and outcome labels using the same match and translation data as other Sportradar widgets. You do not implement UOF proxy callbacks (`getAvailableMarkets`, `calculate`, and similar). The widget handles those calls internally.

Use this path when custom bet is enabled for your bookmaker and you want the smallest integration surface: a match id, a session `jwt`, and bet slip handling.

## Prerequisites

- **Custom Bet widget** licensed for your `clientId` with custom bet coverage for the events you display.
- **JWT integration** — your RSA **public key** submitted to Sportradar and **published** for validation before production tokens are used ([prerequisites](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/jwt.md#prerequisites-one-time-setup)).
- **`jwt`** — short-lived [JSON Web Token](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/jwt.md#what-a-jwt-is) (RS256) for the logged-in user or session. You sign it on your backend; the widget sends `Authorization: Bearer …` on every offering and calculation request. See [JWT authentication (Stock Provider)](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/jwt.md) for signing and delivery to the page.
- **`matchId`** for an event that supports custom bet for your package.
- **`addToBetSlip`** in `dataProviderConfig` — required for every data provider. See [addToBetSlip](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/overview.md#addtobetslip) and [Handling Selections and Odds](https://apidocs.sportradar.com/resources/widgets/docs/tutorials/handling-selections-and-odds.md).

Service endpoints are supplied through the widget loader client context (defaults are configured for production widgets). If you need non-standard endpoints, coordinate with Sportradar support.

## How It Works

1. On load, the widget requests **available selections** for the match using `matchId` and `jwt`.
2. The widget loads match info, squads where applicable, and translations so market and outcome labels match other Sportradar widgets.
3. When the user changes selections, the widget recalculates odds and updates selectable markets from the Sportradar custom bet service.
4. When the user confirms, **`addToBetSlip`** runs on your side for validation and bet slip integration.

```mermaid
sequenceDiagram
    participant Page as Your page
    participant CB as Custom Bet widget
    participant SR as Sportradar services

    Page->>CB: addWidget (dataProvider stock, jwt, addToBetSlip)
    CB->>SR: available selections
    CB->>SR: match info / translations
    CB-->>Page: markets UI
    Note over CB,SR: User selects outcomes
    CB->>SR: calculate selections
    CB-->>Page: updated odds
    CB->>Page: addToBetSlip(selected outcomes)
```

## Integration Example

```html
<script>
  (function (a, b, c, d, e, f, g, h, i) {
    a[e] ||
      ((i = a[e] = function () {
        (a[e].q = a[e].q || []).push(arguments);
      }),
      (i.l = 1 * new Date),
      (i.o = f),
      (g = b.createElement(c)),
      (h = b.getElementsByTagName(c)[0]),
      (g.async = 1),
      (g.src = d),
      g.setAttribute("n", e),
      h.parentNode.insertBefore(g, h));
  })(window, document, "script", "https://widgets.sir.sportradar.com/betradar/widgetloader", "SIR", {
    language: "en",
    oddsType: "eu",
  });

  SIR("addWidget", "#sr-widget", "customBet", {
    matchId: 50852263,
    dataProvider: "stock",
    jwt: getCustomBetJwt(), // short-lived token from your backend
    dataProviderConfig: {
      addToBetSlip,
    },
  });

  function getCustomBetJwt() {
    // Request a custom-bet JWT from your server — do not hard-code secrets in the browser.
    return "...";
  }

  function addToBetSlip(args, callback) {
    // Validate selections, add to your bet slip, then report success or failure.
    callback({ succeeded: true });
  }
</script>
<div id="sr-widget"></div>
```

## Configuration Summary

| Property                          | Required | Description                                                                                                                                            |
| --------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dataProvider`                    | Yes      | Set to `'stock'`.                                                                                                                                      |
| `jwt`                             | Yes      | RS256 JWT for the current user or session — [JWT authentication](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/jwt.md). |
| `matchId`                         | Yes      | Sportradar match id. See [Getting Identifiers](https://apidocs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md).                |
| `dataProviderConfig.addToBetSlip` | Yes      | Bet slip callback when the user adds the custom bet.                                                                                                   |

All other widget props ([API reference](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/api.md)) work the same as with UOF Proxy (display mode, market filters, theming, and so on).

## Compared to UOF Proxy (Deprecated)

| Topic                                         | UOF Proxy (`uofProxy`) — **deprecated**                              | Data Adapter (`custom`) — **deprecated**                                                                                    | Stock (`stock`) — recommended    |
| --------------------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| Client implements UOF HTTP/proxy              | Yes — five UOF callbacks plus `addToBetSlip` in `dataProviderConfig` | No                                                                                                                          | No                               |
| Client builds offering / calculation payloads | No (UOF XML forwarded)                                               | Yes — `getOffering` / `calculate`                                                                                           | No                               |
| Custom bet API traffic                        | Your infrastructure forwards UOF XML                                 | Your backend or services supply JSON                                                                                        | Widget calls Sportradar directly |
| Auth                                          | Your UOF API key on the proxy                                        | Your integration (no widget `jwt`)                                                                                          | `jwt` prop on the widget         |
| Custom market layouts via client JSON         | No (UOF-driven views)                                                | Yes — [Custom Views](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/custom-views/overview.md) | No                               |

Use **stock** when custom bet is enabled for your bookmaker. If you still use UOF Proxy, see [Migrating from UOF Proxy to Stock](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/migrate-uof-proxy-to-stock.md). Deprecated legacy paths — [UOF Proxy](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/uof-proxy.md) (`uofProxy`) and [Data Adapter](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/integration/data-adapter.md) (`custom`) — are documented only for existing integrations.

## Troubleshooting

| Symptom                                | Likely cause                                                                                    |
| -------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Widget shows an error immediately      | Missing or invalid `jwt` for `dataProvider: 'stock'`.                                           |
| Empty markets                          | `matchId` has no custom bet coverage for your bookmaker, or the service returned no selections. |
| 401 / 403 errors                       | JWT expired or invalid, or public key not published for your bookmaker.                         |
| Player names missing on player markets | Squad data unavailable for that match; offering may still load without player labels.           |

See also [Custom Bet troubleshooting](https://apidocs.sportradar.com/resources/widgets/docs/custom-bet/troubleshooting.md).
