# 4-fold Accumulator with Payout-modifier Selections

This is an example of a 4-fold accumulator with two payout-modifier selections referring to different events. The ticket contains only one bet (Bets array length = 1), which further contains four selections (Selections array length = 4).

Two selections are of type "payout-modifier" and contain the reference to be used in the settlement request if any of the selections meet the payout-modifier criteria defined on the client's platform. Other selections are regular UF selections that will be settled according to feed settlement messages.

<details>

<summary><strong>Ticket Placement Request</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "ticket",
    "ticketId": "Ticket_6230",
    "bets": [
      {
        "selections": [
          {
            "type": "uf",
            "productId": "3",
            "eventId": "sr:match:14938771",
            "marketId": "223",
            "outcomeId": "1715",
            "specifiers": "hcp=1.5",
            "odds": {
              "type": "decimal",
              "value": "1.1"
            }
          },
          {
            "type": "payout-modifier",
            "reference": "eSJHupTuWfoLS6ZsKPj2NB43ir4DHZMI",
            "description": "supersub",
            "selection": {
              "type": "uf",
              "productId": "1",
              "eventId": "sr:match:15163591",
              "marketId": "1",
              "outcomeId": "2",
              "specifiers": "hcp=1:0",
              "odds": {
                "type": "decimal",
                "value": "1.48"
              }
            }
          },
          {
            "type": "uf",
            "productId": "3",
            "eventId": "sr:match:15050881",
            "marketId": "1",
            "outcomeId": "2",
            "odds": {
              "type": "decimal",
              "value": "1.32"
            }
          },
          {
            "type": "payout-modifier",
            "reference": "EZ0wq6jxM6WXTvKtkbUFCzooiGcTqABm",
            "description": "2up",
            "selection": {
              "type": "uf",
              "productId": "1",
              "eventId": "sr:match:16470657",
              "marketId": "1",
              "outcomeId": "2",
              "odds": {
                "type": "decimal",
                "value": "7.1"
              }
            }
          }
        ],
        "stake": [
          {
            "type": "cash",
            "currency": "EUR",
            "amount": "50"
          }
        ]
      }
    ],
    "context": {
      "channel": {
        "type": "retail",
        "shopId": "shop_789135"
      },
      "limitId": 1409
    }
  },
  "correlationId": "tesd83nky7sc",
  "timestampUtc": 1678886959000,
  "operation": "ticket-placement",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Ticket Placement Response</strong></summary>

```json
{
  "content": {
    "type": "ticket-reply",
    "signature": "hlDfZ5uX5+SftXxb4+M0Mp3sN7v4cZPEfXBdX4T32qw=",
    "status": "accepted",
    "ticketId": "Ticket_6230",
    "code": 0,
    "message": "Transaction processed",
    "betDetails": [
      {
        "selectionDetails": [
          {
            "selection": {
              "type": "uf",
              "productId": "3",
              "eventId": "sr:match:14938771",
              "marketId": "223",
              "outcomeId": "1715",
              "specifiers": "hcp=1.5",
              "odds": {
                "type": "decimal",
                "value": "1.1"
              }
            },
            "code": 0,
            "message": "Transaction processed"
          },
          {
            "selection": {
              "type": "uf",
              "productId": "1",
              "eventId": "sr:match:15163591",
              "marketId": "1",
              "outcomeId": "2",
              "specifiers": "hcp=1:0",
              "odds": {
                "type": "decimal",
                "value": "1.48"
              }
            },
            "code": 0,
            "message": "Transaction processed"
          },
          {
            "selection": {
              "type": "uf",
              "productId": "3",
              "eventId": "sr:match:15050881",
              "marketId": "1",
              "outcomeId": "2",
              "odds": {
                "type": "decimal",
                "value": "1.32"
              }
            },
            "code": 0,
            "message": "Transaction processed"
          },
          {
            "selection": {
              "type": "uf",
              "productId": "1",
              "eventId": "sr:match:16470657",
              "marketId": "1",
              "outcomeId": "2",
              "odds": {
                "type": "decimal",
                "value": "7.1"
              }
            },
            "code": 0,
            "message": "Transaction processed"
          }
        ],
        "code": 0,
        "message": "Transaction processed"
      }
    ],
    "exchangeRate":   [
      {
        "fromCurrency": "EUR",
        "toCurrency": "EUR",
        "rate": "1.00000"
      }
    ]
  },
  "correlationId": "tesd83nky7sc",
  "timestampUtc": 1678886960000,
  "operation": "ticket-placement",
  "version": "3.0"
}
```

