API – Developers Docs API – Developers Docs
  • Cyberpac
  • Addon Payments
  • POS integrated Payments
  • SpanishSwitch to Spanish
API – Developers Docs API – Developers Docs
API – Developers Docs
  • Cyberpac
  • Addon Payments
  • POS integrated Payments
  • SpanishSwitch to Spanish
POS integrated Payments
  • Folder icon closed Folder open iconPayment integrated with Android POS
    • InStore Payment API Android
    • InStore Payment API Windows
    • InStore Payment REST API
  • Folder icon closed Folder open iconPayment integrated with Smartphone POS
    • Payment integration with Smartphone POS
  • Folder icon closed Folder open iconPOS integrated Payments
    • Transactions
      • Tokenization
    • Reports
    • Device
  • Folder icon closed Folder open iconHost2Host Integration – POI-Switch Protocol
  • Folder icon closed Folder open iconPOS Data sheets

Transactions

Introduction – Transactions

The API transactions collection allows you to invoke payment services such as sales, refunds, pre-authorizations and refunds.

The request IP address {url} must give the address assigned to the Android POS terminal on the local network.

  • If the request origin is local from an app executed on the POS terminal, you have to use the local IP address localhost/127.0.0.1.
  • If accessing the POS terminal over the network, you can use the IP address for the terminal or the domain assigned by the network.

Communication between the customer’s App and the Comercia POS payment services is secured through the https channel that provides authentication and encryption. The CA certificate required for authentication of Comercia POS payment services is part of the SDK integration package.

The domains available based on destination environments are:

  • Development: https://*.dev.tpv-comercia.es:2001
  • Staging: htts://*.staging.tpv-comercia.es:2002
  • Production: htts://*.tpv-comercia.es:2011
The asterisk * in the above URLs indicates the hostname assigned to the terminal.

Response

The payload response to compile transactions includes:

  • resultMessage: It is a string. Description of the transaction result.
  • ticket: Purpose. This object is only returned for financial requests and includes all the specific information on the transaction and related to the ticket.
  • tokenization: Purpose. This object is only returned if the card tokenization request is sent with the card authorization request.
  • resultCode: Numerical. The result code for the transaction.

The following application codes can be notified in resultCode:

CodeDescription
0Success
1000Initialization successful
1010EMV initialization error
1001The service is busy (operation in progress)
1INCORRECT_MSGID
2MSG_FORMAT_ERROR
3MSG_PARSING_ERROR
4MSG_PARAMS_ERROR
5UNKNOWN_TRANS_TYPE
6ISO_APPLICATION_ERROR
7EMV_APPLICATION_ERROR
12OPERATION_FINISHED
13PINPAD_INIT_ERROR
14PINPAD_FAILURE
15INVALID_CARD
16OPERATION_CANCELLED
17OPERATION_TIMEOUT
18DECLINED_GAC2
19CARD_REMOVED
21DEVICE_FAILURE
23EMCRYPTION_FAILURE
24GENERIC_ERROR
25NETWORT_NOT_AVAILABLE
26OPERATION_VOIDED

The following host codes can be notified in resultCode:

CodeDescription
100Processing without connection to terminal
101Declined: Card expired
105Declined
106Declined: PIN attempts exceeded
117Declined: incorrect PIN
126Declined: Block wrong PIN
127Declined: Encrypted card info not valid
129Declined: Incorrect CVV2/CVC2
180Declined: Card not accepted
184Declined: Error authenticating the cardholder
190Issuer declined the operation
191Error in expiry date
195PSD2: Must insert chip
196PSD2: Repeat with PIN
201Not processed
202Card suspected of fraud
400Operation voided
600Totals
602Details not available
603Receipt not found
700-Gateway point 749 not available
900Authorized for refund and confirmations
904Merchant ID not found
909System error
912Issuer not available
913Duplicate order ID
916MAC not valid
944Session not valid
948Terminal local date and time not valid
950Refund operation not allowed
9064Card info not valid
9078Operation not allowed for this card
9093Card does not exist
9094Foreign servers rejected
9104Merchant without secure key info
9218Secure operations not allowed for this merchant ID
9253Luhn verification digit error
9256Pre-authorizations not allowed for this merchant ID
9257Pre-authorizations not allowed for this card
9261Operation restrictions control declined
9915User cancelled the operation
9997There is a transaction in progress on SIS with the same card
9998Request for card info in progress
9999Transaction redirected to issuer for authentication
9912Issuer not available

