> 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.

# Charge a card

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

Optionally prompts for a tip, reads the card, optionally captures a signature, charges the card, and optionally prints and emails a receipt, all in one call.
Returns an `interaction_id` immediately. Get the result with [Get charge status](/reference/terminal-api/charge-card/get-charge-card-status) or over WebSocket.

The workflow runs in stages: **tip** (only when `include_tip` is `true`) → **read** → **charge** → **print** (only when `print_receipt` is `true`).

Requesting a step the terminal can't perform (for example, `print_receipt` on an Ingenico device) never fails the transaction.
The charge completes and the skipped step is listed in `stage_errors` on the status response.

### Tipping

Set `include_tip` to `true` to prompt the customer for a tip before the card read. The card is then charged for the tip-inclusive total,
and the status response returns `base_amount`, `tip_amount`, and `amount`.

- `tip_prompt`, `tip_percent_presets`, and `include_custom_tip_amount` are only read (and validated) when `include_tip` is `true`.
- If the terminal doesn't support tipping (`capabilities.tip` is `false`) or the tip can't be read, the charge still goes ahead for the original `amount` with no tip, and `result.stage_errors.tip` says why.
- If the customer cancels on the tip screen, the interaction ends as `cancelled` and no card is read.
- The tip is excluded from the surcharge calculation.

To collect a tip without charging, use [Prompt for a tip](/reference/terminal-api/tip/terminal-tip).

`charge-card` interactions can't be cancelled through the API.


Reference: https://docs.runpayments.io/reference/terminal-api/charge-card/initiate-charge

## 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 ChargeCardRequest.

- `amount` (string, required) — Amount in decimal dollars, as a string. Must be greater than zero with at most two decimal places. When `include_tip` is `true`, this is the base amount before tip. Include a decimal point: an amount without one is read as cents, so `"10"` is ten cents.
- `include_tip` (boolean, optional, default: false) — Prompt the customer for a tip before the card read and charge the tip-inclusive total. Requires `capabilities.tip`; if unsupported, the charge runs for `amount` with no tip.
- `tip_prompt` (string, optional, default: Add a tip?) — Text shown above the tip options on the terminal. Used only when `include_tip` is `true`.
- `tip_percent_presets` (list of string, optional) — Percentage buttons shown on the terminal, as whole numbers. Used only when `include_tip` is `true`.
- `include_custom_tip_amount` (boolean, optional, default: true) — Show a button for the customer to enter their own tip amount. Used only when `include_tip` is `true`.
- `confirm_amount` (boolean, optional) — Prompt the cardholder to confirm the amount on the terminal.
- `beep` (boolean, optional) — Play a beep on the terminal when the prompt appears.
- `include_signature` (boolean, optional) — Capture a signature during the read stage. Checked against `capabilities.signature` before the read starts.
- `signature_format` (enum, optional) — Image format of the captured signature.
  - Allowed values: `BMP`, `JPEG`, `PNG`
- `signature_gzip` (boolean, optional) — Compress the returned signature image.
- `signature_dimensions` (string, optional) — Signature image size as `"width,height"`. Each value is up to three digits (max `999`).
- `signature_image_type` (enum, optional) — Color type of the signature image.
  - Allowed values: `binary`, `rgb`
- `print_receipt` (boolean, optional) — Print a receipt after the charge, if the terminal has a printer.
- `send_receipt` (boolean, optional) — Email a receipt after the charge. Independent of `print_receipt`.
- `email` (string, optional) — Recipient email address when `send_receipt` is `true`.
- `order_id` (string, optional) — Order ID for the transaction. If omitted, one is generated in the format `<4-digit random><yymmddHHMMSS>`.

## 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

A field is invalid. Invalid `amount` values (blank, zero, negative, non-numeric, or more than two decimal places) return `Field amount is invalid`. When `include_tip` is `true`, an invalid preset list returns `Field tip_percent_presets is invalid`.

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

### 401 Unauthorized Error

Unauthorized

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

### 404 Not Found Error

Terminal not found on this 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

### Example 1

**Request**

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

**Response**

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

**SDK Code**

```python
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card"

payload = {
    "amount": "10.50",
    "include_tip": True,
    "tip_prompt": "Add a tip?",
    "tip_percent_presets": ["15", "18", "20"],
    "include_custom_tip_amount": True,
    "print_receipt": 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/charge-card';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"amount":"10.50","include_tip":true,"tip_prompt":"Add a tip?","tip_percent_presets":["15","18","20"],"include_custom_tip_amount":true,"print_receipt":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/charge-card"

	payload := strings.NewReader("{\n  \"amount\": \"10.50\",\n  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card")

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  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": \"10.50\",\n  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card', [
  'body' => '{
  "amount": "10.50",
  "include_tip": true,
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": [
    "15",
    "18",
    "20"
  ],
  "include_custom_tip_amount": true,
  "print_receipt": 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/charge-card");
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  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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",
  "include_tip": true,
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": ["15", "18", "20"],
  "include_custom_tip_amount": true,
  "print_receipt": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card")! 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()
```

### Example 2

**Request**

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

**Response**

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

**SDK Code**

```python
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card"

payload = {
    "amount": "10.50",
    "include_tip": True,
    "tip_prompt": "Add a tip?",
    "tip_percent_presets": ["15", "18", "20"],
    "include_custom_tip_amount": True,
    "print_receipt": 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/charge-card';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"amount":"10.50","include_tip":true,"tip_prompt":"Add a tip?","tip_percent_presets":["15","18","20"],"include_custom_tip_amount":true,"print_receipt":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/charge-card"

	payload := strings.NewReader("{\n  \"amount\": \"10.50\",\n  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card")

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  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": \"10.50\",\n  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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/charge-card', [
  'body' => '{
  "amount": "10.50",
  "include_tip": true,
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": [
    "15",
    "18",
    "20"
  ],
  "include_custom_tip_amount": true,
  "print_receipt": 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/charge-card");
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  \"include_tip\": true,\n  \"tip_prompt\": \"Add a tip?\",\n  \"tip_percent_presets\": [\n    \"15\",\n    \"18\",\n    \"20\"\n  ],\n  \"include_custom_tip_amount\": true,\n  \"print_receipt\": 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",
  "include_tip": true,
  "tip_prompt": "Add a tip?",
  "tip_percent_presets": ["15", "18", "20"],
  "include_custom_tip_amount": true,
  "print_receipt": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card")! 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()
```