POST /sales

Prev Next

This API endpoint processes card-present sales transactions for a POS system. It accepts payment details, including terminal and operator information, and returns a response with the transaction ID, payment status, and card details.

Guide

  1. Enter the sale request

  2. Perform the transaction on the terminal: insert/swipe/tap the card to complete the transaction

  3. Based on the response from the terminal/external terminal simulator, the POS Cloud will send back the response

Step 1 - Request

POST /v1/card-present/sales HTTP/1.1                         
Host: api.blinkpayment.co.uk                     
Content-Type: application/json
Authorization: Basic ACCESS_TOKEN    # from Blink pos_api_key:pos_api_secret
User-Agent: AcmeApp/1.2.0 (ReactNative; Android 11+; POS2.0+; Build/123)

{
  "site_branch_id": "London",
  "pos_location": "POS-25",
  "terminal_id": "T650P-451-863-867-MADAN",
  "operator_id": "28465",
  "order_number": "2780576984",
  "metadata": {},
  "currency": "GBP",
  "requested_amount": "45.87",
  "request_timestamp": "2025-06-19T12:46:45+01:00"
}

Field Name

Type

Description

Nullable

Content-Type (header)

varchar(50)

application/json

NO

Authorization (header)

varchar(512)

Authorization header for authenticating the request made up of pos_api_key and pos_api_secret.
(e.g., Basic ZjdkNDcxNjYtMThhYy00????)

NO

User-Agent (header)

varchar(255)

A brief overview of the app or software, version and comments related to the software stack and minimum client specifications.
e.g. AcmeApp/1.2.0 (ReactNative; Android 11+; POS2.0+; Build/123)

NO

site_branch_id

varchar(16)

Site or branch ID
(e.g., London - Oxford Street)

NO

pos_location

varchar(16)

POS identifier
(e.g., POS 5)

NO

terminal_id

varchar(35)

Unique terminal ID made up of model and serial number.
(e.g., T650m-451-962-212)

NO

operator_id

varchar(255)

ID of the operator (e.g., user, staff member) who processed the payment. (e.g., 440010051-Mohsin, numeric (16))

YES

order_number

varchar(16)

Optional field that can be used by client to send a reference string value. (e.g,. 841754987AB)

YES

currency

varchar(3)

The currency must be a valid ISO 4217 code (e.g., GBP, USD, EUR).

NO

requested_amount

decimal(8,2)

Requested amount must be between 0.01 and 999,999.99

NO

request_timestamp

datetime

The request_timestamp must be a valid ISO 8601 datetime string (e.g., 2025-02-02T14:43:59+01:00)

NO

tip_amount

decimal(8,2)

Requested amount must be between 0.01 and 999,999.98

YES

metadata

json(1024)

Optional field that can be used for debugging, filtering linking to other systems. It contains custom vendor, POS, customer or order details in JSON format. (e.g.
{"note": "Refund for overcharge"}, {"salesforce_id": "SF123456"}, {"server": "dev"}, {"partner": "Shopify", "order_id": "98765"})

YES

Step 2 - Response

The POST /sales endpoint can return different responses depending on whether the card is tapped, inserted, or swiped.

There are seven responses that can be handled.

Response 1 - Tap card

HTTP/1.1 201 Created
Content-Type: application/json
{
    "result": "SUCCESS",
    "transaction_id": "2780576984",
    "card_type": "MasterCard",
    "card_number": "52993074****5859",
    "card_mode": "TAP",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

SUCCESS

transaction_id

varchar(50)

Unique identifier for the pre-auth transaction.

card_type

varchar(10)

Type of card used for the transaction.

card_number

varchar(20)

Masked card number for security.

card_mode

varchar(15)

Mode of transaction (e.g., chip, contactless).

data

json

Return the payload from the request.

Response 2a - Insert card - valid pin

HTTP/1.1 201 Created
Content-Type: application/json
{
    "result": "SUCCESS",
    "transaction_id": "2780576984",
    "card_type": "MasterCard",
    "card_number": "52993074****5859",
    "card_mode": "ICC",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

SUCCESS

transaction_id

varchar(50)

Unique identifier for the pre-auth transaction.

card_type

varchar(10)

Type of card used for the transaction.

card_number

varchar(20)

Masked card number for security.

card_mode

varchar(15)

Mode of transaction (e.g., chip, contactless).

data

json

Return the payload from the request.

Response 2b - Insert card - invalid pin

HTTP/1.1 403 Forbidden
Content-Type: application/json
{
    "result": "FAILURE",
    "transaction_id": "2780576984",
    "card_type": "MasterCard",
    "card_number": "52993074****5859",
    "card_mode": "ICC",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

FAILURE

transaction_id

varchar(50)

Unique identifier for the pre-auth transaction.

card_type

varchar(10)

Type of card used for the transaction.

card_number

varchar(20)

Masked card number for security.

card_mode

varchar(15)

Mode of transaction (e.g., chip, contactless).

data

json

Return the payload from the request.

Response 3a: Swipe card - valid signature

HTTP/1.1 201 Created
Content-Type: application/json
{
    "result": "SUCCESS",
    "is_signature_approved": true,
    "transaction_id": "2780576984",
    "card_type": "MasterCard",
    "card_number": "52993074****5859",
    "card_mode": "MAGSTRIPE",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

SUCCESS

is_signature_approved

boolean

true

transaction_id

varchar(50)

Unique identifier for the pre-auth transaction.

card_type

varchar(10)

Type of card used for the transaction.

card_number

varchar(20)

Masked card number for security.

card_mode

varchar(15)

Mode of transaction (e.g., chip, contactless).

Response 3b: Swipe card - invalid signature

HTTP/1.1 403 Forbidden
Content-Type: application/json

{
    "result": "FAILURE",
    "is_signature_approved": false,
    "transaction_id": "2780576984",
    "card_type": "VISA",
    "card_number": "45087500****0201",
    "card_mode": "MAGSTRIPE",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

FAILURE

is_signature_approved

boolean

false

transaction_id

varchar(50)

Unique identifier for the pre-auth transaction.

card_type

varchar(10)

Type of card used for the transaction.

card_number

varchar(20)

Masked card number for security.

card_mode

varchar(15)

Mode of transaction (e.g., chip, contactless).

Response 4: Abort

HTTP/1.1 202 Accepted
Content-Type: application/json
{
    "result": "ABORTED",
    "message": "Aborted by POS",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650P-451-863-867-MADAN",
        "operator_id": "7817",
        "order_number": "2780576984",
        "metadata": {},
        "currency": "GBP",
        "requested_amount": "45.87",
        "request_timestamp": "2025-06-19T12:46:45+01:00"
    }
}

Field Name

Type

Description

result

varchar(10)

ABORTED

transaction_id

varchar(50)

Unique identifier for the transaction.

data

json

Return the payload from the request.

Errors

400 Bad Request

Missing authorization header

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "Authorization": "Authorization is required and cannot be empty."
    }
}

Missing currency

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "currency": "The currency field is required and cannot be empty."
    }
}

