• Features
  • Shop
  • Pricing
  • User Guide
  • Support
 0 Kč
Login / Registration
  • CS
  • RO
  • DE
  • SK
  • HU
  • PL
  • EL
  • Features
  • Shop
  • Pricing
  • User Guide
  • Support
  • CS
  • RO
  • DE
  • SK
  • HU
  • PL
  • EL
BUY

Introduction

  • Before you begin
  • Receipt visual
  • Download
  • Legal Disclaimer
  • Integration support
  • Certification & Test Scenarios

app2app API

  • Introduction to app2app API
  • 1. Transaction registration
  • 2. Payment Request [transactionRequestV2]
  • 3. Get the status of the transaction
  • 4. Get transaction details
  • Code examples
  • Return codes
  • Check the installed application
  • Client ID
  • Settings in Android
  • Release notes
  • Get status method

Cloud API

  • Introduction to Cloud API
  • Transaction flow
  • Transaction sale
  • Transaction cancellation
  • Close batch
  • Master API account

iOS API

  • Transaction Sales (iOS)
  • Transaction Cancellation (iOS)
  • Day close execution (iOS)
  • Introduction to iOS API
View Categories
  • Main page
  • User Guide
  • API
  • Cloud API
  • Transaction sale

Transaction sale

A sales transaction is a basic payment operation that provides for the transfer of a specified amount from the cardholder's bank account to the merchant's account.

As for the payment process, the procedure is as follows:

Login & Authentication

JWT token authentication is required for all non-public endpoints. You get the token (with a lifetime of 90 days) through the /cloud/oauth/token endpoint with the following arguments provided:

  • Basic authentication for token endpoints (name/password) - will be provided for each user.
  • Merchant username - same as for GP tom
  • Merchant password - same as for GP tom
  • Terminal ID (TID) – Destination terminal ID
  • The authorization endpoint is located at:
    • Dev: https://cloud-api-dev.gptom.com/cloud/oauth/token
    • production: https://cloud-api.gptom.com/cloud/oauth/token

This authentication method is the same for all terminals.

Get an access token

Example request:

POST {{apiCloudHost}}/cloud/oauth/token
Authorization: Basic YXRvbTphc2hmdWY0ZTVmYQ==
Content-Type: application/x-www-form-urlencoded

(Authorization a Contect-Type je pro všechny zákazníky vždy stejný – použijte prosím stejné údaje jako v příkladu. Do grant_type je potřeba následně vložit unikátní údaje klienta).

grant_type=password&username=jan.novak@example.com&password=ABCDEFGHIJKL&tid=999888

Example answer:

{
"access_token": "eyJh…", // access token used in authenticated API requests
"token_type": "bearer",
"refresh_token": "GciO…",
"expires_in": 3600,
"scope": "read write",
"tid": "999888",
}

Token renewal

When the access_tokenu expires, refresh_token is available.

Example request:

POST {{apiHost}}/api/oauth/token
Authorization: Basic YXRvbTphc2hmdWY0ZTVmYQ==
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token&refresh_token=GciO…

GPTomAuth

Typ bezpečnostního schématu / Security scheme
HTTP
Schéma autorizace HTTP / HTTP authorization scheme
bearer

Create a task

Call the POST /v1/tasks/TRANSACTION endpoint and use CreateCloudTaskTransactionApiRequest with the following information filled in to make the request:

