RU

Init

https://{Environment}.payture.com/vwapi/Init

The 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" \
Get link

Parameter names in requests are case-sensitive

ParameterDescriptionFormat
VWIDPayment terminal name
Provided with the test/production access credentials
String
Mandatory
DATAPayment 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.

ParameterDescriptionFormat
SessionTypePayment type. Determines the number of payment steps:
Add — card registration
Pay — one-step payment
Block — two-step payment
String
Mandatory
VWUserLgnCustomer identifier in the Payture systemString [1..50]
Mandatory
VWUserPswAdditional access parameter for the Customer's private information (Customer password)String [1..50]
Mandatory
OrderIdUnique 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
AmountPayment amount in kopecks (or another minor unit of the terminal currency)
Required if “SessionType=Pay” or “SessionType=Block”
Integer
Optional
UrlCustomer return URL after the payment. The Success and OrderId parameters can additionally be passed in the return URL
In general, the return URL can be configured for the payment terminal via Payture support, in which case it need not be passed
String
Optional
CardIdIdentifier 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
ProductName of the purchase being paid for, shown to the Customer on the payment pageString [1..50]
Optional
TotalOrder 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
TemplateTagName 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
LanguagePayment 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
PhoneNumberCustomer phone number
Digits only, no separators. Format: [country code][operator code][subscriber number]
String
Optional
EmailCustomer email
Can be passed if it is not used as VWUserLgn
String [1..50]
Optional
DescriptionAdditional payment descriptionString
Optional
IPCustomer IP address
IPv4 or IPv6
String
Optional
ChequeReceipt information in JSON format, Base64-encodedString
Optional
Additional parametersAny 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=Value2

Example 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"/>
ParameterDescriptionFormat
SuccessOperation success flag. Possible values:
True — the operation succeeded
False — the operation failed
String
Mandatory
OrderIdPayment 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
AmountPayment amount in kopecks (or another minor unit of the terminal currency)
Returned if “Success=True”. Equals “0” if “SessionType=Add”
Integer
Optional
SessionLifeTimePayment 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
AttemptsCountNumber 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
SessionIdPayment session identifier in the Payture system
Returned if “Success=True”
String [36]
Optional
ErrCodeError code. See error codes
Returned if “Success=False”
String
Optional