# Manage Operator Shifts

This guide shows how to set up the number of shifts on a terminal, move to the next shift, and read how many shifts are configured, using the Shift deeplink.

## How it works

All three operations share the `getnet://payment/v1/shift` URI and are selected by the `shiftOperation` parameter:

| `shiftOperation` | Action | Notes |
| :--- | :--- | :--- |
| `"1"` | Set up the number of available shifts | Pass the amount in `numberOfShifts`. |
| `"2"` | Change to the next shift | No extra parameter needed. |
| `"3"` | Retrieve the current shift amount | The response adds `totalOfShifts`. |

The terminal adjusts the flow to what you send. When a required value is already in the request, the corresponding input screen is skipped; when it is missing, the terminal prompts the operator for it.

## Before you begin

The Getnet Payment App must be installed on the terminal and your application must be able to launch it, as described in [Architecture and flow](/en/app2app/first-steps-a2a/architecture-flow).

## Step 1: Send the shift Intent

Build the Intent with the operation you need. The example below configures two shifts and takes responsibility for printing:

```kotlin
private val REQUEST_CODE = 1001

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    val intent = Intent(Intent.ACTION_VIEW, Uri.parse("getnet://payment/v1/shift"))
    intent.putExtra("shiftOperation", "1")
    intent.putExtra("numberOfShifts", "2")
    intent.putExtra("allowPrintCurrentTransaction", "false")
    startActivityForResult(intent, REQUEST_CODE)
}
```

The optional `skipConfirmation` parameter suppresses the shift change confirmation screen. The `allowPrintCurrentTransaction` parameter follows the rules in [Printing responsibility](/en/app2app/core-concept-a2a/printing-responsibility).

## Step 2: Handle the response

Read `result` and `resultDetails` from the returned Intent. For `shiftOperation` `"3"`, also read `totalOfShifts`:

```kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
        val extras = data?.extras
        val result = extras?.getString("result")
        val resultDetails = extras?.getString("resultDetails")
        val totalOfShifts = extras?.getString("totalOfShifts")
    }
}
```

A successful setup or change returns `result` `0` with `resultDetails` `APPROVED`. A retrieve operation returns the same pair plus the shift count:

```json
{
  "result": 0,
  "resultDetails": "APPROVED",
  "totalOfShifts": "3"
}
```

`totalOfShifts` is present only when `shiftOperation` is `"3"`.

## Next steps

* [Deeplink parameters reference](/en/app2app/reference-a2a/deeplink-parameters) - the full request and response parameters for the Shift deeplink.
* [Result codes and data structures](/en/app2app/reference-a2a/result-codes-data-structure) - interpret the `result` value returned by the operation.