Variable
Format
Description
Example
apiKey
MANDATORY
String
API The key can be found directly in the app GP tom in the Account section-Cloud API . It is used to distinguish logins mainly in Cloud API . For each company, the API key is unique.
333W212J3
Variable
Format
Description
Example
Tid
MANDATORY
String
The target TID for the task. TID = Terminal ID, which is unique for each device. Only one TID can be used at a time on all installed devices.
483590
Variable
Format
Description
Example
initiator
MANDATORY
String
The initiator description should be unique to each instance of the subsystem that can initiate a task. Example: "Server XY" or "Cashier 1"
Cash desk 12
Variable
Format
Description
Example
title
MANDATORY
String
Human-readable task name. It should contain some identification of the task.
Example: "Invoice 37364FD"
Invoice 36744
Variable
Format
Description
Example
printByPaymentApp
Boolean
default: true
True if the receipt is to be printed on the device.
Note: For mobile phones, you need to make sure that the Bluetooth printer is connected.
false
Variable
Format
Description
Example
amount
MANDATORY
number
The transaction amount must be non-zero and include decimal places. For a transaction value of 50 EUR, you fill in the value "5000".
40000
Variable
Format
Description
Example
tipAmount
number
Amount of tipping. For a tip value of €3, fill in the value "300".
0
Variable
Format
Description
Example
transactionOperation
MANDATORY
String
The transaction type of the task. For the "Sale" transaction, fill in the "SALE" value.
SALE
Variable
Format
Description
Example
originTransactionId
String
The ID of the transaction to cancel. Not null if VOID mode and cancel are OLDER_TRANSACTION.
NOT USED
Variable
Format
Description
Example
originReferenceNum
String
Reference number, e.g. invoice number – add any value up to 20 characters that will be visible in the reports and identify the payment on your side.
FD123456
Variable
Format
Description
Example
cancelMode
String
Reversal mode, not null if the transaction type is VOID
Possible values: [ LAST_TRANSACTION, OLDER_TRANSACTION ]
NOT USED
Variable
Format
Description
Example
transactionType*
MANDATORY
String
Possible values: [ CASH, CARD, ACCOUNT_PAYMENT ]
CARD
Variable
Format
Description
Example
currencyCode
String
3 currency characters (according to ISO 4217)
CZK
Variable
Format
Description
Example
preferableReceiptType
String
Preselected method of sending the receipt: [ EMAIL, PHONE, QR, PRINT ]
EMAIL
Variable
Format
Description
Example
email
String
Customer email
support@gptom.com
Variable
Format
Description
Example
phone
String
Customer's phone number
+420123456789
Variable
Format
Description
Example
TipCollect
Boolean
default: false
If set to true, the tip entry screen in GP tom will be called first.
To call this screen, you also need to have tipping enabled in the app.
Variable
Format
Description
Example
timeToLive
Integer
The expiration limit for the cloud job. You are allowed to specify values from 10 to 172800 seconds.
10

Content of the response [CloudTaskDetailApiResponse]:

Possible response codes are:

Response
Message
Description
How to behave
RC200
OK - Task has been registered
The task has been successfully created and will be processed.
Proceed to the next step in the transaction flow.
Response
Message
Description
How to behave
RC401
Unauthenticated
If the autenfitting with the terminal has not taken place.
Perform the authentication process (see step above).
Response
Message
Description
How to behave
RC403
The user is not allowed to register the task on the given terminal
If your API credentials do not match the TID value you sent (for example, if the TID owner is different).
Check that you have filled in the correct TID and try again.
Response
Message
Description
How to behave
RC406
the task is not acceptable for the terminal
This usually happens when the TID is unable to process the request.
Check the error message.
Response
Message
Description
How to behave
RC 502
Push notification not sent
The push notification was not sent due to an upstream service failure.

Below you will find the variables used in the response:

Variable
Format
Description
Example
RC200
RC403
RC406
RC502
title
String
Human-readable task name. Used from request value.
Invoice 36744
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
taskId
String
Internal task id
dFd3sda
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
created
String
The date and time the task was created.
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
taskClass
String
Payload classPossible values: [TRANSACTION, BATCH, VOID]
TRANSACTION
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
status
String
Cloud task status. Possible values: [CREATED, STARTED, INIT_OK, INIT_ERROR, IN_PROGRESS, COMPLETED, CANCELLED, ERROR]
CREATED
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
initiator
String
A description of the client-side initiator. Used from request value.
Cash desk 12
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
contextId
String
The ID of the affected target entity, if any (transactionId / batchId)
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
Payload
object
Context task body - depending on taskClass
{...}
YES
WELL
WELL
WELL
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
exceptionId
String
Pseudo-unique exception ID. It can serve as a "support ID" that the user can communicate to support so that they can investigate the error.
FujIk6
WELL
YES
YES
YES
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
type
String
Type of exception.
VALIDATION_EXCEPTION
WELL
YES
YES
YES
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
Message
String
Exception message.
Password too weak
WELL
YES
YES
YES
Variable
Format
Description
Example
RC200
RC403
RC406
RC502
context
String
Exception context. Learn more.
[INSUFFICIENT_DIGIT]:{minimumRequired=1, matchingCharacterCount=0, validCharacters=0123456789, matchingCharacters=}
WELL
YES
YES
YES

