# Successive Partial Ticket Cash-out Requests

This is an example of a sequence of successive partial cash-out requests relating to the same ticket.

As market probabilities change over time, so do cashout amounts. This is particularly noticeable in the case of successive partial cash out requests. The cashout amounts for even the same stake amount can be very different due to changing market probabilities.&#x20;

\\

The **first request** initiates a cash-out of 60% of the original stake, leaving the remaining 40% active. The cash-out value is $20.00.

<details>

<summary><strong>Cash-out Request</strong></summary>

```json
{
    "operatorId": 9985,
    "content": {
      "type": "cashout-inform",
      "cashout": {
        "type": "cashout",
        "cashoutId": "COUT95429",
        "details": {
            "type": "ticket-partial",
            "ticketId": "Ticket_3571",
            "ticketSignature": "oe3mjd1wlv+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
            "code": 101,
            "percentage": "0.6",
            "payout": [
                {
                  "type": "cash",
                  "currency": "USD",
                  "amount": "20",
                  "traceId": "Source_2678"
                }
            ]
          }
      },
      "validation": {
        "code": 1100,
        "message": "Validated, OK"
      }
    },
    "correlationId": "aJeuG3wL30",
    "timestampUtc": 1679040819000,
    "operation": "cashout-inform",
    "version": "3.0"
  }
```

</details>

<details>

<summary><strong>Cash-out Response</strong></summary>

```json
{
  "content": {
    "type": "cashout-inform-reply",
    "cashoutId": "COUT95429",
    "signature": "9O5SJ327E7V+VmkVp67coLAe8IXa0sdyOlbPJyy0/dk=",
    "status": "accepted",
    "ticketId": "Ticket_3571",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "aJeuG3wL30",
  "timestampUtc": 1679040820000,
  "operation": "cashout-inform",
  "version": "3.0"
}
```

</details>

As the ticket has been only partially cashed out, it will not appear in the Cashed Out section of the Summary Report or the Ticket Report. Once the ticket is 100% cashed out it will appear in the above reports and will change its state to Cashed Out.

\\

The **second request** is for an additional 30% of the original stake to be cashed out, leaving 10% active. The cash-out in this case is $10.00. Since the request must contain the new values (which are the accumulated values of this and all the previous requests), the values are as follows: "percentage": "0.9", "amount": "30".

<details>

<summary><strong>Cash-out Request</strong></summary>

```json
{
    "operatorId": 9985,
    "content": {
      "type": "cashout-inform",
      "cashout": {
        "type": "cashout",
        "cashoutId": "COUT95890",
        "details": {
            "type": "ticket-partial",
            "ticketId": "Ticket_3571",
            "ticketSignature": "oe3mjd1wlv+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
            "code": 101,
            "percentage": "0.9",
            "payout": [
                {
                  "type": "cash",
                  "currency": "USD",
                  "amount": "30",
                  "traceId": "Source_2890"
                }
            ]
          }
      },
      "validation": {
        "code": 1100,
        "message": "Validated, OK"
      }
    },
    "correlationId": "Jwb4lc9dGx",
    "timestampUtc": 1696944651000,
    "operation": "cashout-inform",
    "version": "3.0"
  }
```

</details>

<details>

<summary><strong>Cash-out Response</strong></summary>

```json
{
  "content": {
    "type": "cashout-inform-reply",
    "cashoutId": "COUT95890",
    "signature": "XIcFdKPLq6DvuneNaqP9033aqshDjL6LSVZwQ3ff6eM=",
    "status": "accepted",
    "ticketId": "Ticket_3571",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "Jwb4lc9dGx",
  "timestampUtc": 1696944652000,
  "operation": "cashout-inform",
  "version": "3.0"
}
```

</details>

\\

The **third cash-out request** pays out the remaining 10% of the original stake and the amount is $2.90. Now the ticket will be cashed out completely, so details.type should be "ticket" (this type does not contain the percentage field) and the amount value is "32.9" (as $32.90 is the sum of all amounts).&#x20;

<details>

<summary><strong>Cash-out Request</strong></summary>

```json
{
    "operatorId": 9985,
    "content": {
      "type": "cashout-inform",
      "cashout": {
        "type": "cashout",
        "cashoutId": "COUT95890",
        "details": {
            "type": "ticket",
            "ticketId": "Ticket_3571",
            "ticketSignature": "oe3mjd1wlv+SmjWB3xDB0AIB6fUZVFOvmGKm6Rcvxm0=",
            "code": 101,
            "payout": [
                {
                  "type": "cash",
                  "currency": "USD",
                  "amount": "32.9",
                  "traceId": "Source_2932"
                }
            ]
          }
      },
      "validation": {
        "code": 1100,
        "message": "Validated, OK"
      }
    },
    "correlationId": "zyB2kG6qM8",
    "timestampUtc": 1696945206000,
    "operation": "cashout-inform",
    "version": "3.0"
  }
```

</details>

<details>

<summary><strong>Cash-out Response</strong></summary>

```json
{
  "content": {
    "type": "cashout-inform-reply",
    "cashoutId": "COUT95932",
    "signature": "DsKGJqqy1FGik25Y3aky2vSOaMP5b1Bz7JPvomS9d40=",
    "status": "accepted",
    "ticketId": "Ticket_3571",
    "code": 0,
    "message": "Transaction processed"
  },
  "correlationId": "zyB2kG6qM8",
  "timestampUtc": 1696945207000,
  "operation": "cashout-inform",
  "version": "3.0"
}
```

</details>
