POST /aborts

Prev Next

This API endpoint allows a POS system to abort an ongoing transaction. It sends terminal and operator details and returns a response confirming the cancellation, timestamp, and reason for the abort.

Guide

  1. Send Sale request as in test 3.1 followed by the abort request

  2. If we perform abort API in the middle of the transaction, the current transaction aborted successfully with 200 success code and payment response we will be able to see abort response from the terminal, the POS Cloud will send back the response

Step 1 - Request

POST /v1/card-present/aborts 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": "T650M-451-962-212-MOHSIN",
    "operator_id": "964566"
}

Field Name

Type

Description

Nullable

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

Content-type (header)

varchar(50)

application/json

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; iOS 15+; iPhone 12+; Android 11+; Build/12345)

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

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

HTTP/1.1 201 Created
Content-Type: application/json

{
    "result": "SUCCESS",
    "message": "Aborted by POS",
    "data": {
        "site_branch_id": "London",
        "pos_location": "POS-25",
        "terminal_id": "T650M-451-962-212-MOHSIN",
        "operator_id": "964566"
    }
}

Field Name

Type

Description

result

varchar(50)

SUCCESS or FAILURE

message

varchar(255)

e.g Cancelled by POS

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": "Aborts request failed",
    "errors": {
        "Authorisation": "The Authorization header is required and must be provided in the format: Basic <encoded_api_key:secret_key>."
    }
}

Missing POS_location

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

{
    "result": "FAILURE",
    "message": "Aborts request failed",
    "errors": {
        "pos_location": "The pos_location is required and cannot be empty."
    }
}

Missing site_branch_id

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

{
    "result": "FAILURE",
    "message": "Aborts request failed",
    "errors": {
        "site_branch_id": "The site_branch_id is required and cannot be empty."
    }
}

Missing terminal_id

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

{
    "result": "FAILURE",
    "message": "Aborts request failed",
    "errors": {
        "terminal_id": "The terminal_id is required and cannot be empty."
    }
}

401 Unauthorized

Acquirer token not found

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

{
    "result": "FAILURE",
    "message": "Aborts request 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": "Aborts request 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": "Aborts request failed",
    "errors": {
        "Authorisation": "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": "Aborts request failed",
    "errors": {
        "Authorisation": "The provided api_key or secret_key is invalid. Please ensure the credentials are correct and try again."
    }
}

422 Unprocessable Entity

Invalid metadata

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

{
    "result": "FAILURE",
    "message": "Preauth Completions request 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": "Aborts request 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": "Aborts request failed",
    "errors": {
        "pos_location": "The pos_location must be a valid string with a maximum length of 16 characters."
    }
}

Invalid site_branch_id

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

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

Invalid terminal_id

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

{
    "result": "FAILURE",
    "message": "Aborts request failed",
    "errors": {
        "terminal_id": "The terminal_id must be a valid string with a maximum length of 35 characters."
    }
}

500 Internal Server Error

Generic error

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

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