</details>

The settlement for selections eligible for payout-modifier is done using the payout-modifier settlement request (below). It contains a reference to the corresponding payout-modifier promotion. When such a message is received, all tickets containing that particular payout-modifier option (tickets are found by matching reference) would be updated to reflect the received settlement. It is important to note that payout-modifier settlement will be applied only if the resulting odds would be more favorable to the punter.

If the ticket is fully settled and the payout-modifier hasn't been received within 12 hours (to be defined) of the ticket settlement, no further early payout "corrections" will be accepted.

Payout modifier can change the result of the underlying selection (result is of type "#/$defs/sel-result"):

<details>

<summary><strong>Payout Modifier Settlement Request - Result</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "payout-modifier-settlement",
    "settlementId": "SETL3134413498778",
    "reference": "eSJHupTuWfoLS6ZsKPj2NB43ir4DHZMI",
    "settlement": {
      "type": "result",
      "result": {
        "type": "win",
        "deadHeatFactor": "0.5"
	      }
	   }
   },
  "timestampUtc": 1678883043000,
  "operation": "payout-modifier-settlement",
  "version": "3.0"
  }
```

</details>

<details>

<summary><strong>Payout Modifier Settlement Response</strong></summary>

```json
{
  "content": {
    "type": "payout-modifier-settlement-reply",
    "settlementId": "SETL3134413498778",
    "signature": "mHFX4dXMq4b3aqnVbgiFL06LlHZTU4pj7Qn8rYnmLgA=",
    "status": "accepted",
    "reference": "eSJHupTuWfoLS6ZsKPj2NB43ir4DHZMI,
    "code": 0,
    "message": "Transaction processed"
  },
  "timestampUtc": 1678883044000,
  "operation": "payout-modifier-settlement",
  "version": "3.0"
}
```

</details>

or the effective odds of the underlying selection (odds are of type "#/$defs/odds-fixed"):

<details>

<summary><strong>Payout Modifier Settlement Request - Odds</strong></summary>

```json
{
  "operatorId": 9985,
  "content": {
    "type": "payout-modifier-settlement",
    "settlementId": "SETL3134413498778",
    "reference": "EZ0wq6jxM6WXTvKtkbUFCzooiGcTqABm",
    "settlement": {
      "type": "odds",
      "odds": {
        "type": "decimal",
        "value": "1.75"
	    }
	   }
   },
  "timestampUtc": 1678883045000,
  "operation": "payout-modifier-settlement",
  "version": "3.0"
}
```

</details>

<details>

<summary><strong>Payout Modifier Settlement Response</strong></summary>

```json
{
  "content": {
    "type": "payout-modifier-settlement-reply",
    "settlementId": "SETL3134413498778",
    "signature": "mHFX4dXMq4b3aqnVbgiFL06LlHZTU4pj7Qn8rYnmLgA=",
    "status": "accepted",
    "reference": "EZ0wq6jxM6WXTvKtkbUFCzooiGcTqABm",
    "code": 0,
    "message": "Transaction processed"
  },
  "timestampUtc": 1691750046000,
  "operation": "payout-modifier-settlement",
  "version": "3.0"
}
```

</details>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportradar.com/mts/transaction-3.0-api/mts-related-transaction-examples/promo-bets-examples-bonus-boosted-odds-payout-modifier/4-fold-accumulator-with-payout-modifier-selections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
