GoPay REST API
GoPay REST API is avaliable in test mode at https://gw.sandbox.gopay.com/api. Production enviroment is located at https://gate.gopay.cz/api. All comunication with API is encoded in UTF-8. You can find integration details in our help center. For the test purposes you can use making test paymets guide (includes e.g. test payments cards).
API ENDPOINTS
Sandbox enviroment - https://gw.sandbox.gopay.com/api
Production enviroment - https://gate.gopay.cz/api
AVAILABLE METHODS
/oauth2/token
/payments/payment
/payments/payment/{id}
/payments/payment/{id}/refund
/payments/payment/{id}/create-recurrence
/payments/payment/{id}/void-recurrence
/payments/payment/{id}/void-authorization
/payments/payment/{id}/capture
GitHub: https://github.com/gopaycommunity/gopay-php-api
Requirements: PHP >= 8.1
Composer download: https://getcomposer.org
Installation: composer require gopay/payments-sdk-php
https://github.com/gopaycommunity/gopay-python-api
Requirements: Python >= 3.8.1
Installation: pip install gopay
https://github.com/gopaycommunity/gopay-dotnet-api
Requirements : .NET 4.0+
NuGet
PM> Install-Package GOPAY.NET
Dependencies
Newtonsoft.Json
Restsharp
Restsharp.Newtonsoft.Json
Namespace
using GoPay.Common;
using GoPay.Model;
using GoPay.Payment;
using GoPay.Model.Payments;
using GoPay.EETProp;
using GoPay.Account;
https://github.com/gopaycommunity/gopay-java-api
Requirements : Java 11
Installation :
git clone https://github.com/gopaycommunity/gopay-java-api.git cd gopay-java-api
mvn package
All artifacts are located in the maven central repository.
http://mvnrepository.com/artifact/cz.gopay
If Apache HTTP Client does not suit you, the api supports two frameworks:
Resteasy
Apache CXF
More info about frameworks integration can be found on our github
The basic element of all communication via REST API is an access token that is created by using the access data in the form of <ClientID>:<ClientSecret>
, encoded in base64 and passed in the Authorization
header. A token is set as an authorization parameter in HTTP request header through Authorization: Bearer <Access-Token>
. This token is set for every requirement for API. Token expires after 30 minutes. After expiry of the token, it is necessary to create a new access token.
ⓘ If you do not have ClientID and ClientSecret, please, make your registration.
Request headers
Always application/json
Always application/x-www-form-urlencoded
Basic HTTP authentication
Request body
Access token scope
Always client_credentials
Responses
Body
Always bearer
Access token
Refresh token - currently not used
Token validity time (in seconds)
POST /api/oauth2/token HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Basic MTA2MTM5OTE2MzpzdERUbVZYRg==
scope=payment-create
&grant_type=client_credentials
curl -v -N https://gw.sandbox.gopay.com/api/oauth2/token \
-X "POST" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "1061399163:stDTmVXF" \
-d "grant_type=client_credentials&scope=payment-create"
<?php
$gopay = GoPay\payments([
'goid' => '8123456789',
'clientId' => '1061399163',
'clientSecret' => 'stDTmVXF',
'gatewayUrl' => 'https://gw.sandbox.gopay.com/',
'scope' => GoPay\Definition\TokenScope::ALL,
'language' => GoPay\Definition\Language::CZECH,
'timeout' => 30
]);
// token is retrieved automatically, no need to call a specific method
import gopay
api = gopay.payments({
'goid': '8302931681',
'clientId': '1061399163',
'clientSecret': 'stDTmVXF',
'isProductionMode': False,
'scope': gopay.TokenScope.ALL,
'language': gopay.Language.CZECH,
'timeout': 30
})
# token is retrieved automatically, no need to call a specific method
var connector = new GPConnector(<API_URL>,<USER_ID>, <USER_SECRET>);
connector.GetAppToken();
IGPConnector connector = HttpClientGPConnector.build(<API_URL>);
connector.getAppToken(<CLIENT_ID>,<CLIENT_CREDENTIALS>);
// API_URL for sandbox - https://gw.sandbox.gopay.com/api
// API_URL for production mode - https://gate.gopay.cz/api
{
"token_type":"bearer",
"access_token":"AAAnu3YnAHRk298EsmyttFQMcbCcvmwTKK5hrJx2aGG8ZnFyBJhAvFWNmbWVSD7p",
"expires_in":1800
}
Before initiating the payment gateway, it is necessary to establish the payment. In effect of calling, we repeat parameters of the payment including the parameter gw_url
, which you can initiate to inline or redirect payment gateway.
The payee of the payment is identified by goid
in the target
object. You can get it, when you integrate the payment gateway for identification of specific point of sale, e.g. demo.goshop.com.
If you do not have GoID, please, make your registration.
Within the payment, the paying party is described by an object payer, which identifies the payer and determines the set of permitted payment method, including the default method.
{id}
{id}
/refundThe payment is determined for paying of an order by credit card, bank transfer, GoPay account and other payment methods. For further information about all steps needed to make base payment check our help center.
When using the preauthorization
and recurrence
parameters, the payment will be preauthorized, or recurrent respectively.
ⓘ We strongly recommend to include the contact object in the payer object with all customer data. This might lead to a better success rate of payments.
Request headers
String “Bearer” followed by the access token
Always application/json
Always application/json
Request body
Payment method settings and payer information
Payee information
Details of the payment items
Payment amount in cents
Payment currency
Merchant’s order id, alphanumeric
Order description, alphanumeric
Payment gateway language
Callback URL for processing of the payment result / Notification URL for processing of change of payment status
Additional payment parameters
true
if the payment should be preauthorized
Contains object describing recurrence, if the payment should be recurrent
Responses
Body
Payment ID
Order ID
Payment status
Amount in cents
Payment currency
Information about the payer and payment methods
Payee information
Additional parameters
Payment gateway language
Descibes recurrence if the payment is recurrent
Describes preauthorization if the payment is preauthorized
URL for initiation of the payment gate
POST /api/payments/payment HTTP/1.1
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
Content-Type: application/json
Accept: application/json
{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"BANK_ACCOUNT"
],
"default_payment_instrument": "PAYMENT_CARD",
"allowed_swifts": [
"FIOBCZPP",
"BREXCZPP"
],
"default_swift": "FIOBCZPP",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Obuv",
"amount": 119990,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
],
"amount": 119990,
"currency": "CZK",
"order_number": "OBJ20200825",
"order_description": "Obuv",
"lang": "CS",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}
curl -X POST "https://gw.sandbox.gopay.com/api/payments/payment" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"BANK_ACCOUNT"
],
"default_payment_instrument": "PAYMENT_CARD",
"allowed_swifts": [
"FIOBCZPP",
"BREXCZPP"
],
"default_swift": "FIOBCZPP",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Obuv",
"amount": 119990,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
],
"amount": 119990,
"currency": "CZK",
"order_number": "OBJ20200825",
"order_description": "Obuv",
"lang": "CS",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}'
<?php
use GoPay\Definition\Language;
use GoPay\Definition\Payment\Currency;
use GoPay\Definition\Payment\PaymentInstrument;
use GoPay\Definition\Payment\BankSwiftCode;
use GoPay\Definition\Payment\VatRate;
use GoPay\Definition\Payment\PaymentItemType;
$response = $gopay->createPayment([
'payer' => [
'default_payment_instrument' => PaymentInstrument::BANK_ACCOUNT,
'allowed_payment_instruments' => [PaymentInstrument::BANK_ACCOUNT],
'default_swift' => BankSwiftCode::FIO_BANKA,
'allowed_swifts' => [BankSwiftCode::FIO_BANKA, BankSwiftCode::MBANK],
'contact' => ['first_name' => 'Zbynek',
'last_name' => 'Zak',
'email' => 'test@test.cz',
'phone_number' => '+420777456123',
'city' => 'C.Budejovice',
'street' => 'Plana 67',
'postal_code' => '373 01',
'country_code' => 'CZE'
]
],
'amount' => 139951,
'currency' => Currency::CZECH_CROWNS,
'order_number' => '001',
'order_description' => 'obuv',
'items' => [[
'type' => 'ITEM',
'name' => 'obuv',
'product_url' => 'https://www.eshop.cz/boty/lodicky',
'ean' => 1234567890123,
'amount' => 119990,
'count' => 1,
'vat_rate' => VatRate::RATE_4
],
[
'type' => PaymentItemType::ITEM,
'name' => 'oprava podpatku',
'product_url' => 'https://www.eshop.cz/boty/opravy',
'ean' => 1234567890189,
'amount' => 19961,
'count' => 1,
'vat_rate' => VatRate::RATE_3
]],
'eet' => [
'celk_trzba' => 139951,
'zakl_dan1' => 99160,
'dan1' => 20830,
'zakl_dan2' => 17358,
'dan2' => 2603,
'mena' => Currency::CZECH_CROWNS
],
'additional_params' => [['name' => 'invoicenumber',
'value' => '2015001003'
]],
'callback' => [
'return_url' => 'https://www.eshop.cz/return',
'notification_url' => 'https://www.eshop.cz/notify'
],
'lang' => Language::CZECH
]);
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency
response = api.create_payment({
'payer': {
'default_payment_instrument': PaymentInstrument.BANK_ACCOUNT,
'allowed_payment_instruments': [PaymentInstrument.BANK_ACCOUNT],
'default_swift': BankSwiftCode.FIO_BANKA,
'allowed_swifts': [BankSwiftCode.FIO_BANKA, BankSwiftCode.MBANK],
'contact': {
'first_name': 'Zbynek',
'last_name': 'Zak',
'email': 'test@test.cz',
'phone_number': '+420777456123',
'city': 'C.Budejovice',
'street': 'Plana 67',
'postal_code': '373 01',
'country_code': 'CZE',
},
},
'amount': 139951,
'currency': Currency.CZECH_CROWNS,
'order_number': '001',
'order_description': 'pojisteni01',
'items': [
{'name': 'item01', 'amount': 119990},
{'name': 'item02', 'amount': 19961},
],
'additional_params': [
{'name': 'invoicenumber', 'value': '2015001003'}
],
'callback': {
'return_url': 'http://www.your-url.tld/return',
'notification_url': 'http://www.your-url.tld/notify'
}
})
var payment = new BasePayment()
{
Currency = <Currency>,
Lang = "ENG",
OrderNumber = "789456167879",
Amount = 139951,
Target = new Target()
{
GoId = <GOID>,
Type = Target.TargetType.ACCOUNT
},
Callback = new Callback()
{
NotificationUrl = <NOTIFICATION_URL>,
ReturnUrl = <RETURN_URL>
},
Payer = new Payer()
{
Contact = new PayerContact()
{
Email = "test@test.cz"
},
DefaultPaymentInstrument = PaymentInstrument.PAYMENT_CARD
}
};
try {
var result = connector.CreatePayment(payment);
} catch (GPClientException e) {
//
}
BasePayment payment = PaymentFactory.createBasePaymentBuilder()
.order(<ORDER_NUMBER>, <AMOUNT>, Currency.EUR, <DESCRIPTION>)
.addItem(<ITEM_NAME>, <AMOUNT>, <FEE>, <COUNT>)
.addAdditionalParameter(<Key>, <VALUE>)
.withCallback(<RETURN_URL>, <NOTIFY_URL>)
.payer(<Payer>)
.inLang(Lang.EN)
.toEshop(<GO_ID>)
.build();
try {
Payment result = connector.createPayment(payment);
} catch (GPClientException e) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id": 3000006529,
"order_number": "OBJ20200825",
"state": "CREATED",
"amount": 139950,
"currency": "CZK",
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"BANK_ACCOUNT"
],
"default_payment_instrument": "PAYMENT_CARD",
"allowed_swifts": [
"FIOBCZPP",
"BREXCZPP"
],
"default_swift": "FIOBCZPP",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
],
"lang": "CS",
"gw_url": "https://gw.sandbox.gopay.com/gw/v3/bCcvmwTKK5hrJx2aGG8ZnFyBJhAvF"
}
{id}
The payment status funcionality allows the point of sale to determine, whether the payment was successfully paid or not. By default, the payment status is queried after receiving of a notification about the payment status change.
If the payment is preauthorized or recurrent, the response contains preauthorization or recurrence respectively. The payer object can contains info about bank account or payment card if the payment was paid using one of those methods. It can also contain information regarding the identification payment.
More information about payment state you can find in our help center.
Path variables
Payment ID of requested payment
Request headers
Always application/json
String “Bearer” followed by the access token
Responses
Body
Payment ID
Order ID
Payment status
Payment substate
Payment amount in cents
Payment currency
Payment method used
Information about payer and payment methods
Payee information
Additional payment parameters
Payment gateway language
Recurrence info if the payment is recurrent
Preauthorization info if the payment is preauthorized
Payment gateway URL
GET /api/payments/payment/3000006529 HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
curl -X GET "/api/payments/payment/3000006529" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969"
<?php
$response = $gopay->getStatus(3000006529);
response = api.get_status(3000006529)
try {
var payment = connector.PaymentStatus(<PAYMENT_ID>);
} catch (GPClientException e) {
//
}
try {
Payment payment = connector.paymentStatus(<PAYMENT_ID>);
} catch (GPClientException e) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id": 3000006529,
"order_number": "OBJ20200825",
"state": "PAID",
"amount": 139950,
"currency": "CZK",
"payment_instrument": "PAYMENT_CARD",
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"BANK_ACCOUNT"
],
"default_payment_instrument": "PAYMENT_CARD",
"allowed_swifts": [
"FIOBCZPP",
"BREXCZPP"
],
"default_swift": "FIOBCZPP",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
},
"payment_card": {
"card_number": "444444******4448",
"card_expiration": "1909",
"card_brand": "VISA",
"card_issuer_country": "CZE",
"card_issuer_bank": "AIR BANK, A.S.",
"3ds_result": "Y/Y"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
],
"lang": "CS",
"gw_url": " https://gw.sandbox.gopay.com/gw/v3/bCcvmwTKK5hrJx2aGG8ZnFyBJhAvF"
}
{id}
/refundRefund of the payment is a functionality which allows recovering funds for already made payment to the customer.
Based on the amount
parameter, the refund can be either full or partial.
You can find additional information about refunds in help center.
Path variables
Payment ID to refund
Request headers
Always application/json
Always application/x-www-form-urlencoded
String “Bearer” followed by the access token
Request body
Amount to be refunded in cents
Responses
Body
Payment ID
Result of the operation
POST /api/payments/payment/3000006620/refund HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
amount=50000
curl -X POST "/api/payments/payment/3000006620/refund" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-d 'amount=50000'
<?php
$response = $gopay->refundPayment(3000006620, 50000);
response = api.refund_payment(3000006620, 50000)
try {
var result = connector.RefundPayment(<PAYMENT_ID>, <AMOUNT>);
} catch (GPClientException e) {
//
}
try {
PaymentResult result = connector.refundPayment(<PAYMENT_ID>, <AMOUNT>);
} catch (GPClientException e) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id": 3000006620,
"result": "FINISHED"
}
{id}
/create-recurrence{id}
/void-recurrenceRecurring payment is a functionality that allows accepting the payment via payment cards from the customer on a regular basis. After the successful initiation of the initiation payment, payments are made automatically, e.g. on daily basis DAY
or on demand ON_DEMAND
.
In the case of the ON_DEMAND
payment, the subsequent payment is made by API call for recurrence payment.
ⓘ Another information about recurring payments you can find in our Help Center.
In order to create a recurring payment, use standard payment creation, extended with the recurrence object.
POST /api/payments/payment HTTP/1.1
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
Content-Type: application/json
Accept: application/json
{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"APPLE_PAY"
],
"default_payment_instrument": "PAYMENT_CARD",
"contact": {
"first_name": "John",
"last_name": "Doe",
"email": "test@test.com",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Subscription",
"amount": 1190,
"count": 1,
"product_url": "https://www.eshop.com/shoes/stiletto"
}
],
"recurrence": {
"recurrence_cycle": "MONTH",
"recurrence_period": 1,
"recurrence_date_to": "2025-12-31",
},
"amount": 1190,
"currency": "EUR",
"order_number": "ORD20200825",
"order_description": "Subscription",
"lang": "EN",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}
curl -X POST "https://gw.sandbox.gopay.com/api/payments/payment" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"APPLE_PAY"
],
"default_payment_instrument": "PAYMENT_CARD",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Obuv",
"amount": 119990,
"count": 2,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
],
"recurrence": {
"recurrence_cycle": "MONTH",
"recurrence_period": 1,
"recurrence_date_to": "2025-12-31"
},
"amount": 139950,
"currency": "CZK",
"order_number": "OBJ20200825",
"order_description": "Obuv",
"lang": "CS",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}'
<?php
use GoPay\Definition\Payment\Currency;
use GoPay\Definition\Payment\PaymentInstrument;
use GoPay\Definition\Payment\BankSwiftCode;
use GoPay\Definition\Payment\Recurrence;
$response = $gopay->createPayment([
'payer' => [
'contact' => [
'first_name' => 'Zbynek',
'last_name' => 'Zak',
'email' => 'test@test.cz',
'phone_number' => '+420777456123',
'city' => 'C.Budejovice',
'street' => 'Plana 67',
'postal_code' => '373 01',
'country_code' => 'CZE',
],
],
'amount' => 1000,
'currency' => Currency::CZECH_CROWNS,
'order_number' => '001',
'order_description' => 'objednavka01',
'items' => [
[
'type' => 'ITEM',
'name' => 'obuv',
'product_url' => 'https://www.eshop.cz/boty/lodicky',
'ean' => 1234567890123,
'amount' => 700,
'count' => 1,
'vat_rate' => VatRate::RATE_4
],
[
'type' => 'ITEM',
'name' => 'oprava podpatku',
'product_url' => 'https://www.eshop.cz/boty/opravy',
'ean' => 1234567890189,
'amount' => 300,
'count' => 1,
'vat_rate' => VatRate::RATE_3
],
],
'recurrence' => [
'recurrence_cycle' => Recurrence::DAILY,
'recurrence_period' => "7",
'recurrence_date_to' => '2025-12-31'
],
'additional_params' => [
array('name' => 'invoicenumber', 'value' => '2015001003')
],
'callback' => [
'return_url' => 'http://www.your-url.tld/return',
'notification_url' => 'http://www.your-url.tld/notify'
]
]);
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency, Recurrence
response = api.create_payment({
'payer': {
'contact': {
'first_name': 'Zbynek',
'last_name': 'Zak',
'email': 'test@test.cz',
'phone_number': '+420777456123',
'city': 'C.Budejovice',
'street': 'Plana 67',
'postal_code': '373 01',
'country_code': 'CZE',
},
},
'amount': 150,
'currency': Currency.CZECH_CROWNS,
'order_number': '001',
'order_description': 'pojisteni01',
'items': [
{'name': 'item01', 'amount': 50},
{'name': 'item02', 'amount': 100},
],
'recurrence': {
'recurrence_cycle': Recurrence.DAILY,
'recurrence_period': "7",
'recurrence_date_to': '2015-12-31'
},
'additional_params': [
{'name': 'invoicenumber', 'value': '2015001003'}
],
'callback': {
'return_url': 'http://www.your-url.tld/return',
'notification_url': 'http://www.your-url.tld/notify'
}
})
var recurrence = new Recurrence()
{
Cycle = RecurrenceCycle.DAY,
DateTo = new DateTime(2020, 12, 12),
Period = 5
};
var payment = new BasePayment();
payment.Recurrence = recurrence;
try {
connector.CreatePayment(payment);
} catch {GPClientException e) {
//
}
BasePayment payment = PaymentFactory.createBasePaymentBuilder()
.order(<ORDER_NUMBER>, <AMOUNT>, Currency.EUR, <DESCRIPTION>)
.addItem(<ITEM_NAME>, <AMOUNT>, <FEE>, <COUNT>)
.addAdditionalParameter(<Key>, <VALUE>)
.withCallback(<RETURN_URL>, <NOTIFY_URL>)
.payer(<Payer>)
.inLang(Lang.EN)
.toEshop(<GO_ID>)
.build();
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, 2016);
calendar.set(Calendar.MONTH, 2);
calendar.set(Calendar.DAY_OF_MONTH, 1);
Recurrence r = Recurrence.build(calendar.getTime())
.withTimeInterval(RecurrenceCycle.WEEK, 1)
.inState(Recurrence.RecurrenceState.STARTED);
payment.setRecurrence(r);
try {
connector.createPayment(payment);
} catch {GPClientException e) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id":3000006542,
"order_number":"001",
"state":"CREATED",
"amount":1000,"currency":"CZK",
"payer":{
"contact":{"first_name":"Zbynek",
"last_name":"Zak",
"email":" test@test.cz",
"phone_number":"+420777456123",
"city":"C.Budejovice",
"street":"Plana 67",
"postal_code":"37301",
"country_code":"CZE"
}
},
"target":{"type":"ACCOUNT","goid":8123456789},
"recurrence":{"recurrence_cycle":"DAY",
"recurrence_period":7,
"recurrence_date_to":"2025-12-31",
"recurrence_state":"REQUESTED"
},
"additional_params":[{"name":"invoicenumber",
"value":"2015001003"
}],
"lang":"cs",
"gw_url":" https://gw.sandbox.gopay.com/gw/v3/bCcvmwTKK5hrJx2aGG8ZnFyBJhAvF "
}
{id}
/create-recurrenceThe functionality allows you to recur the payment based on previously established recurring payment ON_DEMAND
mode. Recurring in this mode establishes the subsequent payment. The point of sale is informed through the notification about the change in the payment status.
More information about reccuring payments you can find in help center.
Path variables
Parent payment ID
Request headers
Always application/json
Always application/json
String “Bearer” followed by the access token
Request body
Payment amount in cents
Payment currency
Merchant’s order id, alphanumeric
Order description, alphanumeric
Details of the payment items
Additional payment parameters
Responses
Body
Payment ID
Parent payment ID
Order ID
Payment status
Payment amount
Payment currency
Paymemnt method
Information about the payer and payment methods
Payee information
Additional parameters
Payment gateway language
POST /api/payments/payment/3000006542/create-recurrence HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
{
"amount": 119900,
"currency": "EUR",
"order_number": "OBJ20200825",
"order_description": "Subscription",
"items": [
{
"type": "ITEM",
"name": "Subscription",
"amount": 119900,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.com/subscribe"
}
],
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}
curl -X POST "/api/payments/payment/3000006542/create-recurrence" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-d '{
"amount": 119900,
"currency": "EUR",
"order_number": "OBJ20200825",
"order_description": "Subscription",
"items": [
{
"type": "ITEM",
"name": "Subscription",
"amount": 119900,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.com/subscribe"
}
],
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}'
<?php
$response = $gopay->createRecurrence(
3000006542,
[
'amount' => '500',
'currency' => 'EUR',
'order_number' => '002',
'order_description' => 'subscription02',
'items' => [
['name' => 'item01', 'amount' => '500']
],
'additional_params' => [
['name' => 'invoicenumber', 'value' => '2021001004']
]
]
);
response = api.create_recurrence(
3000006542,
{
'amount': '500',
'currency': 'CZK',
'order_number': '002',
'order_description': 'pojisteni02',
'items': {
{'name': 'item01', 'amount': '500'}
},
'additional_params': {
{'name': 'invoicenumber', 'value': '2015001004'}
}
}
)
var nextPayment = new NextPayment()
{
Amount = <Amount>,
Currency = <Currency>,
OrderNumber = <OrderNumber>,
OrderDescription = <OrderDescription>
};
try
{
connector.CreateRecurrentPayment(<IdOfPaidOnDemandPayment>, nextPayment)
}
catch (GPClientExcepetion exception)
{
//
}
try {
NextPaymentBuilder builder = PaymentFactory.createNextPaymentBuilder();
...
PaymentResult recurrentPayment = connector.createRecurrentPayment(<ID>, builder.build());
} catch (GPClientException ex) {
//
}
{
"id":3000006621,
"parent_id":3000006542,
"order_number":"002",
"state":"CREATED",
"amount":1000,
"currency":"EUR",
"payment_instrument":"PAYMENT_CARD",
"payer": {
"contact":{"first_name":"John",
"last_name":"Doe",
"email":" test@test.com",
"phone_number":"+420777456123",
"city":"C.Budejovice",
"street":"Plana 67",
"postal_code":"37301",
"country_code":"CZE"
}
},
"target":{"type":"ACCOUNT",
"goid":8123456789
},
"additional_params":[{"name":"invoicenumber","value":"2015001004"}],
"lang":"cs",
"gw_url":"https://gw.sandbox.gopay.com/gw/v3/bCcvmwTKK5hrJx2aGG8ZnFyBJhAvF"
}
{id}
/void-recurrenceThe functionality allows you to cancel recurrence of previously created payment. The user has the same opportunity as logged into GoPay account.
More information about recurring payments you can find in help center.
ⓘ We recommend at least 3 tries to make recurrence on parent payment. If they are all unsuccessful you can cancel the recurrence.
Path variables
Parent payment ID
Request headers
Always application/json
Always application/x-www-form-urlencoded
String “Bearer” followed by the access token
Responses
Body
Payment ID
Result of the operation
POST /api/payments/payment/3000006542/void-recurrence HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
curl -X POST "/api/payments/payment/3000006542/void-recurrence" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969"
<?php
$response = $gopay->voidRecurrence(3000006542);
response = api.void_recurrence(3000006529)
try {
var voidRecurrency = connector.VoidRecurrency(<ID>);
} catch (GPClientException ex) {
//
}
try {
PaymentResult voidRecurrency = connector.voidRecurrency(<ID>);
} catch (GPClientException ex) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id": 3000006542,
"result": "ACCEPTED"
}
Pre-authorization allows you to block funds in the customer’s account for 4 days when paying by card. Blocked resources can then be partially captured or captured in full using API calls.
To release blocked funds, it is necessary to cancel the pre-authorization of the payment.
{id}
/capture{id}
/capture{id}
/void-authorizationCreating a preauthorized payment is basically the same as the API by calling create standard payment, where you need to add the preauthorization
parameter with the valuetrue
.
POST /api/payments/payment HTTP/1.1
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
Content-Type: application/json
Accept: application/json
{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD"
],
"default_payment_instrument": "PAYMENT_CARD",
"contact": {
"first_name": "John",
"last_name": "Doe",
"email": "test@test.com",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Shoes",
"amount": 119990,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.com/shoes/shoe"
}
],
"preauthorization": true,
"amount": 119990,
"currency": "EUR",
"order_number": "OBJ20200825",
"order_description": "Shoes",
"lang": "CS",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}
curl -X POST "https://gw.sandbox.gopay.com/api/payments/payment" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"payer": {
"allowed_payment_instruments": [
"PAYMENT_CARD",
"BANK_ACCOUNT"
],
"default_payment_instrument": "PAYMENT_CARD",
"allowed_swifts": [
"FIOBCZPP",
"BREXCZPP"
],
"default_swift": "FIOBCZPP",
"contact": {
"first_name": "Zbyněk",
"last_name": "Žák",
"email": "test@test.cz",
"phone_number": "+420777456123",
"city": "České Budějovice",
"street": "Planá 67",
"postal_code": "37301",
"country_code": "CZE"
}
},
"target": {
"type": "ACCOUNT",
"goid": 8123456789
},
"items": [
{
"type": "DISCOUNT",
"name": "Obuv",
"amount": 119990,
"count": 1,
"vat_rate": "21",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
],
"preauthorization": "true",
"amount": 119990,
"currency": "CZK",
"order_number": "OBJ20200825",
"order_description": "Obuv",
"lang": "CS",
"callback": {
"return_url": "https://www.example.com/return",
"notification_url": "https://www.example.com/notify"
},
"additional_params": [
{
"name": "invoicenumber",
"value": "2015001003"
}
]
}'
<?php
use GoPay\Definition\Payment\Currency;
use GoPay\Definition\Payment\PaymentInstrument;
use GoPay\Definition\Payment\BankSwiftCode;
$response = $gopay->createPayment([
'payer' => [
'contact' => [
'first_name' => 'Zbynek',
'last_name' => 'Zak',
'email' => 'test@test.cz',
'phone_number' => '+420777456123',
'city' => 'C.Budejovice',
'street' => 'Plana 67',
'postal_code' => '373 01',
'country_code' => 'CZE',
],
],
'amount' => 1000,
'currency' => Currency::CZECH_CROWNS,
'order_number' => '001',
'order_description' => 'objednavka01',
'items' => [
[
'type' => 'ITEM',
'name' => 'obuv',
'product_url' => 'https://www.eshop.cz/boty/lodicky',
'ean' => 1234567890123,
'amount' => 700,
'count' => 1,
'vat_rate' => VatRate::RATE_4
],
[
'type' => 'ITEM',
'name' => 'oprava podpatku',
'product_url' => 'https://www.eshop.cz/boty/opravy',
'ean' => 1234567890189,
'amount' => 300,
'count' => 1,
'vat_rate' => VatRate::RATE_3
],
],
'preauthorization' => true,
'additional_params' => [
array('name' => 'invoicenumber', 'value' => '2015001003')
],
'callback' => [
'return_url' => 'http://www.your-url.tld/return',
'notification_url' => 'http://www.your-url.tld/notify'
]
]);
from gopay.enums import PaymentInstrument, BankSwiftCode, Currency
response = api.create_payment({
'payer': {
'contact': {
'first_name': 'Zbynek',
'last_name': 'Zak',
'email': 'test@test.cz',
'phone_number': '+420777456123',
'city': 'C.Budejovice',
'street': 'Plana 67',
'postal_code': '373 01',
'country_code': 'CZE',
},
},
'amount': 150,
'currency': Currency.CZECH_CROWNS,
'order_number': '001',
'order_description': 'pojisteni01',
'items': [
{'name': 'item01', 'amount': 50},
{'name': 'item02', 'amount': 100},
],
'preauthorization': True,
'additional_params': [
{'name': 'invoicenumber', 'value': '2015001003'}
],
'callback': {
'return_url': 'http://www.your-url.tld/return',
'notification_url': 'http://www.your-url.tld/notify'
}
})
var payment = new BasePayment()
{
PreAuthorize = true,
...
};
try {
connector.CreatePayment(payment);
} catch (GPClientException ex) {
//
}
BasePayment payment = PaymentFactory.createBasePaymentBuilder()
.order(<ORDER_NUMBER>, <AMOUNT>, <CURRENCY>, <DESCRIPTION>)
.addItem(<ITEM_NAME>, <AMOUNT>, <FEE>, <COUNT>)
.addAdditionalParameter(<Key>, <VALUE>)
.withCallback(<RETURN_URL>, <NOTIFY_URL>)
.payer(<Payer>)
.inLang(Lang.EN)
.toEshop(<GO_ID>)
.preauthorize()
.build();
try {
Payment result = connector.createPayment(payment);
} catch (GPClientException e) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id":3000006542,
"order_number":"001",
"state":"CREATED",
"amount":1000,"currency":"CZK",
"payer":{
"contact":{"first_name":"Zbynek",
"last_name":"Zak",
"email":" test@test.cz ",
"phone_number":"+420777456123",
"city":"C.Budejovice",
"street":"Plana 67",
"postal_code":"37301",
"country_code":"CZE"
}
},
"target":{"type":"ACCOUNT",
"goid":8123456789
},
"preauthorization":{"requested":true,
"state":"REQUESTED"
},
"additional_params":[{"name":"invoicenumber",
"value":"2015001003"
}],
"lang":"cs",
"gw_url":" https://gw.sandbox.gopay.com/gw/v3/bCcvmwTKK5hrJx2aGG8ZnFyBJhAvF "
}
{id}
/captureThe functionality enables the capture of preauthorized funds previously created by preauthorized payment.
For a detailed description of the steps required to make a pre-authorized payment, please visit our Help Center.
Path variables
Pre-Authorized payment ID
Request headers
Always application/json
String “Bearer” followed by the access token
Responses
Body
Payment ID
Result of the operation
POST /api/payments/payment/3000006542/capture HTTP/1.1
Accept: application/json
Content-Type: application/x-www-from-urlencoded
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
curl -X POST "/api/payments/payment/3000006542/capture" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-from-urlencoded" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969"
<?php
$response = $gopay->captureAuthorization(3000006542);
response = api.capture_authorization(3000006542)
try {
var capture = connector.CapturePayment(<ID>);
} catch (GPClientException ex) {
//
}
try {
PaymentResult capture = connector.capturePayment(<ID>);
} catch (GPClientException ex) {
//
}
{
"id": 3000006542,
"result": "FINISHED"
}
{id}
/captureThe functionality enables partial charging of pre-authorized funds previously created by preauthorized payment. The rest of blocked amount is unblocked back to customer’s payment card.
Required amount of capture must not has to be bigger then the original amount of pre-authorized payment.
Additional information about pre-authorized payments you can find in the Help Center.
ⓘ To activate partial charge of pre-authorized payments functionality, please, contact technical support GoPay.
Path variables
Pre-Authorized payment ID
Request headers
Always application/json
Always application/json
String “Bearer” followed by the access token
Request body
Payment amount in cents
Details of the payment items
Responses
Body
Payment ID
Result of the operation
POST /api/payments/payment/3000006542/capture HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
{
"amount": 119990,
"items": [
{
"type": "ITEM",
"name": "Obuv",
"amount": 119990,
"count": 1,
"vat_rate": "15",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
]
}
curl -X POST "/api/payments/payment/3000006542/capture" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-d '{
"amount": 119990,
"items": [
{
"type": "ITEM",
"name": "Obuv",
"amount": 119990,
"count": 1,
"vat_rate": "15",
"ean": 1234567890123,
"product_url": "https://www.eshop.cz/boty/lodicky"
}
]
}'
...
response = api.capture_authorization_partial(3000006542,
{
"amount": 1500,
'items': [
{'name': 'item01', 'amount': 500},
{'name': 'item02', 'amount': 1000},
],
})
{
"id": 3000006542,
"result": "FINISHED"
}
{id}
/void-authorizationReleases the pre-authorization funds of the previously created preauthorized payment.
Additional information about pre-authorized payments you can find in the Help Center.
Path variables
Pre-authorized payment ID
Request headers
Always application/json
Always application/x-www-form-urlencoded
String “Bearer” followed by the access token
Responses
Body
Payment ID
Result of the operation
POST /api/payments/payment/3000006542/void-authorization HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
curl -X POST "/api/payments/payment/3000006542/void-authorization" \
-H "Accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969"
<?php
$response = $gopay->voidAuthorization(3000006542);
response = api.void_authorization(3000006542)
try {
var result = connector.VoidAuthorization(<ID>);
} catch (GPClientException ex) {
//
}
try {
PaymentResult voidAuthorization = connector.voidAuthorization(<ID>);
} catch (GPClientException ex) {
for (ErrorElement err : e.getError().getErrorMessages()) {
int code = err.getErrorCode();
String message = err.getMessage();
String field = err.getField();
}
}
{
"id": 3000006542,
"result": "FINISHED"
}
You can make additional operations with payment methods, e.g. get a list of allowed payment methods that you can offer to your customers in e-shop’s shopping cart.
ⓘ You can find recommended payment method selection in our Help Center.
{goid}
/payment-instruments/{currency}
{goid}
/payment-instruments/{currency}
The method returns the JSON
structure of all allowed payment methods on the eshop profile. In the URL of the request it is necessary to pass the GoID
of the requested e-shop and the currency code.
Path variables
Request headers
Always application/json
String “Bearer” followed by the access token
Responses
Body
Descriptions of groups of payment methods
List of allowed payment methods for the given currency on the e-shop, their labels and logos
GET /api/eshops/eshop/8123456789/payment-instruments/CZK HTTP/1.1
Accept: application/json
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
curl -X GET "/api/eshops/eshop/8123456789/payment-instruments/CZK" \
-H "Accept: application/json" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969"
...
...
{
"groups":{
"card-payment":{
"label":{
"cs":"Platební karta"}
},
"bank-transfer":{
"label":{
"cs":"Rychlý bankovní převod"}
},
"wallet":{
"label":{
"cs":"Elektronické peněženky"}
},
"others":{
"label":{
"cs":"Ostatní"}
}
},
"enabledPaymentInstruments":[{
"paymentInstrument":"PAYMENT_CARD",
"label":{
"cs":"Platební karta"
},
"image":{
"normal":"https://gate.gopay.cz/images/checkout/payment_card.png",
"large":"https://gate.gopay.cz/images/checkout/payment_card@2x.png"},
"group":"card-payment",
"enabledSwifts":null
},
{"paymentInstrument":"BANK_ACCOUNT",
"label":{
"cs":"Rychlý bankovní převod"},
"image":{
"normal":"https://gate.gopay.cz/images/checkout/bank_account.png",
"large":"https://gate.gopay.cz/images/checkout/bank_account@2x.png"},
"group":"bank-transfer",
"enabledSwifts":[{
"swift":"GIBACZPX",
"label":{"cs":"Platba 24"},
"image":{
"normal":"https://gate.gopay.cz/images/checkout/GIBACZPX.png",
"large":"https://gate.gopay.cz/images/checkout/GIBACZPX@2x.png"},
"isOnline":true},
...]},
]}
To invoke the payment gateway, it is possible to use the HTML form, which will use Javascript to initialize the payment gateway.
You can find a detailed description of all the steps required to call up the payment gateway in our Help Center.
Inline payment gateway is initiated directly above the point of sale, there is no redirection.
URL (action) form set according to gw_url
from creation of the payment.
ⓘ The inline payment gateway in points of sale is available only with SSL certificate support (run on HTTPS). In points of sale that don´t have SSL certificate support is automatically performed redirect option described bellow.
Formulář pro vyvolání Inline platební brány
<form action="https://gw.sandbox.gopay.com/gw/v3/dfgvmwTKK5hrJx2aGG8ZnFyBJhAvF" method="post" id="gopay-payment-button">
<button name="pay" type="submit">Zaplatit</button>
<script type="text/javascript" src="https://gw.sandbox.gopay.com/gp-gw/js/embed.js"></script>
</form>
The payment gateway can also be operated in the option with Redirect. You can use the form below or redirect to the URL (gw_url) obtained during creation of the payment.
Formulář pro přesměrování na Redirect platební bránu
<form action="https://gw.sandbox.gopay.com/gw/v3/dfgvmwTKK5hrJx2aGG8ZnFyBJhAvF" method="post">
<button name="pay" type="submit">Zaplatit</button>
</form>
GoPay merchant account is a basic tool to view and check all your payments within the GoPay payment system. REST API functions allow you to e.g. generate movement statement from GoPay merchant account.
The funcionality generates statements from GoPay business account. It returns content of account statement file. More information about file types specification you can find in Help Center.
Request headers
Always application/json
Always application/json
String “Bearer” followed by the access token
Request body
Statement start date
Statement end date
Unique identifier of an e-shop in the payment gateway system
Specifies the currency, format corresponds to ISO 4217
Specifies format type of generated statement
Responses
As the body of the response, the contents of the listing are returned as application / octet-stream
POST /api/accounts/account-statement HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969
{
"date_from": "2020-07-08",
"date_to": "2020-08-08",
"goid": 8123456789,
"currency": "CZK",
"format": "CSV_A"
}
curl -X POST "/api/accounts/account-statement" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer AAArt6RuTM69kX6UUGZ6p9hyMPrTUVXmMDdkC4BNnQvQcbNyUTvQtCv45R969" \
-d '{
"date_from": "2020-07-08",
"date_to": "2020-08-08",
"goid": 8123456789,
"currency": "CZK",
"format": "CSV_A"
}'
Identification of the payee
always ACCOUNT
Unique identifier of an e-shop in the payment gateway system
Payment item
Type of row, for registration of sales
Product name
Total price of items in cents
Number of items
VAT rate
EAN code of the product
URL address of the product
Customer´s information
First name
Last name
Valid e-mail
Phone number with country code
City
Street
Postal code
Country code ISO 3166-1 alpha-3
An object describing customer information and setting payment methods for a given payment. The payment_card
andbank_account
objects are returned in the payment status check if the client has paid for this method. The verify_pin
andallowed_card_token
parameters are used only for identification payment.
The email
parameter directly in thepayer
object is returned only for the GOPAY
payment method and it is the e-mail of the used wallet.
Array of allowed payment methods
["PAYMENT_CARD","BANK_ACCOUNT"]
Preferred payment method
Array of allowed bank codes
["FIOBCZPP","BREXCZPP"]
Preferred bank if default_payment_instrument is set to BANK_ACCOUNT, set by SWIFT code
Customer´s data
Bank account´s information
Payment card´s information
PIN for identification payment purposes
Token for identification payment purposes
Email of used GoPay wallet (only for GOPAY
payment method)
Definition of callback and notification URL
URL address for return to e-shop (with protocol)
URL address for sending asynchronous notification in the case of changes in the payment status (with protocol)
An object that describes credit card information. Read-only, returned in payment status query if customer paid by card. The card_token
and3ds_result
parameters are passed only for the status check identification payments
Masked payment card´s number
Expiration date
Payment card´s type
Country code of issuing bank
Issuing bank
Token for identification payment purposes
3D Secure authorization’s result for identification payment purposes
Payer’s bank account details. Read-only, returned in payment status check if client paid by account. IBAN and SWIFT are transferred only for payments outside the Czechia and Slovakia.
International bank account number
Business identification code (SWIFT)
Bank account prefix
Bank account number
Bank account code
Bank account holder name
Account token of a saved account for PSD2 payments
Additional parameters of the payment
Parameter name
Value of optional parameter
An object describing a recurring payment. The recurrence_period
parameter is not passed for recurring ON_DEMAND payment. The recurrence_state
parameter is returned in the payment status check.
Time period of recurring
Recurring period of recurring payment
The period of validity recurring payment
Describes state of recurring payment
Objekt popisující předautorizaci platby
Whether the pre-authorization was established
Payment pre-authorization status
Names of payment method groups
Payment method
Payment method name in Czech
Names of payment method groups
Payment card payments
Bank transfers
E-wallet payments
Other payment methods
Popisuje povolené swifty pro bankovní převody.
Bank logos
Large icon URL
Normal icon URL
State that symbolise if bank supports online bank transfers
Object that contains localised name of bank
Czech description
SWIFT code
Name of every object coresponds to payment method codes
A series of objects describing each allowed SWIFTs (for bank transfers only)
Which group does the payment method belong to
Payment methods icons
Large icon URL
Normal icon URL
Payment method name
Czech label
Designation of the payment method within the API
List of available currencies
Czech koruna
Euro
Polish złoty
United States dollar
Pound sterling
Hungarian forint
Romanian lei
Bulgarian lev
Croatian kuna
List of available payment methods
Payment card
Bank account
Google Pay
Apple Pay
GoPay wallet
PayPal wallet
mPlatba (mobile payment)
Premium SMS
PaySafeCard coupon
Bitcoin wallet
Click to Pay
List of available SWIFT/BIC codes.
Česká Spořitelna
Komerční Banka
Raiffeisenbank
FIO Banka
UniCredit Bank
mBank
ČSOB
Moneta Money Bank
AirBank
EQUA Bank
ING Bank
Max banka
J&T Banka
OberBank AG
Všeobecná Úvěrová Banka - pobočka Praha
Hello! Bank
Tatra Banka
Všeobecná Úverová Banka
UniCredit Bank SK
Slovenská Sporiteľňa
Poštová Banka
OTP Banka
Prima Banka
Citibank Europe
FIO Banka SK
ING Wholesale Banking SK
mBank SK
J&T Banka SK
OberBank AG SK
Privatbanka
BKS Bank AG SK
Getin Bank
Nest Bank
Volkswagen Bank
Citi handlowy
Santander
Millenium Bank
Bank Ochrony Srodowiska
Pekao Bank
BNP Paribas
OWSZECHNA KASA OSZCZEDNOSCI BANK POLSK
Credit Agricole Banka Polska
Noble Bank
BPS/Bank Nowy BFG
mBank PL
ING Bank PL
Alior
IdeaBank
Pocztowy24
Plus Bank
Toyota Bank
List of possible payment states
Payment created
Payment has already been paid
Payment declined
Payment method confirmed
The payment has expired
Payment pre-authorized
Payment refunded
Payment partially refunded
List of payment bases
We are waiting for an online payment.
We are waiting for an offline payment.
Bank payment confirmed by advice.
Bank payment confirmed by statement.
Bank payment was not confirmed.
Approved with zero amount
Rejection of the payment in the authorization center of the customer’s bank due to reaching the limits on the payment card.
Refusal of payment in the authorization center of the customer’s bank due to problems on the part of the payment card issuer.
Rejection of the payment in the authorization center of the customer’s bank due to a problem on the part of the payment card issuer.
Rejection of the payment in the authorization center of the customer’s bank due to a blocked payment card.
Refusal of payment in the authorization center of the customer’s bank due to lack of funds on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to the expired payment card.
Rejection of payment in the authorization center of the customer’s bank due to rejection of the CVV/CVC code.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of payment in the customer’s 3D Secure bank system.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Rejection of the payment in the authorization center of the customer’s bank due to problems on the payment card.
Unknown configuration
Rejection of the payment in the authorization center of the customer’s bank due to reaching the set limits on the payment card.
There was a technical problem associated with the customer’s bank authorization center.
Payment was not made.
Payment was not made.
Payment was not made. Payment details were not entered within the time limit on the payment gateway.
Payment was not made. The specific reason for rejection is communicated directly to the customer.
Payment was not made. The sum of the credited amounts exceeded the amount paid.
Payment was not made. The user is not authorized to perform the operation.
Payment was not made. The amount to be paid exceeded the authorized amount.
Payment has not been made yet.
The payment was not made due to a re-entry.
There was a technical problem with the payment on the part of the bank.
SMS could not be delivered.
The payment card is issued in a region where card payments are not supported.
The credit card holder canceled the payment.
The payment was declined at the customer’s bank authorization center due to a blocked credit card.
Duplicate reversal transactions
Duplicate transactions
Bank payment declined.
Payment canceled by user.
SMS has been sent. It has not yet been delivered.
Payment received. Payment will be credited after processing on Bitcoin.
The payment was not paid in full.
Payment was made overdue.
Customer has not given consent for PSD2 payment.
Types of payment possible items
Product/service
Delivery
Discount
Scope of token rights
Allows you to create payments only
Allows you to perform all operations
Payment gateway interface language
Czech
Slovak
English
German
Russian
Polish
Hungarian
Romanian
Bulgarian
Croatian
Italian
French
Spanish
Ukrainian
Lithuanian
Latvian
Slovenian
Estonian
Portugalština
Description of the result of the operation
Request accepted
Operation performed
The operation ended in error
Recurring payment cycle
Daily recurrence period
Weekly recurrence period
Monthly recurrence period
Recurring payment on demand
Describes the recurrence status of the payment
Recurring payment created, waiting for authorization of initial payment
Payment recurrence active
Payment recurring canceled
Describes the status of payment pre-authorization.
Pre-authorization created
Pre-authorized
Pre-authorion captured
Pre-authorization canceled
Format of the generated statement
CSV type A
CSV type B
CSV type C
CSV type D
XLS type A
XLS type B
XLS type C
ABO edit format (.gpc)
ABO internal format (.gpc)
Result of 3D Secure authorization
The payment card does not support 3D Secure authentication
Full 3D Secure authentication
Partial 3D Secure authentication
3D Secure authentication was not performed
Code list of payment method groups.
Card payments
Bank transfers
E-wallets
Other methods
Object describing the error
Error range
Which parameter is affected by the error, unless it is a global error
Localized message. Localization based on Accept-Language in the header. It is set to en-US by default.
Technical description of the error
Numeric designation of the error type
Code designation of the error type
Description of the extent of the error
The error concerns a specific parameter
Global error
Error codes describing the reason for the error
System Error
Compulsory
Wrong value
Already exists
Cannot be changed
Cannot delete
Ambiguous
Invalid request
Unauthorized access
The method of assigning rights is not supported
Wrong access data
PIN access has been disabled
Unable to create payment
Payment cannot be made
Payment in wrong condition
Payment not found
E-shop has been deactivated
Payee not found
The payee cannot accept the payment
Payment cannot be refunded
Payment cannot be refunded
Wrong amount
Lack of money in the account
Recurring payment failed
Recurring payment is not supported
Payment recurrence stopped
Time limit for recurring payments exceeded
Recurring payments are not enabled
Payment hold failed
Payment has already been canceled
Revocation revocation failed
Pre-authorization canceled
The sum of the amounts of the order items does not match the payment amount
Account not found