Missing POS_location

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "pos_location": "The pos_location field is required and cannot be empty."
    }
}

Missing request_timestamp

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "request_timestamp": "The request_timestamp field is required and cannot be empty."
    }
}

Missing requested_amount

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "requested_amount": "The requested_amount field is required and cannot be empty."
    }
}

Missing site_branch_id

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "site_branch_id": "The site_branch_id field is required and cannot be empty."
    }
}

Missing terminal_id

HTTP/1.1 400 Bad Request  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "terminal_id": "The terminal_id field is required and cannot be empty."
    }
}

401 Unauthorized

Acquirer token not found

HTTP/1.1 401 Unauthorized  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "acquirer_token": "The acquirers_token was not found in our system. Please contact the support team."
    }
}

Invalid acquirer token

HTTP/1.1 401 Unauthorized  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "acquirer_token": "The acquirers_token provided is invalid in our system. Please contact the support team."
    }
}

Invalid authorization header

HTTP/1.1 401 Unauthorized  
Content-Type: application/json  

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "Authorization": "The provided Authorization header is invalid. Ensure it follows the correct format: Basic <encoded api_key:secret_key>."
    }
}

403 Forbidden

API key or secret key is invalid

HTTP/1.1 403 Forbidden  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "Authorization": "The provided api_key or secret_key is invalid. Please ensure the credentials are correct and try again."
    }
}

404 Not Found

Invalid terminal_id

HTTP/1.1 404 Not Found
Content-Type: application/json  
{
    "result": "FAILURE",
    "message": "Terminal not found",
    "errors": {
        "terminal_id": "The terminal_id is invalid. Please try again."
    }
}

422 Unprocessable Entity

Invalid currency

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    {
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "currency": "The currency must be a valid ISO 4217 code (e.g., GBP, USD, EUR)."
    }
}

Invalid metadata

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "metadata": "The metadata must be a valid JSON-formatted string with a maximum length of 1024 characters."
    }
}

Invalid operator_id

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "operator_id": "The operator_id must be a valid string with a maximum length of 255 characters."
    }
}

Invalid POS_location

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "pos_location": "The pos_location must be a valid string with a maximum length of 16 characters."
    }
}

Invalid request_timestamp

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "request_timestamp": "The request_timestamp must be a valid ISO 8601 date (e.g., '2024-02-18T12:34:56')."
    }
}

Invalid requested_amount

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "requested_amount": "The requested_amount must be between 0.01 and 999999.99."
    }
}

Invalid site_branch_id

HTTP/1.1 422 Unprocessable Entity  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Request validation failed",
    "errors": {
        "site_branch_id": "The site_branch_id must be a valid string with a maximum length of 16 characters."
    }
}

429 Too Many Request

Terminal busy

HTTP/1.1 429 Too Many Requests 
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Terminal is busy",
    "errors": {
        "terminal_id": "Terminal is busy processing another request. Please try again."
    }
}

500 Internal Server Error

Generic error

HTTP/1.1 500 Internal Server Error  
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Something went wrong on our end.",
    "errors": {
        "We're experiencing an issue with our server, but rest assured our team is already working to resolve it. Please try again, and we apologize for the inconvenience."
    }
}

503 Service Unavailable

Lost connection to the terminal

HTTP/1.1 503 Service Unavailable
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Lost connection",
    "errors": {
        "terminal_id": "The connection to the terminal was lost. Please try again."
    }
}

Terminal disconnected

HTTP/1.1 503 Service Unavailable
Content-Type: application/json

{
    "result": "FAILURE",
    "message": "Terminal unreachable",
    "errors": {
        "terminal_id": "Terminal is currently offline or unreachable. Please try again."
    }
}