> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runpayments.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runpayments.io/_mcp/server.

# Prompt for a tip

POST https://javelin.runpayments.io/api/terminal/{device_id}/tip
Content-Type: application/json

Shows the tip screen on the terminal for the given base amount and returns the customer's choice. This endpoint doesn't read
or charge a card. Returns an `interaction_id` immediately. Get the result with [Get tip status](/reference/terminal-api/tip/terminal-tip-status)
or over WebSocket by subscribing to `terminal_job:{interaction_id}`.

Requires a terminal where `capabilities.tip` is `true` (see [List terminals](/reference/terminal-api/terminals/list-terminals)).
Otherwise the request returns `400 not supported`.

To prompt for a tip and charge the tip-inclusive total in one call, use [Charge a card](/reference/terminal-api/charge-card/initiate-charge)
with `include_tip` set to `true`.

**`amount` must include a decimal point.** An amount without one is read as cents, so `"10"` is ten cents. Send `"10.00"` for ten dollars.

Tip interactions expire about 3 minutes after the last activity. A finished result is kept for 2 minutes.

### 400 error messages

| Message                                | Cause                                                                         |
| -------------------------------------- | ----------------------------------------------------------------------------- |
| `not supported`                        | The terminal doesn't support tipping.                                         |
| `Field amount is required`             | `amount` is missing.                                                          |
| `Field amount is invalid`              | `amount` is zero, negative, non-numeric, or has more than two decimal places. |
| `Field tip_percent_presets is invalid` | A preset isn't a whole number.                                                |

Reference: https://docs.runpayments.io/reference/terminal-api/tip/terminal-tip

## Authentication

- `Authorization` header (bearer token, required) — Use a Payments API key as the bearer token: `Authorization: Bearer <api_key>`. Get a fresh key from [Refresh API Keys](/reference/authentication/refresh-api-keys).

## Request

### Path parameters

- `device_id` (string, required) — Hardware Serial Number (HSN) of the terminal, provided by your Integration Delivery lead.

### Query parameters

- `mid` (string, optional) — Merchant ID. Required when your bearer token is an ISV token acting on behalf of a merchant. If the `mid` can't be resolved to an authorized account, the request returns `400`.

### Body (application/json)

This endpoint expects a TipRequest.

- `amount` (string, required) — Base amount before tip, in decimal dollars. Must be greater than zero with at most two decimal places. Include a decimal point: an amount without one is read as cents, so `"10"` is ten cents.
- `tip_prompt` (string, optional, default: Add a tip?) — Text shown above the tip options on the terminal.
- `tip_percent_presets` (list of string, optional) — Percentage buttons shown on the terminal, as whole numbers.
- `include_custom_tip_amount` (boolean, optional, default: true) — Show a button for the customer to enter their own tip amount.

## Response

### 202

Interaction accepted. Use the `interaction_id` to poll for status or subscribe over WebSocket.

- `interaction_id` (string, required) — Identifier for the queued interaction.

## Errors

### 400 Bad Request Error

The terminal doesn't support tipping, or a field is invalid. See the table above for possible messages.

- `error` (string, optional) — Error message.

### 401 Unauthorized Error

Unauthorized

- `errors` (list of string, optional) — Error messages.

### 404 Not Found Error

No terminal with this `device_id` on the authenticated account.

- `error` (string, optional) — Error message.

### 429 Too Many Requests Error

Rate limit exceeded. All Terminal API endpoints share a per-credential rate limit.

- `any`

### 503 Service Unavailable Error

The interaction couldn't be queued and won't run. Safe to retry.

- `error` (string, optional) — Error message.

## Examples

**Request**

```json
{
  "amount": "10.50",
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": [
    "15",
    "18",
    "20"
  ],
  "include_custom_tip_amount": true
}
```

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

**SDK Code**

```python
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/tip"

payload = {
    "amount": "10.50",
    "tip_prompt": "Add a tip?",
    "tip_percent_presets": ["15", "18", "20"],
    "include_custom_tip_amount": True
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/tip';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"amount":"10.50","tip_prompt":"Add a tip?","tip_percent_presets":["15","18","20"],"include_custom_tip_amount":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/tip"

	payload := strings.NewReader("{\n  \"amount\": \"10.50\",\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/tip")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": \"10.50\",\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://javelin.runpayments.io/api/terminal/HSN123456789/tip")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": \"10.50\",\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://javelin.runpayments.io/api/terminal/HSN123456789/tip', [
  'body' => '{
  "amount": "10.50",
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": [
    "15",
    "18",
    "20"
  ],
  "include_custom_tip_amount": true
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/tip");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": \"10.50\",\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": "10.50",
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": ["15", "18", "20"],
  "include_custom_tip_amount": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/tip")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```