Skip to main content

Configuration and Management of the Payment Gateway

This document serves as a comprehensive guide for the automated management and configuration of Comgate payment gateways via the API interface.


1. Purpose and Target Audience

The /v2.0/config endpoint is an advanced interface designed, for example, for "Developer" type partners (SaaS platforms, e-shop solutions) who manage a large portfolio of client e-shops. It allows for programmatic (bulk) configuration of payment gateway parameters without the need for manual settings in the Comgate client portal. This ensures branding consistency and automates the onboarding of new clients.

2. Authentication Process (Auth Flow)

Access to the endpoint is obtained in several steps to ensure maximum security:

  1. Developer Credentials: The partner receives their primary identification credentials—developer and secret—upon signing the contract.
  2. Obtaining the Merchant List: The partner calls the /v2.0/merchants endpoint using their credentials.
  • Output: A JSON list of all e-shops under their management, containing the merchant_id, a unique merchant_secret, and other information for each store.
  1. Configuration: The partner then uses the specific combination of the Merchant ID and its Merchant Secret in the request body for the /v2.0/config endpoint.
Warning

Note: To use the /merchants endpoint, you need to contact our customer support, which will generate the necessary access credentials (developer and secret) for the developer and activate the appropriate permissions.


3. Key parameters and functions of the /v2.0/merchants endpoint

This endpoint is the first step for any automation. It is used to retrieve the current list of all stores under the partner's management.

Parameter overview:

ParameterMeaningFormat / Example
developerDeveloper IDdeveloper1234
secretDeveloper passwordM3hZVScYZKq9t...

Implementation example:

// Request
$I->sendGet("https://payments.comgate.cz/v2.0/merchants",
[
'developer' => 'your_developer_id',
'secret' => 'your_developer_secret'
]);

Response parameter overview:

ParameterMeaningFormat / Example
merchantID of the specific store123456
secretSecret key of the given store (for further configuration)M3hZVScYZKq9t...
allowed_payment_creation_methodPermitted methods for creating a payment for the given storeREST/POST
shopE-shop nameeshop.cz
urlE-shop URLhttps://eshop.cz/
contract_statusCurrent contract statusAKTIVNI
store_in_productionIdentification of whether the store is already in productiontrue / false
reported_to_card_schemesInformation on whether the store has been reported to card associations (Visa/Mastercard)true / false
currenciesList of supported currencies for the given storeArray of currencies (e.g., ["CZK", "EUR"])
ip_addressesList of allowed IP addresses for API communicationArray of IP addresses (e.g., ["185.123.45.67", "185.123.45.68"])
  • The allowed_payment_creation_method parameter can take the following values:
    • REST/POST – The store can create payments using REST API or HTTP POST.
    • SOAP – The store can create payments using SOAP API.
    • REDIRECT – The store can only create payments by redirecting the customer to the payment gateway (without API).
  • The contract_status parameter can take the following values:
    • ZALOZENA – A newly created contract where certain requirements are still being finalized.
    • AKTIVNI – All requirements are met and the contract can be activated. It is necessary to monitor the reported_to_card_schemes and store_in_production parameters, as activation may be delayed if the e-shop is not fully compliant with the service activation terms (e.g., missing Terms and Conditions).
    • UKONCENA - The contract was terminated.
  • The store_in_production parameter can take the following values:
    • true – The store is already active in production.
    • false – Waiting for the store to be switched to production status.
  • The reported_to_card_schemes parameter can take the following values:
    • true – The store has been reported to payment associations.
    • false – Waiting for the store to be reported to payment associations.
Warning

Note: The parameters povoleny_zpusob_zalozeni_platby, stav_smlouvy, obchod_v_produkci, and ohlaseno will no longer be returned in the API response as of July 31, 2026. These parameters have been replaced by their equivalents: allowed_payment_creation_method, contract_status, store_in_production, and reported_to_card_schemes.

// Response
{
"0": {
"merchant": "123456",
"secret": "M3hZVScYZKq9t...",
"allowed_payment_creation_method": "REST/POST",
"shop": "eshop.cz",
"url": "https://eshop.cz/",
"contract_status": "AKTIVNI",
"store_in_production": true,
"reported_to_card_schemes": true,
"currencies": [
"CZK",
"EUR"
],
"ip_addresses": [
"185.123.45.67",
"185.123.45.68"
]
},
"code": 0,
"message": "OK"
}

4. Key parameters and functions of the /v2.0/config endpoint

Within the call, you can define the visual style, notification logic, and security rules.

Parameter overview:

ParameterMeaningFormat / Example
merchantID of the specific store being configured123456
secretSecret key of the given store (obtained via /v2.0/merchants)M3hZVScYZKq9t...
gateway_logoE-shop logo displayed on the gatewayBase64 string
gateway_backgroundBackground image displayed on the gatewayBase64 string
gateway_color_pageMain background color of the gatewayHEX code (e.g., #C2E7FF)
gateway_color_headerGateway header colorHEX code (e.g., #f2c7af)
gateway_signatureText displayed in the gateway footerPowered by Platform XY
url_paidRedirect URL after a successful paymenthttps://eshop.cz/success
url_cancelledRedirect URL after a cancelled paymenthttps://eshop.cz/cancelled
url_pendingRedirect URL for a pending paymenthttps://eshop.cz/pending
url_pushURL for sending automatic payment notificationshttps://eshop.cz/push.php
ip_addressesList of allowed IP addresses for API communicationArray of IP addresses
activeUsed to deactivate the connectionnull / false
  • The ip_addresses parameter allows you to define permitted IP addresses.
    • A value of {} removes all IP addresses (blocking access).
    • A value of null keeps the original IP addresses.
    • A specific IP address or a list of IP addresses replaces the previous settings with the new range of IP addresses.

5. Security and IP Whitelisting

Securing the communication between the platform and the payment gateway is based on IP address whitelisting.

Setup Workflow:

  1. Initiation: To enable store configuration via the API, the specific store must have its allowed IP range temporarily set to 0.0.0.0/0 (i.e., access allowed from anywhere). This allows the platform to perform the initial calls necessary to create and set up the connection.
  2. Securing: Immediately after activation, it is the developer's responsibility to send a request to /v2.0/config and define the specific IP addresses of their servers in the ip_addresses field.
  3. Lockdown: Once the whitelist is configured, the gateway will reject any request from an unauthorized address, thereby eliminating the risk of an attack.

6. Configuration Example

$I->sendPost("https://payments.comgate.cz/v2.0/config",
[
'gateway_logo' => 'base64_encoded_image',
'gateway_color_page' => '#C2E7FF',
'gateway_signature' => 'Powered by Platform XY',
'url_paid' => 'https://eshop.cz/success',
'url_push' => 'https://eshop.cz/push.php',
'ip_addresses' => ['185.123.45.67', '185.123.45.68'],
]);