Check the status of a task

V dalším kroku budete kontrolovat stav tasku na koncovém bodu GET /v1/tasks/{taskID} pomocí požadavku, který zahrnuje:

Variable
Format
Description
Example
taskId
String
The ID of the task that you received as part of the previous step.
dFd3sda

Possible return codes:

Response
Message
Message
Description
RC200
OK - Task status available
The job status update was successfully processed.
If you do not receive the final status (see below), repeat this step.
Response
Message
Message
Description
RC403
Cloud job not found for current terminal.
You should check your taskID and resubmit the correct value.
Check that you have filled in the correct taskID and try again.

Variables in the response:

Variable
Format
Description
Example
RC200
RC404
title
String
Human-readable task name. Used from the value of the task creation request.
Invoice 36744
YES
WELL
Variable
Format
Description
Example
RC200
RC404
taskId
String
Internal task ID
dFd3sda
YES
WELL
Variable
Format
Description
Example
RC200
RC404
created
String
The date and time the task was created.
YES
WELL
Variable
Format
Description
Example
RC200
RC404
taskClass
String
Possible values: [TRANSACTION, BATCH, DUMMY]
YES
WELL
Variable
Format
Description
Example
RC200
RC404
status
String
Possible values: [CREATED, STARTED, INIT_OK, INIT_ERROR, IN_PROGRESS, COMPLETED, CANCELLED, ERROR]
IN_PROGRESS
YES
WELL
Variable
Format
Description
Example
RC200
RC404
initiator
String
A description of the client-side initiator. Used from request value.
Cash desk 12
YES
WELL
Variable
Format
Description
Example
RC200
RC404
contextID
String
The ID of the affected target entity, if any (transactionId / batchId)
YES
WELL
Variable
Format
Description
Example
RC200
RC404
Payload
YES
WELL
Variable
Format
Description
Example
RC200
RC404
exceptionId
String
Pseudo-unique exception ID. It can serve as a "support ID" that the user can communicate to support so that they can investigate any issue.
FujIk6
WELL
YES
Variable
Format
Description
Example
RC200
RC404
type
String
Type of exception.
VALIDATION_EXCEPTION
WELL
YES
Variable
Format
Description
Example
RC200
RC404
Message
String
Exception message.
Password too weak
WELL
YES
Variable
Format
Description
Example
RC200
RC404
context
String
Exception context - more information.
[INSUFFICIENT_DIGIT]:{minimumRequired=1, matchingCharacterCount=0, validCharacters=0123456789, matchingCharacters=}
WELL
YES

The task status request should be repeated until you get one of the final response codes, which are:

Status
Description
How to behave
INIT_ERROR
The payment process failed to initialize. Check for the error you received.
Follow the error instructions.
Status
Description
How to behave
COMPLETED
Once you get this status, your task has been completed and the result is available.
You can proceed to the next step.
Status
Description
How to behave
CANCELLED
Task has been canceled by the user.
You should start a new job because this task has been canceled by the user.
Status
Description
How to behave
ERROR
An error occurred while processing the job.
Follow the error instructions.

You can proceed to the next step only when the response is in the COMPLETED state.

Getting a payment result

Nyní víme, že transakce byla autorizována. Cílem tohoto kroku je získat stav transakce a detaily transakce. Pro nový požadavek zavoláte koncový bod GET /v1/transactions/{transactionId}, kde použijete následující proměnné:

Variable
Format
Description
Example
contextId
String
The transaction ID that you get in the previous steps.

Possible response codes are:

