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

# Get charge status

GET https://javelin.runpayments.io/api/terminal/{device_id}/charge-card/{interaction_id}

Returns the status of a `charge-card` interaction.

**Check `result.result` for approval, not `status`.** A declined card still returns `status: succeeded` with no `stage_errors`,
because the workflow completed as requested. `result` is the Payments API [Charge response](/reference/payments-api/process-charge),
merged with `signature` and `stage_errors`. Its own `result` field is `A` (Approved), `B` (Retry), or `C` (Declined).

Printing and emailing also run on a decline. If `print_receipt` or `send_receipt` was set, the merchant gets a receipt for the
declined charge, so don't treat "printed" or "emailed" as a signal that the card was approved.

The Charge response varies by gateway, so the fields shown in the examples are representative, not exhaustive.
`result.amount` is the decimal-dollar string submitted on the request.

### `stage_errors` keys

| Key         | Possible values                       | When                                                                                                                         |
| ----------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `read`      | Error message                         | The read stage failed or was cancelled. The charge was never attempted.                                                      |
| `signature` | Always `"not supported"`              | The terminal can't capture signatures. Other signature failures surface as a `read` error.                                   |
| `charge`    | Error message                         | The charge couldn't be attempted or completed because of a gateway fault. A decline never appears here.                      |
| `print`     | `"not supported"` or an error message | Compare against the literal `"not supported"` to tell "the terminal can't print" apart from "the terminal tried and failed." |
| `other`     | Error message                         | Any uncategorized error.                                                                                                     |

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

## 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.
- `interaction_id` (string, required) — The `interaction_id` returned when the interaction was created.

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

## Response

### 200

Interaction status

- `interaction_id` (string, required) — The interaction identifier.
- `status` (enum, required) — Status of the interaction.
  - Allowed values: `pending`, `succeeded`, `failed`, `cancelled`
- `result` (ChargeCardResult, required, nullable) — `null` while `pending`. Check `result.result` for approval or decline.
- `updated_at` (string, required) — Time of the last status update.

## Errors

### 401 Unauthorized Error

Unauthorized

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

### 404 Not Found Error

Terminal or interaction not found.

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

### 429 Too Many Requests Error

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

- `any`

## Types

### ChargeCardResult

The Payments API Charge response, merged with `signature` and `stage_errors`. Fields vary by gateway; the fields below are representative, not exhaustive.

- `trans_id` (string, optional) — Transaction ID.
- `vault_id` (string, optional, nullable) — Vault ID, if the payment account was vaulted.
- `result` (enum, optional) — Charge outcome: `A` (Approved), `B` (Retry), or `C` (Declined).
  - Allowed values: `A`, `B`, `C`
- `resp_code` (string, optional) — Processor response code.
- `resp_text` (string, optional) — Processor response text.
- `resp_proc` (string, optional) — Processor identifier.
- `account_token` (string, optional) — Payment account token.
- `mid` (string, optional) — Merchant ID.
- `amount` (string, optional) — Amount in decimal dollars, as submitted on the request.
- `card_type` (string, optional) — Card brand.
- `comm_card` (string, optional) — Whether the card is a commercial card (`Y` or `N`).
- `signature` (string, optional, nullable) — Captured signature image, when requested and supported.
- `stage_errors` (StageErrors, optional) — Errors for workflow steps that were skipped or failed. Absent when every step succeeded, including on a decline.

### StageErrors

Errors for workflow steps that were skipped or failed. Absent when every step succeeded, including on a decline.

- `read` (string, optional) — The read stage failed or was cancelled.
- `signature` (string, optional) — Always `not supported`.
- `charge` (string, optional) — The charge couldn't be attempted or completed because of a gateway fault. Never a decline.
- `print` (string, optional) — `not supported`, or an error message if the terminal tried to print and failed.
- `other` (string, optional) — Any uncategorized error.

## Examples

### Approved

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "succeeded",
  "result": {
    "trans_id": "987654321",
    "vault_id": null,
    "result": "A",
    "resp_code": "00",
    "resp_text": "Approved",
    "account_token": "tok_1Hh1X2Lz9a8b7c6d5e4f3g2h",
    "mid": "123456789",
    "amount": "25.00",
    "card_type": "Visa"
  },
  "updated_at": "2026-09-17T14:05:00Z"
}
```

**SDK Code**

```python Approved
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Approved
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Approved
package main

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

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Approved
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Approved
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

### Approved, signature and print not supported

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "succeeded",
  "result": {
    "trans_id": "987654321",
    "result": "A",
    "mid": "123456789",
    "amount": "25.00",
    "signature": null,
    "stage_errors": {
      "signature": "not supported",
      "print": "not supported"
    }
  },
  "updated_at": "2026-09-17T14:05:00Z"
}
```

**SDK Code**

```python Approved, signature and print not supported
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Approved, signature and print not supported
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Approved, signature and print not supported
package main

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

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Approved, signature and print not supported
require 'uri'
require 'net/http'

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Approved, signature and print not supported
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Approved, signature and print not supported
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Approved, signature and print not supported
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Approved, signature and print not supported
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

### Declined

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "succeeded",
  "result": {
    "trans_id": "987654321",
    "result": "C",
    "resp_code": "15",
    "resp_text": "Non-numeric expiry",
    "resp_proc": "JAV-CP",
    "account_token": "tok_1Hh1X2Lz9a8b7c6d5e4f3g2h",
    "mid": "123456789",
    "amount": "25.00",
    "card_type": "Visa",
    "comm_card": "N"
  },
  "updated_at": "2026-09-17T14:05:00Z"
}
```

**SDK Code**

```python Declined
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Declined
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Declined
package main

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

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Declined
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Declined
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

### Failed at read

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "failed",
  "result": {
    "stage_errors": {
      "read": "Terminal is unavailable."
    }
  },
  "updated_at": "2026-09-17T14:05:00Z"
}
```

**SDK Code**

```python Failed at read
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Failed at read
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Failed at read
package main

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

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Failed at read
require 'uri'
require 'net/http'

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Failed at read
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Failed at read
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Failed at read
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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

### Cancelled

**Response**

```json
{
  "interaction_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "cancelled",
  "result": {
    "stage_errors": {
      "read": "Interaction was cancelled."
    }
  },
  "updated_at": "2026-09-17T14:05:00Z"
}
```

**SDK Code**

```python Cancelled
import requests

url = "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Cancelled
const url = 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Cancelled
package main

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

func main() {

	url := "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.get("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Cancelled
using RestSharp;

var client = new RestClient("https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Cancelled
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://javelin.runpayments.io/api/terminal/HSN123456789/charge-card/3fa85f64-5717-4562-b3fc-2c963f66afa6")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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