We have a preconfigured collection in POSTMAN to speed up the understanding of the basic operation of the API, in this section you will find how to configure this test environment that will allow you to initialize payment attempts for your merchant.
<aside> <img src="/icons/info-alternate_blue.svg" alt="/icons/info-alternate_blue.svg" width="40px" /> In order to make use of the collection you need to have access to POSTMAN either in its application format or website, you can access this service at postman.com
</aside>
Import the POSTMAN collection using this linkđź”—.
Declare the collection variables provided by the ETpay integration team.
Assign in  CURRENT VALUE
the variables without considering “session_token”
Make a call with pre-configured test data.
Observe the request response.
Note that in this quick start section we will only use the token, but consider that the signature token is extremely important and of mandatory use for the transition to production.
Use the URL in the result “TEST”.
<aside> ⚠️ The QR_URL contains the URL of the payment attempt in QR format, this is so you can more easily test the payment system from a smartphone, however, it uses an external API to transform the URL into QR. We recommend to use it only for testing purposes
</aside>
Replicate call in your programming language.
The following Python code executes the POST request described above, and with the session_token obtained redirects to the url that initiates the client's session.
import requests
import webbrowser
'''
Simple API request,
which redirects to the payment page.
'''
#Global variables provided by ETpay
API_URL = r'valid_url'
PTM_URL = r'valid_url'
INIT_API = r'/session/initialize'
MERCHANT_CODE = "valid_code"
MERCHANT_API_TOKEN = "valid_api_key"
request_data = {
"merchant_code": MERCHANT_CODE,
"merchant_api_token": MERCHANT_API_TOKEN,
"merchant_order_id": "order-1992", #id of the retailer's own purchase order
"order_amount" : 1,
}
#Getting session token
resp = requests.post(API_URL+INIT_API, json=request_data)
token = resp.json()['token']
#Client session is launched
webbrowser.open(PTM_URL+'/hites/'+token)
'''Note that in this code the value of the signature_token is not stored. Its usefulness will be explained in detail later, but it should be noted that it is necessary to obtain its value.'''