# Card Terminal

## Card Terminal API <a href="#cardterminal-api-cardterminalapi" id="cardterminal-api-cardterminalapi"></a>

This document includes sample data and responses. For more information on the JSON to be sent in the body of

various requests, please refer to the request body (via the inspect manager) in your browser.

### Make a Sale using Customer Lookup <a href="#cardterminal-api-howto-makeasaleusingcustomerlookup" id="cardterminal-api-howto-makeasaleusingcustomerlookup"></a>

```
POST: https://sandbox-apigateway.payfirma.com/transaction-service-vt/sale/terminalcustomer/customer_lookup_id
Headers
Content-Type:application/json
Authorization:Bearer
Body
{
"amount":"1.00",
"first_name":"customer_first_name",
"last_name":”customer_last_name",
"company":"company_name",
"order_id":"",
"invoice_id":"",
"description":"",
"currency":"CAD",
"email":"customer_email",
"card_expiry_month":"/",
"card_expiry_year":"",
"card_number":"",
"is_card_terminal_transaction":true,
"processor_id":123456
}
Response Sample
{
"amount": 1,
"email": "customer_email",
"first_name": "customer_first_name",
"last_name": "customer_last_name",
"company": "company",
"card_type": "OTHER", "card_suffix": "1933",
"id": 3039875,
"transaction_id": "62lY3jxBKrRk6yo1RkXN",
"transaction_success": true,
"transaction_result": "APPROVED",
"transaction_time": 1551297351000,
"transaction_type": "SALE"
}
```

### Make a Sale without Customer Lookup <a href="#cardterminal-api-howto-makeasalewithoutcustomerlookup" id="cardterminal-api-howto-makeasalewithoutcustomerlookup"></a>

```
POST: https://sandbox-apigateway.payfirma.com/transaction-service-vt/sale/terminal
Headers
Content-Type:application/json
Authorization:Bearer
Body
{
"amount":"1.00",
"first_name":"",
"last_name":"",
"company":"", "bcc_emails":null, "telephone":"",
"address1":"",
"address2":"",
"city":"",
"province":"",
"country":"",
"postal_code":"",
"order_id":"",
"invoice_id":"",
"description":"",
"currency":"CAD",
"card_expiry_month":"/",
"card_expiry_year":"",
"card_number":"",
"is_card_terminal_transaction":true,
"processor_id":1234567
}
Response Sample
{
"amount": 1,
"card_type": "OTHER",
"card_suffix": "1933",
"id": 3039873,
"transaction_id": "N4kqMbjy0WEzKd7eZLQY",
"transaction_success": true,
"transaction_result": "APPROVED",
"transaction_time": 1551297100000,
"transaction_type": "SALE"
}
```

### Make a Refund <a href="#cardterminal-api-howto-makearefund" id="cardterminal-api-howto-makearefund"></a>

```
POST: https://sandbox-apigateway.payfirma.com/transaction-service-vt/refund/transaction_id
Headers
Content-Type:application/json
Authorization:Bearer
Body
{
"amount":"1.00",
"first_name":"customer_first_name",
"last_name":"customer_last_name",
"company":"company_name",
"invoice_id":"invoice_id",
"currency":"CAD",
"email":"customer_email",
"is_card_terminal_transaction":true,
"processor_id":12345
}
Response
{
"amount": 1,
"email": "customer_email",
"first_name": "customer_first_name",
"last_name": "customer_last_name",
"company": "Payfirma",
"invoice_id": "000003039874",
"card_type": "OTHER",
"card_suffix": "1933",
"id": 3039877,
"transaction_id": "z6jAROvgvWj3vd14wZnl",
"transaction_success": true,
"transaction_result": "APPROVED",
"transaction_time": 1551297616000,
"transaction_type": "REFUND"
}
```

### Authorize a Card <a href="#cardterminal-api-howto-authorizeacard" id="cardterminal-api-howto-authorizeacard"></a>

```
POST: https://sandbox-apigateway/transaction-service-vt/authorize/terminal
Headers
Content-Type:application/json
Authorization:Bearer
Body
{
"amount":"1.00",
"first_name":"customer_first_name",
"last_name":”customer_last_name",
"company":"company_name",
"order_id":"",
"invoice_id":"",
"description":"",
"currency":"CAD",
"email":"customer_email",
"card_expiry_month":"/",
"card_expiry_year":"",
"card_number":"",
"is_card_terminal_transaction":true,
"processor_id":123456
}
Response
{
"amount":1.00,
"card_type":"MASTERCARD",
"card_suffix":"2995", "id":3893431,
"transaction_id":"2lY3jxBKvvn66yo1RkXN",
"transaction_success":true,
"transaction_result":"APPROVED",
"transaction_time":1551304094000,
"transaction_type":"AUTHORIZE"
}
```

### Capture a Payment <a href="#cardterminal-api-howto-captureapayment" id="cardterminal-api-howto-captureapayment"></a>

```
GET: https://sandbox-apigateway/transaction-service-vt/capture/transaction_id
Headers
Content-Type:application/json
Authorization:Bearer
Body
{
"amount":"1.00",
"invoice_id":"000003893431",
"currency":"CAD",
"is_card_terminal_transaction":true,
"processor_id":51832
}
Response Sample
{
"amount": 1,
"email": "ravinder.singh@payfirma.com",
"first_name": "Ravinder",
"last_name": "Singh",
"company": "Payfirma",
"invoice_id": "000003893432",
"card_type": "MASTERCARD",
"card_suffix": "2995",
"id": 3893434,
"transaction_id": "GXRKDxBl55z9pg04wY7W",
"transaction_success": true,
"transaction_result": "APPROVED",
"transaction_time": 1551304500000,
"transaction_type": "CAPTURE"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.payfirma.com/api/card-terminal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