Transaction approved

A transaction is considered approved if it meets these requirements:

  • The resultCode is 0.
  • The ticket is present.
  • The status of the ticket object attribute is 0.

POST Initialization

This request initializes the components of the Comercia Payment Service. This call must be made at least once before carrying out any financial transaction with the terminal. Otherwise, during the Financial Transaction request, the services will return the error “PINPAD NOT INITIALIZED”.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/init

Request payload

  • user: String. Reserved for future uses.
  • password: String. Reserved for future uses.

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
	"user":"user",
	"password":"pass"
}
				
			

These are sample requests and responses for POST Initialization. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var raw = "{\n	\"user\":\"user\",\n	\"password\":\"pass\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/init", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/init");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n\t\"user\":\"user\",\n\t\"password\":\"pass\"\n}", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/init' \
--header 'X-SOURCE: COMERCIA' \
--data '{
	"user":"user",
	"password":"pass"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/init"

payload = "{\n\t\"user\":\"user\",\n\t\"password\":\"pass\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n\t\"user\":\"user\",\n\t\"password\":\"pass\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/init")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the body of the response and its headers:

				
					{
  "resultCode": 1000,
  "resultMessage": "Successful initialization"
}
				
			

Content-Type application/json

Date Tue, 19 May 2020 16:51:44 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

POST Payment

This request initiates a payment transaction.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/payment

Request payload

  • amount: Positive decimal. Contains the transaction total. The decimal places are separated with a point (.). For example: 3.50
  • orderId: String. An order/invoice/reference number is a value assigned by the customer’s application that is associated with the transaction, but it is not sent in the transaction request to the bank (so it is not associated with the transaction in the bank records). In general, this should be a unique value.
  • description: String. A value assigned by the customer’s App. It is associated with the transaction reference and shown with the total.

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
    "orderId": "tx-00000001",
    "amount": 3.01,
    "description":"Billete Sencillo"
}
				
			

These are sample requests and responses for POST Payments. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var raw = "{\n    \"orderId\": \"tx-00000001\",\n    \"amount\": 3.01,\n    \"description\":\"billete sencillo\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/payment", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/payment");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n    \"orderId\": \"tx-00000001\",\n    \"amount\": 3.01,\n    \"description\":\"billete sencillo\"\n}", null, "application/x-www-form-urlencoded");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/payment' \
--header 'X-SOURCE: COMERCIA' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data '{
    "orderId": "tx-00000001",
    "amount": 3.01,
    "description":"billete sencillo"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/payment"

payload = "{\n    \"orderId\": \"tx-00000001\",\n    \"amount\": 3.01,\n    \"description\":\"billete sencillo\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n    \"orderId\": \"tx-00000001\",\n    \"amount\": 3.01,\n    \"description\":\"billete sencillo\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/payment")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "orderId": "tx-00000001",
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00297",
    "PSN": "00",
    "Amount": "100",
    "Authorization": "006360",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200522",
    "Id": "432864",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "",
    "OriginalTransactionId": "",
    "PinIndicator": 0,
    "SignatureImage": "89504e470d0a1a0a0000000d49484452000001f400000139080600000066a0d2e00000000473424954080808087c08648800000a6449444154789cedddcd8f24651d07f0ef1aa000000000000000000000000000c032fd0f9996a9212f464c2c0000000049454e44ae426082",
    "SignatureIndicator": 1,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "0106",
    "Type": "Payment"
  }
}
				
			

Content-Type application/json

Date Thu, 21 May 2020 22:12:54 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

POST Refund

This request initiates a refund transaction.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/refund

