# MOTO payments

MOTO (Mail Order / Telephone Order) is a way to take a card payment when the cardholder is not present - for example, an order placed over the phone or by mail. The operator keys the card details (number, expiry, and security code) into the terminal instead of the customer tapping or inserting a card.

## How it works

There is no separate MOTO request and no MOTO flag to send. A MOTO payment is created with the same `makePaymentAndSubscribe` call as any card payment.

The flow:

1. Your app calls `makePaymentAndSubscribe` exactly as it would for any card payment.
2. The operator selects MOTO / manual entry on the terminal and enters the card details.
3. While the form is open, the state-change events report `"inProgressState": "MOTO_FORM_SHOWN"`.
4. The payment completes on the standard lifecycle, with MOTO markers in the completion metadata (`"entryMode": "KEYED"`).

## Create the payment

Create the payment with the standard [makePaymentAndSubscribe](./make-payment.md) call — there is nothing MOTO-specific to pass. The operator chooses to key the card details on the terminal.

## Follow the payment and detect MOTO

Handle the intermediate state-change events the same way as any payment (see [Make Payment](./make-payment.md)). While the payment is in progress, an `inProgressState` of `MOTO_FORM_SHOWN` means the operator is keying in the card details:

```json title="In-progress state change"
{
  "type": "makePaymentAndSubscribe->onPaymentStateChanged",
  "transactionId": "tx-123",
  "state": "IN_PROGRESS",
  "inProgressState": "MOTO_FORM_SHOWN",
  "isFinal": false
}
```

```admonition
icon: fas fa-circle-info
content: On older SDK or payment-app versions, `MOTO_FORM_SHOWN` surfaces as `WAITING_FOR_CARD_ENTRY` instead.
```

## Confirm MOTO on completion

When the payment completes, the `metadata` shows that the card details were keyed in manually. An `entryMode` of `KEYED` is the definitive marker that a completed payment was taken as MOTO / manual entry:

```json title="Completion metadata"
{
  "state": "SUCCESSFUL",
  "isFinal": true,
  "metadata": {
    "card": { "last4": "4242", "brand": "VISA", "type": "CREDIT" },
    "entryMode": "KEYED",
    "verificationMethod": "NONE",
    "responseCode": "00",
    "authorisationCode": "A8RLR8"
  }
}
```

## Availability

MOTO support is delivered by the terminal. Until a terminal supports it, the `MOTO_FORM_SHOWN` in-progress state stays dormant. Confirm the minimum terminal app version with Teya before going live.

As with all payment states, your `inProgressState` and `reason` handling should tolerate new or unrecognised values, so the integration keeps working as new states are introduced.
