# External Settlement Request

<table><thead><tr><th width="115.0677490234375" align="center">Source</th><th width="55.919189453125" align="center"></th><th width="114.782958984375" align="center">Destination</th></tr></thead><tbody><tr><td align="center"><strong>Client</strong></td><td align="center"><strong>→</strong></td><td align="center"><strong>MTS</strong></td></tr></tbody></table>

To settle a ticket (or a bet), the operator must send settlement information to MTS in an External settlement request, including the total win amount (between 0 and the maximum payout). A Settlement request must be sent within 30 days of the “expSettleTime” value. The ticket (or bet) will be automatically settled as lost if not received. In the case of multiple selections, the latest expSettleTime value is considered.

**Envelope and Content table:**

The envelope provides the Content's (External settlement request) context and contains the following fields (besides Content):

* operatorId
* correlationId
* timestampUtc
* operation
* version

<table data-full-width="true"><thead><tr><th width="351.26904296875">Example</th><th width="146.87237548828125">Field Name</th><th>Field Description</th><th width="100">Mandatory/ Optional</th><th width="100">Data Type</th></tr></thead><tbody><tr><td><pre><code>{
</code></pre></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><pre><code>  "operatorId": 9985,
</code></pre></td><td>operatorId</td><td>ID to uniquely identify the client from which the ticket originated,<br>ID is provided to the client by Sportradar,<br>The client is obliged to include it in every ticket</td><td>M</td><td>Integer</td></tr><tr><td><pre><code>  "content": {
       .........
       .........
  },    
</code></pre></td><td>content</td><td>See Content object description below</td><td>M</td><td>Object</td></tr><tr><td><pre><code>  "correlationId": "udD52Xk985B",
</code></pre></td><td>correlationId</td><td>Client defined string to facilitate the request-response pairing,<br>Sportradar is obliged to return the same string in every response</td><td>M</td><td>String</td></tr><tr><td><pre><code>  "timestampUtc": 1678354436000,
</code></pre></td><td>timestampUtc</td><td>Timestamp of ticket placement as submitted by the client (Unix time in milliseconds format),<br>minimal: 1,<br>maximum: 9223372036854776000</td><td>M</td><td>Integer</td></tr><tr><td><pre data-overflow="wrap"><code>  "operation": "ticket-ext-settlement",
</code></pre></td><td>operation</td><td>Declaration of ticket content type, should be "ticket-ext-settlement" in case of External settlement request</td><td>M</td><td>String</td></tr><tr><td><pre><code>  "version": "3.0"
</code></pre></td><td>version</td><td>Indicates the ticket format version</td><td>M</td><td>String</td></tr><tr><td>}</td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table>

### Content object (External settlement request) <a href="#mtsexternalsettlementrequest-v3.0-contentobject-externalsettlementrequest" id="mtsexternalsettlementrequest-v3.0-contentobject-externalsettlementrequest"></a>

This object constitutes the ticket itself and includes the following fields:

* type
* settlementId
* details

**Content object table:**

<table data-full-width="true"><thead><tr><th width="351">Example</th><th width="170.1666259765625">Field Name</th><th>Field Description</th><th width="100">Mandatory/ Optional</th><th width="100">Data Type</th></tr></thead><tbody><tr><td><pre><code>"content": {
</code></pre></td><td><br></td><td><br></td><td><br></td><td>Object</td></tr><tr><td><pre><code>    "type": "ext-settlement",
</code></pre></td><td>type</td><td>Declaration of content type, should be "ext-settlement" in case of External settlement request</td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>    "settlementId": "SETL3134413498778", 
</code></pre></td><td>settlementId</td><td>Unique ID of this particular settlement request in client's system, referenced in eventual ack message, minimal string length = 1,<br>maximum string length = 128</td><td>M</td><td>String</td></tr><tr><td><pre><code>    "details": {
</code></pre></td><td>details</td><td>Settlement details - additional information related to the settlement</td><td>M</td><td>Object</td></tr><tr><td><pre><code>        "type": "bet",
</code></pre></td><td><ul><li>type</li></ul></td><td><p>Settlement can relate either to a ticket or a bet, enumerator:</p><ul><li>ticket</li><li>bet</li></ul></td><td>M</td><td>String</td></tr><tr><td><pre><code>        "ticketId": "Ticket_3690",
</code></pre></td><td><ul><li>ticketId</li></ul></td><td>ID of the original ticket that is to be affected by this settlement</td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>        "ticketSignature": "HHDut7XIEl+SmjWB3x
DB0AIB6fUZVFOvmGKm6Rcvxm0=",
</code></pre></td><td><ul><li>ticketSignature</li></ul></td><td>Signature from MTS's response to initial ticket placement</td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>        "betId": "Ticket_3690_bet0",
</code></pre></td><td><ul><li>betId</li></ul></td><td>Present only if "type": "bet",<br>ID of the original bet that is to be affected by this settlement</td><td>M<br>only if "type": "bet"</td><td>String</td></tr><tr><td><pre><code>        "payout": [       
</code></pre></td><td><ul><li>payout</li></ul></td><td>Settlement payout array,<br>minimal number of payouts per settlement =1,<br>maximum number = 5</td><td>M</td><td>Array</td></tr><tr><td><pre><code>          {
            "type": "cash",
</code></pre></td><td><ul><li><p></p><ul><li>type</li></ul></li></ul></td><td><p>Enumerator:</p><ul><li>cash</li><li>withheld</li></ul></td><td>M</td><td>String</td></tr><tr><td><pre><code>            "currency": "EUR",
</code></pre></td><td><ul><li><p></p><ul><li>currency</li></ul></li></ul></td><td>3 or 4 letter currency code, BTC and mBTC are also supported (4 letters only apply to mBTC).<br>For more details please check<br><a href="https://www.iso.org/iso-4217-currency-codes.html">https://www.iso.org/iso-4217-currency-codes.html</a></td><td>M</td><td>String</td></tr><tr><td><pre><code>            "amount": "100",
</code></pre></td><td><ul><li><p></p><ul><li>amount</li></ul></li></ul></td><td>String pattern: 1 up to 8 digits, optionally followed by a decimal point and 1 up to 8 digits,<br>Java regex: ^\\d{1,8}(\\.\\d{1,8})?$</td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>            "traceId": "Source_2099",       
</code></pre></td><td><ul><li><p></p><ul><li>traceId</li></ul></li></ul></td><td><p>A string to help identify the source of operation/action/state</p><p>Minimal string length = 1,<br>maximum length = 128,</p></td><td>O</td><td>String</td></tr><tr><td><pre><code>            "stakeOrigin": "cash"
            }
          ]
       }
   },  
</code></pre></td><td><ul><li><p></p><ul><li>stakeOrigin</li></ul></li></ul></td><td><p>Enumerator:</p><ul><li>cash</li><li>bonus</li><li>free</li><li>free-cash</li><li>free-rollover</li></ul></td><td>O</td><td>String</td></tr></tbody></table>
