## Start a payment on a terminal

This endpoint initiates a payment flow on a specific terminal. It selects a payment method and notifies the terminal device to start the payment process.

When called, it will notify the terminal device to start the payment process.

It returns true if the notification was sent.

## Endpoint signature

```http
POST https://api.reservepay.com/merchants/start-payment-on-terminal HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

{
  external_id: string?,
  terminal_id: string,
  amount: number,
  currency: string,
  payment_method: string,
  capture: boolean?,
}
```

Returns: boolean

## Request arguments

### `external_id` (string)

_Optional_. Your own identifier for this payment.

### `terminal_id` (string)

**Required**. The ID of the terminal where the payment should be started.

### `amount` (number)

**Required**. The payment amount in the smallest currency unit (e.g. cents).

### `currency` (string)

**Required**. The three-letter ISO currency code (e.g. THB).

### `payment_method` (string)

**Required**. The payment method code (e.g. CARD, PROMPTPAY). Must be enabled on the terminal's installation.

### `capture` (boolean)

_Optional_. Whether to capture the payment automatically. Defaults to true.

## Errors specific to this endpoint

### `NOT_FOUND`

The terminal could not be found.

### `INVALID_ARGUMENT`

The payment method is not allowed or the amount is invalid.

### `NO_INSTALLATION`

The terminal is not properly configured with an installation.

## Errors common to all endpoints

### `UNHANDLED_ERROR`

This error occurs when the server encounters an unexpected internal error that
it cannot handle gracefully. This typically happens due to bugs, infrastructure
issues, or edge cases that weren't anticipated during development.

### `INVALID_ARGUMENTS`

This error occurs when the request contains invalid or missing parameters.
Common cases include missing required fields, or values that don't match the
expected format or type.

### `BAD_VERSION`

This error occurs when making requests to an API version that does not exist.
This commonly happens when using an outdated SDK or when the API version
specified in the request URL is incorrect.
