# Pre-validated Ticket Placement Response

<table><thead><tr><th width="114.609375" align="center">Destination</th><th width="54.75262451171875" align="center"></th><th width="115.19964599609375" align="center">Source</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>

### Ticket structure <a href="#mtsprevalidatedticketplacementresponse-v3.0-ticketstructure" id="mtsprevalidatedticketplacementresponse-v3.0-ticketstructure"></a>

The **Pre-validated ticket placement response**, like any other ticket, consists of the envelope and content.

The content part represents the ticket itself and is included in the Content object.\
Its most complex part, the BetDetails array, is described in a separate table below.

**Envelope and Content table:**

The Envelope provides the content's (Pre-validated ticket placement response) context and contains the following fields (besides Content):

* correlationId
* timestampUtc
* operation
* version

<table data-full-width="true"><thead><tr><th width="350.8446044921875">Example</th><th width="174.3853759765625">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>  "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": "62ka01mxre",
</code></pre></td><td>correlationId</td><td>Same string as submitted by the client in the Pre-validated ticket placement request</td><td>M</td><td>String</td></tr><tr><td><pre><code>  "timestampUtc": 1689752904000,
</code></pre></td><td>timestampUtc</td><td>Timestamp of the response placement (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-placement-inform",
</code></pre></td><td>operation</td><td>Should be "ticket-placement-inform" in the case of a Pre-validated ticket placement response</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 (Pre-validated ticket placement response) <a href="#mtsprevalidatedticketplacementresponse-v3.0-contentcontentobject-pre-validatedticketplacementrespons" id="mtsprevalidatedticketplacementresponse-v3.0-contentcontentobject-pre-validatedticketplacementrespons"></a>

The Content object includes the following fields:

* type
* signature
* status
* ticketId
* code
* message
* betDetails
* exchangeRate<br>

**Please note** that in the case of major ticket errors or internal system errors the content object has a different structure and contains "type": "error-reply" instead of "type": "ticket-reply. For description, see [Error-reply Response](https://docs.sportradar.com/transaction30api/api-description/ticket-json-format-description/error-reply-response).

**Content object table**

<table data-full-width="true"><thead><tr><th width="351">Example</th><th width="136.11279296875">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 data-overflow="wrap"><code>      "type": "ticket-inform-reply",
</code></pre></td><td>type</td><td><p>Declaration of the content type, should be "ticket-inform-reply" in the case of a Pre-validated ticket placement response</p><p>or "error-reply" in the case of major ticket errors or internal system errors (see also <a href="error-reply-response">Error-reply Response</a>).</p></td><td>M</td><td>String</td></tr><tr><td><pre data-overflow="wrap"><code>      "signature": "gOxOcWAjiPn8hEjyPlzDY
u0B7aNA85fOeAB8m1j+Wm0=",
</code></pre></td><td>signature</td><td>String calculated and sent by MTS to be used as a proof that the response has actually been provided by MTS,<br>minimal string length = 1,<br>maximum string length = 128</td><td>M</td><td>String</td></tr><tr><td><pre><code>      "status": "accepted",
</code></pre></td><td>status</td><td><p>Suggestion on ticket acceptance, provided by MTS,<br>enumerator:</p><ul><li>accepted</li><li>rejected</li></ul></td><td>M</td><td>String</td></tr><tr><td><pre><code>      "ticketId": "Ticket_10150",
</code></pre></td><td>ticketId</td><td>Used to identify the ticket that this response relates to,<br>minimal string length = 1,<br>maximum string length = 128</td><td>M</td><td>String</td></tr><tr><td><pre><code>      "code": 0,
</code></pre></td><td>code</td><td>Ticket response validation code (the main reason the ticket has eventually been rejected),<br>see list of <a href="../validation-codes">validation codes</a></td><td>M</td><td>Integer</td></tr><tr><td><pre data-overflow="wrap"><code>      "message": "Transaction processed",
</code></pre></td><td>message</td><td>Readable ticket response validation code, minimal string length = 1,<br>maximum string length = 128<br>(example is shortened)</td><td>O</td><td>String</td></tr><tr><td><pre><code>      "betDetails":   [
         ........
         ........
         ],
</code></pre></td><td>betDetails</td><td>Code and message fields in the betDetails array indicate potential errors in the requested bet in the Pre-validated ticket placement request.<br>For syntax, see the <a href="../ticket-placement-response#mtsticketplacementresponse-v3.0-betdetailsbetdetailsarray">betDetails array description</a>.</td><td>O</td><td>Array</td></tr><tr><td><pre><code>      "exchangeRate":   [
</code></pre></td><td>exchangeRate</td><td>MTS has a system currency (used for defining liability limits etc.),<br>this rate was used at ticket acceptance time when converting the actual bet currency to the MTS system currency</td><td>O</td><td>Array</td></tr><tr><td><pre><code>          { 
            "fromCurrency": "USD",
</code></pre></td><td><ul><li>fromCurrency</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>            "toCurrency": "EUR",
</code></pre></td><td><ul><li>toCurrency</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>            "rate": "1.07326"
           }
       ]
  },          
</code></pre></td><td><ul><li>rate</li></ul></td><td>Non-system currency unit per one system currency unit, 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></tbody></table>
