• 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 cancellation

Transaction cancellation

Information

If you are calling a cancellation through Cloud API , you must create a task for the device (TID) where the payment was originally made. Calling a cancellation made on terminal "A" on terminal "B" is not currently supported.

Transaction reversal is a basic payment operation that allows you to cancel a previously processed transaction up to 93 days after the original transaction. Cancellation of the transaction can be done without a customer card – the funds will be automatically returned to the card used for the original transaction of the sale type.

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

Get an access token

Example request:

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

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

Type of security scheme
HTTP authorization scheme
HTTP
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
apiKey
MANDATORY
Tid
MANDATORY
initiator
MANDATORY
title
MANDATORY
printByPaymentApp
amount
MANDATORY
tipAmount
transactionOperation
originTransactionId
originReferenceNum
cancelMode
MANDATORY
transactionType*
MANDATORY
currencyCode
timeToLive
Format
String
String
String
String
Boolean
number
number
String
String
String
String
String
String
Integer
Description
API key can be found directly in the application in the Account section-Cloud API . It is used to distinguish logins mainly in Cloud API .
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.
The initiator description should be unique to each instance of the subsystem that can initiate the task. Example: "Server XY" or "Cashier 1"
Human-readable task name. It should contain some identification of the task.
Example: "Invoice 37364FD payment"
default: true
True if the receipt is to be printed on the device.
Note: For mobile phones, make sure that the Bluetooth printer is connected.
The transaction amount to be canceled must be non-zero and include decimal places.
It is not used for cancellation.
The type of task transaction. For the "Transaction Cancellation" transaction, fill in the "VOID" value.
The ID of the transaction to cancel. Not null if VOID mode and cancel are OLDER_TRANSACTION.
If you do not want to print this value on the receipt, leave it blank.
Possible values: [ LAST_TRANSACTION, OLDER_TRANSACTION ] where:
LAST_TRANSACTION - used only for a previously authorized transaction. There can be no other requirement between this task and the previous sales task.
OLDER_TRANSACTION – Used for all older transactions except the last transaction.
Possible values: [ CASH, CARD ]
3 characters for currency code (ISO 4217)
The expiration limit for the cloud job. It is allowed to specify values from the seconds interval.
Example
333W212J3
483590
Cash desk 12
Cancellation 36744
false
40000
NOT USED
VOID
FD283737333
OPTIONAL
OLDER_TRANSACTION
CARD
CZK
10

Content of the response [CloudTaskDetailApiResponse]:

Possible response codes are:

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

Below you will find the variables used in the response:

Variable
title
taskId
created
taskClass
status
initiator
contextId
Payload
exceptionId
type
Message
context
Format
String
String
String
String
String
String
String
object
String
String
String
String
Description
Human-readable task name. Used from request value.
Internal task id
The date and time the task was created.
Payload classMopworthy values: [TRANSACTION, BATCH, DUMMY]
Cloud task status. Possible values: [CREATED, STARTED, INIT_OK, INIT_ERROR, IN_PROGRESS, COMPLETED, CANCELLED, ERROR]
A description of the client-side initiator. Used from request value.
The ID of the affected target entity, if any (transactionId / batchId)
Context task body - depending on taskClass
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.
Type of exception.
Exception message.
Exception context. Learn more.
Example
Invoice 36744
dFd3sda
TRANSACTION
CREATED
Cash desk 12
{...}
FujIk6
VALIDATION_EXCEPTION
Password too weak
[INSUFFICIENT_DIGIT]:{minimumRequired=1, matchingCharacterCount=0, validCharacters=0123456789, matchingCharacters=}
RC200
YES
YES
YES
YES
YES
YES
YES
YES
WELL
WELL
WELL
WELL
RC403
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
YES
YES
YES
YES
RC406
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
YES
YES
YES
YES
RC502
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
YES
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
taskId
Format
String
Description
The ID of the task that you received as part of the previous step.
Example
dFd3sda

Possible return codes:

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

Variables in the response:

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

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

Status
INIT_ERROR
COMPLETED
CANCELLED
ERROR
Description
The payment process failed to initialize. Check for the error you received.
Once you get this status, your task has been completed and the result is available.
Task has been canceled by the user.
An error occurred while processing the job.
How to behave
Follow the error instructions.
You can proceed to the next step.
You should start a new job because this task has been canceled by the user.
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
transactionId
Format
String
Description
The transaction ID that you get in the previous steps.
Example
4414c640-2db7-11ec-910a-91880dadec20

Possible response codes are:

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

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

Variable
result
responseMessage
transanctionId
transactionOperation
transactionType
merchantID
Tid
currencyCode
amount
tipAmount
cardNumber
cardDataEntry
referenceNumber
invoiceNumber
date
emvAppLabel
sequenceNumber
exceptionId
type
Message
context
Format
String
String
String
String
String
String
String
String
number
number
String
String
String
String
String
String
String
String
String
String
String
Description
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
A more detailed description of the resulting value.
Internal Task ID
Possible rates: ""SALE"" "VOID"" "REFUND""
Operation/transaction type."
Possible values "CASH" "CARD"
Only for card transactions - branch ID.
Transaction ID created by the terminal
Currency code (ISO 4217)
Transaction amount with 2 decimal places (400 CZK).
The amount of the tip entered to 2 decimal places (30 CZK).
Masked card number.
Card loading method - mag.strip, chip or contactless.
Transaction reference number taken from the task value of the request: originReferenceNum
Date and time of transaction authorization
EMV brand card taken from card data
Number generated on the GP side
Pseudo-unique exception ID. It can serve as a "support ID" that the user can communicate to support so that they can investigate.
Exception type
Exception message
Exception context - more information.
Example
ACCEPTED
Null
4414c640-2db7-11ec-910a-91880dadec20
VOID
CARD
343382001
483591
40000
-
1233
Null
FD123456
2020-09-16T09:31:16.000S
Null
102304128
FujIk6
VALIDATION_EXCEPTION
Password too weak
[INSUFFICIENT_DIGIT]:{minimumRequired=1, matchingCharacterCount=0, validCharacters=0123456789, matchingCharacters=}
RC 200
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
WELL
WELL
WELL
WELL
RC 404
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
WELL
YES
YES
YES
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 saleClose batch
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