> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.runpayments.io/reference/terminal-api/card-read/read-card/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runpayments.io/_mcp/server. # Initiate a card read POST https://javelin.runpayments.io/api/terminal/{device_id}/read-card Content-Type: application/json Connects to the terminal (if needed) and prompts the cardholder to swipe, dip, or tap. Returns an `interaction_id` immediately. To get the result, poll [Get card read status](/reference/terminal-api/card-read/get-read-card-status) or subscribe to the channel `terminal_job:{interaction_id}` over WebSocket (see [Generate WebSocket auth token](/reference/terminal-api/authentication-web-socket/generate-ws-token)). Set `include_signature` to capture the cardholder's signature as part of the same interaction. Signature capture is only available on terminals where `capabilities.signature` is `true`. Use the returned `token` and `amount` with the Payments API [Charge](/reference/payments-api/process-charge) endpoint to complete the transaction, or use [Charge a card](/reference/terminal-api/charge-card/initiate-charge) to read and charge in one call. Reference: https://docs.runpayments.io/reference/terminal-api/card-read/read-card ## Authentication - `Authorization` header (bearer token, required) — Use a Payments API key as the bearer token: `Authorization: Bearer `. 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 ReadCardRequest. - `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 the cardholder's signature as part of the same interaction. Requires `capabilities.signature`. - `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` ## 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": "19.99", "confirm_amount": true, "beep": true } ``` **Response** ```json { "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } ``` **SDK Code** ```python import requests url = "https://javelin.runpayments.io/api/terminal/HSN123456789/read-card" payload = { "amount": "19.99", "confirm_amount": True, "beep": True } headers = { "Authorization": "Bearer ", "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/read-card'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"amount":"19.99","confirm_amount":true,"beep":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/read-card" payload := strings.NewReader("{\n \"amount\": \"19.99\",\n \"confirm_amount\": true,\n \"beep\": true\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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/read-card") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"amount\": \"19.99\",\n \"confirm_amount\": true,\n \"beep\": true\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://javelin.runpayments.io/api/terminal/HSN123456789/read-card") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"amount\": \"19.99\",\n \"confirm_amount\": true,\n \"beep\": true\n}") .asString(); ``` ```php request('POST', 'https://javelin.runpayments.io/api/terminal/HSN123456789/read-card', [ 'body' => '{ "amount": "19.99", "confirm_amount": true, "beep": true }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/read-card"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"amount\": \"19.99\",\n \"confirm_amount\": true,\n \"beep\": true\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "amount": "19.99", "confirm_amount": true, "beep": true ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/read-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() ```