Payload of the request

  • amount: Positive decimal. Contains the transaction total. The decimal places are separated with a point (.). For example: 3.50
  • transactionId: String of decimal digits. Transaction ID to process the refund for.
  • orderId (optional): String. An order/invoice/reference number is a value assigned by the customer’s application that is associated with the transaction, but it is not sent in the transaction request to the bank (so it is not associated with the transaction in the bank records). In general, this should be a unique value.
  • description (optional): String. A value assigned by the customer’s App. It is associated with the transaction reference and shown with the total.

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
	"transactionId": "73787",
	"amount":0.01,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}
				
			

These are sample requests and responses for POST Refunds. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var raw = "{\n	\"transactionId\": \"73787\",\n	\"amount\":0.01,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/refund", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/refund");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n\t\"transactionId\": \"73787\",\n\t\"amount\":0.01,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/refund' \
--header 'X-SOURCE: COMERCIA' \
--data '{
	"transactionId": "73787",
	"amount":0.01,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/refund"

payload = "{\n\t\"transactionId\": \"73787\",\n\t\"amount\":0.01,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n\t\"transactionId\": \"73787\",\n\t\"amount\":0.01,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/refund")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00245",
    "PSN": "00",
    "Amount": "130",
    "Authorization": "006067",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200519",
    "Id": "619120",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "20200519",
    "OriginalTransactionId": "619119",
    "PinIndicator": 0,
    "SignatureIndicator": 0,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "1900",
    "Type": "Refund"
  }
}
				
			

Content-Type application/json

Date Thu, 19 May 2020 16:07:20 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

POST PreAuthorization New

This request initiates a pre-authorization.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/preauth/new

Request payload

  • amount: Positive decimal. Contains the transaction total. The decimal places are separated with a point (.). For example: 3.50
  • orderId (optional): String. An order/invoice/reference number is a value assigned by the customer’s application that is associated with the transaction, but it is not sent in the transaction request to the bank (so it is not associated with the transaction in the bank records). In general, this should be a unique value.
  • description (optional): String. A value assigned by the customer’s App. It is associated with the transaction reference and shown with the total.

HEADERS

X-SOURCE

Comercia

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
	"orderId":"INV-002",
	"amount":3,
    "description":"billete sencillo"
}
				
			

These are sample requests and responses for POST PreAuthorization New. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var raw = "{\n	\"orderId\":\"INV-002\",\n	\"amount\":3,\n    \"description\":\"billete sencillo\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/preauth/new", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/preauth/new");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n\t\"orderId\":\"INV-002\",\n\t\"amount\":3,\n    \"description\":\"billete sencillo\"\n}", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/preauth/new' \
--header 'X-SOURCE: COMERCIA' \
--data '{
	"orderId":"INV-002",
	"amount":3,
    "description":"billete sencillo"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/preauth/new"

payload = "{\n\t\"orderId\":\"INV-002\",\n\t\"amount\":3,\n    \"description\":\"billete sencillo\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n\t\"orderId\":\"INV-002\",\n\t\"amount\":3,\n    \"description\":\"billete sencillo\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/preauth/new")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "orderId": "pre-0001",
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00298",
    "PSN": "00",
    "Amount": "200",
    "Authorization": "006361",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200522",
    "Id": "432869",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "",
    "OriginalTransactionId": "",
    "PinIndicator": 0,
    "SignatureImage": "89504e470d0a1a0a0000000d49484452000001f400000139080600000066a0d2e00000000473424954080808087c086488000009b449444154789cedddcf8b24671d07e06fb2d183882e883761f30f8c17f1426082",
    "SignatureIndicator": 1,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "0115",
    "Type": "Preauthorization"
  }
}
				
			

Content-Type application/json

Date Thu, 21 May 2020 22:21:50 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

POST PreAuthorization Update

This request initiates the update of a prior pre-authorization transaction.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/preauth/update

