> 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

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.

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.

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

Invalid `amount`. Blank, zero, negative, non-numeric, and more than two decimal places all return the same message.

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

**Request**

```json
{
  "amount": "25.00",
  "beep": true,
  "include_signature": true,
  "print_receipt": true,
  "send_receipt": true,
  "email": "customer@example.com"
}
```

**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": "25.00",
    "beep": True,
    "include_signature": True,
    "print_receipt": True,
    "send_receipt": True,
    "email": "customer@example.com"
}
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":"25.00","beep":true,"include_signature":true,"print_receipt":true,"send_receipt":true,"email":"customer@example.com"}'
};

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\": \"25.00\",\n  \"beep\": true,\n  \"include_signature\": true,\n  \"print_receipt\": true,\n  \"send_receipt\": true,\n  \"email\": \"customer@example.com\"\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\": \"25.00\",\n  \"beep\": true,\n  \"include_signature\": true,\n  \"print_receipt\": true,\n  \"send_receipt\": true,\n  \"email\": \"customer@example.com\"\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\": \"25.00\",\n  \"beep\": true,\n  \"include_signature\": true,\n  \"print_receipt\": true,\n  \"send_receipt\": true,\n  \"email\": \"customer@example.com\"\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": "25.00",
  "beep": true,
  "include_signature": true,
  "print_receipt": true,
  "send_receipt": true,
  "email": "customer@example.com"
}',
  '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\": \"25.00\",\n  \"beep\": true,\n  \"include_signature\": true,\n  \"print_receipt\": true,\n  \"send_receipt\": true,\n  \"email\": \"customer@example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": "25.00",
  "beep": true,
  "include_signature": true,
  "print_receipt": true,
  "send_receipt": true,
  "email": "customer@example.com"
] 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()
```