API: Card Terminal
Card Terminal API
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.
How To: Make a Sale using Customer Lookup
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" }
How To: Make a Sale without Customer Lookup
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"
}
How To: Make a Refund
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"
}
How To: Authorize a Card
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"
}
How To: Capture a Payment
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"
}