Request payload

  • amount: Positive decimal. Contains the transaction total. The decimal places are separated with a point (.). For example: 3.50
  • transactionId: String of decimal digits. Transaction ID to process the refund for.
  • transactionDate: String. Original pre-authorization date. Format: “YYYYMMDDHHMM”.
  • orderId (optional): String. An order/invoice/reference number is a value assigned by the customer’s application that is associated with the transaction, but it is not sent in the transaction request to the bank (so it is not associated with the transaction in the bank records). In general, this should be a unique value.
  • description (optional): String. A value assigned by the customer’s App. It is associated with the transaction reference and shown with the total.

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
	"transactionId": "619141",
	"transactionDate":"202005191937",
	"amount":4,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}
				
			

These are sample requests and responses for POST PreAuthorization Update. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var raw = "{\n	\"transactionId\": \"619141\",\n	\"transactionDate\":\"202005191937\",\n	\"amount\":4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/preauth/update", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/preauth/update");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n\t\"transactionId\": \"619141\",\n\t\"transactionDate\":\"202005191937\",\n\t\"amount\":4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/preauth/update' \
--header 'X-SOURCE: COMERCIA' \
--data '{
	"transactionId": "619141",
	"transactionDate":"202005191937",
	"amount":4,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/preauth/update"

payload = "{\n\t\"transactionId\": \"619141\",\n\t\"transactionDate\":\"202005191937\",\n\t\"amount\":4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n\t\"transactionId\": \"619141\",\n\t\"transactionDate\":\"202005191937\",\n\t\"amount\":4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/preauth/update")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00251",
    "PSN": "00",
    "Amount": "400",
    "Authorization": "006073",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200519",
    "Id": "619142",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "20200519",
    "OriginalTransactionId": "619141",
    "PinIndicator": 0,
    "SignatureImage": "89504e470d0a1a0a0000000d49484452000001f400000139080600000066a0d2e00000000473424954080808087c08648800000e9149444154789ceddd4f8f24e57d07f06fa41c7398773c426400431602f2c60d86016880dbbc0eeecce4c0e3593cc543fdd5ddd53d5d555fd00000000000000000000000000000000000000000000008051f95f496b2d0b1bdbb3f90000000049454e44ae426082",
    "SignatureIndicator": 1,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "1938",
    "Type": "PreauthorizationUpdate"
  }
}
				
			

Content-Type application/json

Date Tue, 19 May 2020 16:45:21 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

POST PreAuthorization Complete

This request initiates the completion of a pre-authorization transaction.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/preauth/complete

Request payload

  • amount: Positive decimal. Contains the transaction total. The decimal places are separated with a point (.). For example: 3.50
  • transactionId: String of decimal digits. Transaction ID to process the refund for.
  • transactionDate: String. Original pre-authorization date. Format: “YYYYMMDDHHMM”.
  • orderId (optional): String. An order/invoice/reference number is a value assigned by the customer’s application that is associated with the transaction, but it is not sent in the transaction request to the bank (so it is not associated with the transaction in the bank records). In general, this should be a unique value.
  • description (optional): String. A value assigned by the customer’s App. It is associated with the transaction reference and shown with the total.

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

Body raw (json)

				
					{
	"transactionId": "619142",
	"transactionDate":"202005191938",
	"amount": 4,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}
				
			

These are sample requests and responses for POST PreAuthorization Complete. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var raw = "{\n	\"transactionId\": \"619142\",\n	\"transactionDate\":\"202005191938\",\n	\"amount\": 4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/preauth/complete", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https:// 172.20.10.1:2011/v1/transactions/preauth/complete");
request.Headers.Add("X-SOURCE", "COMERCIA");
var content = new StringContent("{\n\t\"transactionId\": \"619142\",\n\t\"transactionDate\":\"202005191938\",\n\t\"amount\": 4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}", null, "text/plain");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/preauth/complete' \
--header 'X-SOURCE: COMERCIA' \
--data '{
	"transactionId": "619142",
	"transactionDate":"202005191938",
	"amount": 4,
    "orderId": "tx-00000001",
    "description":"billete sencillo"
}'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/preauth/complete"

