Init
https://{Environment}.payture.com/vwapi/InitThe command initializes a one-step payment, a two-step payment, or the add-card process. The request creates a session and prepares for redirecting the Customer to the Payture payment gateway page to enter bank card details.
Request
curl https://sandbox3.payture.com/vwapi/Init \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d VWID=Merchant \
--data-urlencode "DATA= \
SessionType=Pay; \
VWUserLgn=123@ya.ru; \
VWUserPsw=2645363; \
OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea; \
Amount=12480; \
Product=Ticket; \
Total=124.8; \
Description=MyTestTransaction; \
PhoneNumber=79156783333; \
Url=https://payture.com/result?orderid={orderid}&result={success}; \
AdditionalField1=Value1; \
AdditionalField2=Value2" \Parameter names in requests are case-sensitive
| Parameter | Description | Format |
|---|---|---|
| VWID | Payment terminal name Provided with the test/production access credentials | String Mandatory |
| DATA | Payment parameters A URL-encoded string containing key-value pairs separated by “;” (semicolon). Keys and values are separated by “=” (equals sign) | String Mandatory |
DATA parameter keys
The
{success}and{orderid}parameters must be specified in lowercase.
| Parameter | Description | Format |
|---|---|---|
| SessionType | Payment type. Determines the number of payment steps:Add — card registrationPay — one-step paymentBlock — two-step payment | String Mandatory |
| VWUserLgn | Customer identifier in the Payture system | String [1..50] Mandatory |
| VWUserPsw | Additional access parameter for the Customer's private information (Customer password) | String [1..50] Mandatory |
| OrderId | Unique payment ID in the Merchant's system Required if “SessionType=Pay” or “SessionType=Block” Recommended format: GUID/UUID or alphanumeric. Other formats may cause failures in banking services | String [1..50] Optional |
| Amount | Payment amount in kopecks (or another minor unit of the terminal currency) Required if “SessionType=Pay” or “SessionType=Block” | Integer Optional |
| Url | Customer return URL after the payment. The Success and OrderId parameters can additionally be passed in the return URLIn general, the return URL can be configured for the payment terminal via Payture support, in which case it need not be passed | String Optional |
| CardId | Identifier of the Customer's registered card with the “IsActive” status that will be selected by default on the payment page Can be passed if “SessionType=Pay” or “SessionType=Block” | String [36] Optional |
| Product | Name of the purchase being paid for, shown to the Customer on the payment page | String [1..50] Optional |
| Total | Order amount shown to the Customer on the payment page Use this field if you want to change the default amount format | String [1..50] Optional |
| TemplateTag | Name of the payment page template to use Must be passed if the Merchant uses multiple templates. If the parameter is not passed, the template named “Default” is used. Learn more about payment page templates | String [1..50] Optional |
| Language | Payment page template language Must be passed if the template uses multiple languages. If the parameter is not passed, the language of the “Default” template is used. Learn more about payment page templates | String [1..50] Optional |
| PhoneNumber | Customer phone number Digits only, no separators. Format: [country code][operator code][subscriber number] | String Optional |
| Customer email Can be passed if it is not used as VWUserLgn | String [1..50] Optional | |
| Description | Additional payment description | String Optional |
| IP | Customer IP address IPv4 or IPv6 | String Optional |
| Cheque | Receipt information in JSON format, Base64-encoded | String Optional |
| Additional parameters | Any additional Merchant parameters There can be several additional parameters. Each parameter is passed separately | — Optional |
The set of required parameters may vary. Contact Payture support for details.
Example of the DATA parameter (decoded):
SessionType=Pay;
VWUserLgn=123@ya.ru;
VWUserPsw=2645363;
OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea;
Amount=12480;
Product=Ticket;
Total=124.8;
Description=MyTestTransaction;
PhoneNumber=79156783333;
Url=https://payture.com/result?orderid={orderid}&result={success};
AdditionalField1=Value1;
AdditionalField2=Value2Example of the Url parameter (return URL):
https://server.com/result?orderid={orderid}&result={success}Response
An XML string with the Init element
Response examples
<Init Success="True" OrderId="5f63838d-fb03-00c6-c890-c67cfc1c54ea" Amount="12480" SessionLifeTime="60" AttemptsCount="5" SessionId="c8cc6c5c-30da-d7e1-e090-46f25ae30626" SessionType="Block"/>| Parameter | Description | Format |
|---|---|---|
| Success | Operation success flag. Possible values:True — the operation succeededFalse — the operation failed | String Mandatory |
| OrderId | Payment ID in the Merchant's system Returned if “Success=True” and “SessionType=Pay” (Block). Matches the value passed in the request | String [1..50] Optional |
| Amount | Payment amount in kopecks (or another minor unit of the terminal currency) Returned if “Success=True”. Equals “0” if “SessionType=Add” | Integer Optional |
| SessionLifeTime | Payment session lifetime from the moment it is received in the Init response (in minutes) Returned if “Success=True”. 60 minutes by default. The value can be changed via Payture support | Integer Optional |
| AttemptsCount | Number of payment attempts the Customer will have on the payment page within the current session Returned if “Success=True”. 5 attempts by default. The number can be changed via Payture support | Integer Optional |
| SessionId | Payment session identifier in the Payture system Returned if “Success=True” | String [36] Optional |
| ErrCode | Error code. See error codes Returned if “Success=False” | String Optional |
GetList
The GetList command retrieves the list of the Customer's payment cards registered in the Payture system. GetList does not return removed cards or expired cards.
Pay — Payture side
The command opens the payment page on the Payture payment gateway side. It is sent after a successful Init payment initialization command.