Response
Message
Message
Description
RC200
OK – transaction details provided
Successful response to your request.
The transaction is completed!
Response
Message
Message
Description
RC404
A transaction could not be found for the current TID.
This condition occurs when a given transaction ID was not found for your device.
Check the transaction ID.

The response contains the following variables, depending on the response code:

Variable
Format
Description
Example
RC 200
RC 404
result
String
Transaction result, possible values [ ACCEPTED, DECLINED, CANCELLED ] where:
ACCEPTED - the transaction was successfully authorized
DECLINED - the transaction was rejected for some reason
CANCELLED - if the transaction is cancelled by the operator or customer
ACCEPTED
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
responseMessage
String
A more detailed description of the resulting value.
"Refused by issuer."
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
transanctionId
String
Internal Task ID
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
transactionOperation
String
Possible rates: ""SALE"" "VOID"" "REFUND""
Operation/transaction type."
SALE
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
transactionType
String
Possible values "CASH" "CARD"
CARD
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
merchantID
String
Only for card transactions - branch ID.
343382001
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
Tid
String
Transaction ID created by the terminal
483591
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
currencyCode
String
Currency code (ISO 4217)
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
amount
number
Transaction amount with 2 decimal places (400 CZK).
400
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
tipAmount
number
The amount of the tip entered to 2 decimal places (30 CZK).
3000
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
maskedPan
String
Masked card number.
XXXX XXXX XXXX 1233
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
cardDataEntry
String
Method of card loading - magstripe, chip or contactless
CONTACTLESS
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
referenceNumber
String
Transaction reference number taken from the task value of the request: originReferenceNum
FD123456
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
receiptNumber
String
Receipt number
12
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
batchNumber
String
Batch number
2
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
date
String
Date and time of transaction authorization
09.10.2021 15:34
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
cardType
String
EMV brand card taken from card data
Mastercard CL
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
declinedReason
String
Reason for transaction rejection
201
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
authorizationCode
String
Number generated on the GP side
10293045
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
sequenceNumber
String
Number generated on the GP side
102304128
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
aid
String
Identifies the EMV application used to process the transaction
40100000000
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
pinMessage
Boolean
Indicates whether the input has occurred PIN
Ok
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
cancelledBy
String
In case of a cancellation operation, the contextID will be displayed here
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
cardHolderVerificationMethod
String
For Nexgo terminals only - indicates the transaction verification method
PIN
YES
WELL
Variable
Format
Description
Example
RC 200
RC 404
exceptionId
String
Pseudo-unique exception ID. It can serve as a "support ID" that the user can communicate to support so that they can investigate.
FujIk6
WELL
YES
Variable
Format
Description
Example
RC 200
RC 404
type
String
Exception type
VALIDATION_EXCEPTION
WELL
YES
Variable
Format
Description
Example
RC 200
RC 404
Message
String
Exception message
Password too weak
WELL
YES
Variable
Format
Description
Example
RC 200
RC 404
context
String
Exception context - more information.
[INSUFFICIENT_DIGIT]:{minimumRequired=1, matchingCharacterCount=0, validCharacters=0123456789, matchingCharacters=}
WELL
YES

If you are going to generate or print the receipt on your side, we recommend that you check which fields are required and must be printed/displayed on the receipt. The description is available here.

How do you like this tutorial?
Transaction flowTransaction cancellation
Content
  • Login & Authentication
    • Get an access token
    • Token renewal
    • GPTomAuth
  • Create a task
    • Content of the response [CloudTaskDetailApiResponse]:
  • Check the status of a task
  • Getting a payment result

About the product

  • Features
  • Install the app
  • Releases
  • Support
  • Blog

For developers

  • Introduction to integration
  • app2app API
  • Cloud API
  • Integration according to the type of terminal
  • Integrated companies
  • Download

About the company

  • Contact
  • Information Protection Statement
  • Site Terms of Use
  • General Terms and Conditions
  • GDPR

User Guide

  • Install the app
  • Run the application for the first time
  • Payment by card
  • Cancellation of payment
  • Biometrics
  • In-app support