payload = "{\n\t\"transactionId\": \"619142\",\n\t\"transactionDate\":\"202005191938\",\n\t\"amount\": 4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
				
			
				
					let parameters = "{\n\t\"transactionId\": \"619142\",\n\t\"transactionDate\":\"202005191938\",\n\t\"amount\": 4,\n    \"orderId\": \"tx-00000001\",\n    \"description\":\"billete sencillo\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/preauth/complete")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00252",
    "PSN": "00",
    "Amount": "400",
    "Authorization": "006073",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200519",
    "Id": "619144",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "20200519",
    "OriginalTransactionId": "619142",
    "PinIndicator": 0,
    "SignatureImage": "89504e470d0a1a0a0000000d49484452000001f400000139080600000066a0d2e00000000473424954080808087c08648800000bf349444154789ceddd4f8c24551d07f02f8870302663bcbb73a750ed0606228150000000049454e44ae426082",
    "SignatureIndicator": 1,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "1941",
    "Type": "PreauthorizationConfirmation"
  }
}
				
			

Content-Type application/json

Date Tue, 19 May 2020 16:47:43 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

GET Last Transaction

This request returns a copy of the request data for the most recent transaction processed by the system.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/last

HEADERS

X-SOURCE

Comercia

Unique application request ID that identifies the application that is the origin of the API request.

These are sample requests and responses for GET Last Transaction. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/last", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https:// 172.20.10.1:2011/v1/transactions/last");
request.Headers.Add("X-SOURCE", "COMERCIA");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/last' \
--header 'X-SOURCE: COMERCIA'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/last"

payload={}
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
				
			
				
					var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/last")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "orderId": "tx-00000001",
  "resultCode": 0,
  "resultMessage": "ACEPTADA",
  "ticket": {
    "AID": "A0000000041010",
    "ARC": "00",
    "ATC": "00297",
    "PSN": "00",
    "Amount": "100",
    "Authorization": "006360",
    "CardBank": "Comercia Global Payments",
    "CardHolder": "",
    "CardIssuer": "Credito",
    "CardNumber": "************3059",
    "CardTechnology": 1,
    "CardType": "",
    "Currency": "EUR",
    "Date": "20200522",
    "Id": "432864",
    "Language": "es",
    "Location": "BADALONA",
    "MerchantId": "329811087",
    "MerchantName": "Comercia Global Payments",
    "Modifiers": [],
    "OriginalTransactionDate": "",
    "OriginalTransactionId": "",
    "PinIndicator": 0,
    "SignatureImage": "89504e470d0a1a0a0000000d49484452000001f400000139080600000066a0d2e00000000479996a9212f464c2c0000000049454e44ae426082",
    "SignatureIndicator": 1,
    "Status": "0",
    "Templates": [],
    "TerminalId": "00000001",
    "Time": "0106",
    "Type": "Payment"
  }
}
				
			

Content-Type application/json

Date Thu, 21 May 2020 22:15:49 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

GET Cancel Transaction

This request cancels the transaction in progress.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/cancel

HEADERS

X-SOURCE

COMERCIA

Unique application request ID that identifies the application that is the origin of the API request.

These are sample requests and responses for GET Cancel Transaction. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "COMERCIA");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/cancel", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https:// 172.20.10.1:2011/v1/transactions/cancel");
request.Headers.Add("X-SOURCE", "COMERCIA");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/cancel' \
--header 'X-SOURCE: COMERCIA'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/cancel"

payload={}
headers = {
  'X-SOURCE': 'COMERCIA'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
				
			
				
					var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/cancel")!,timeoutInterval: Double.infinity)
request.addValue("COMERCIA", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "resultCode": 16,
  "resultMessage": "ERROR  - OPERACIÓN CANCELADA"
}
				
			

Content-Type application/json; charset=UTF-8

Date Tue, 24 Aug 2021 12:52:24 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

GET Print Last Transaction

This request asks for a copy of the most recent transaction completed by the system.

It must be sent to: https:// 172.20.10.1:2011/v1/transactions/last/print

HEADERS

X-SOURCE

APPNAME

Unique application request ID that identifies the application that is the origin of the API request.

These are sample requests and responses for GET Print Last Transaction. Here are some examples in different programming languages.

				
					var myHeaders = new Headers();
myHeaders.append("X-SOURCE", "APPNAME");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https:// 172.20.10.1:2011/v1/transactions/last/print", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
				
			
				
					var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https:// 172.20.10.1:2011/v1/transactions/last/print");
request.Headers.Add("X-SOURCE", "APPNAME");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
				
			
				
					curl --location 'https:// 172.20.10.1:2011/v1/transactions/last/print' \
--header 'X-SOURCE: APPNAME'
				
			
				
					import requests

url = "https:// 172.20.10.1:2011/v1/transactions/last/print"

payload={}
headers = {
  'X-SOURCE': 'APPNAME'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
				
			
				
					var request = URLRequest(url: URL(string: "https:// 172.20.10.1:2011/v1/transactions/last/print")!,timeoutInterval: Double.infinity)
request.addValue("APPNAME", forHTTPHeaderField: "X-SOURCE")

request.httpMethod = "GET"

let task = URLSession.shared.dataTask(with: request) { data, response, error in 
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
				
			

There are more samples of programming languages in our Postman collection.

This is the JSON for the response and its headers:

				
					{
  "resultCode": 0
}
				
			

Content-Type application/json

Date Mon, 31 May 2021 15:36:57 GMT

Access-Control-Allow-Credentials true

Access-Control-Allow-Origin *

Connection keep-alive

Content-Encoding gzip

Transfer-Encoding chunked

Artículos

  • Tokenization
Comparte este documento

Transactions

Copiar el enlace

Clipboard Icon
Tabla de Contenidos

Products

  • Cyberpac
  • Addon Payments
  • POS integrated Payments
  • Universal Pay

Sales

Tell us about your business so we can offer you the best solution.

Contact an expert
Contact an expert
Contact an expert
Contact an expert
Contact an expert

Technical Support

Already a client and need help? Contact us, we’re here for you.

Help

Partners

We work with the best partners for in-store and ecommerce solutions. Want to join us?

Join us

© Comercia Global Payments

Privacy policy
Exercising rights
Client information
Whistleblowing channel
Legal disclaimer
Cookies policy
Ask AI
Write your question. For example: How do I create a payment link?
SmartWiki may skip data. Verify the information or contact support.

SmartWiki, Powered by AI

API - Developers Docs
Manage cookie consent

To offer the best experiences, we use technologies such as cookies to store and/or access device information. Consent to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Failure to consent, or withdrawal of consent, may adversely affect certain features and functions.

Functional Always active
Storage or technical access is strictly necessary for the legitimate purpose of allowing the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
Technical storage or access is necessary for the legitimate purpose of storing preferences not requested by the subscriber or user.
Statistics
El almacenamiento o acceso técnico que es utilizado exclusivamente con fines estadísticos. Storage or technical access that is used exclusively for anonymous statistical purposes. Without a requirement, voluntary compliance by your Internet service provider, or additional records from a third party, information stored or retrieved solely for this purpose cannot be used to identify you.
Marketing
Storage or technical access is necessary to create user profiles to send advertising, or to track the user on a website or several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
See preferences
{title} {title} {title}

Consulta la documentación de las distintas secciones de integraciones:

Comienza a integrar

undraw_add_to_cart_re_wrdo 1 (1) (1)

Plugins para CMS

Complementa la integración

SDKs

Métodos de pago

Herramientas

Addon Payments

Consulta la documentación de Addon Payments. Aquí tienes las distintas secciones:

Integraciones

Consultas frecuentes

Portal Backoffice

Cyberpac

We are currently working on the English version of the Cyberpac documentation. You can view the Spanish version using the buttons below:

Canales BackOffice Portal

Plugins integration

Custom integrations

POS integrated Payments

Create a solution that will help you automate processes. You can even add payment processes on physical terminals.

Payment Integrated with Android POS

Payment Integrated with Smartphone POS

POS Data sheets

Addon Payments

Comercia Global Payments has several integration options so you can choose the most efficient one for you.

Integrations

Frequently Asked Questions

BackOffice Portal

Consult the documentation of the different integrations sections:​

Start integration

undraw_add_to_cart_re_wrdo 1 (1) (1)

CMS Plugins

Complement your integration

SDKs

Payment Methods

Tools