RU

Init

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

The command that initializes a one-step or two-step payment. Processing the request creates a payment session and prepares the Customer to be redirected to the Payture payment gateway page to enter their card details.

Request

curl https://sandbox3.payture.com/apim/Init \
  -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d Key=Merchant \
  --data-urlencode "Data=SessionType=Pay;OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea;Amount=12480;Product=Ticket;Total=124.8;Phone=79156783333;Description=MyTestTransaction;Url=https://payture.com/result?orderid={orderid}&result={success};AdditionalField1=Value1;AdditionalField2=Value2"
Get link

Parameter names in requests are case-sensitive

ParameterDescriptionFormat
KeyPayment terminal name
Provided with the test/production access credentials
String
Mandatory
DataPayment parameters
URL-encoded string of key-value pairs separated by “;” (semicolon). Keys and values are separated by “=” (equals sign)
String
Mandatory

Data parameter structure

The {success} and {orderid} parameters must be specified in lowercase.

ParameterDescriptionFormat
SessionTypePayment type. Defines the number of payment stages:
Pay — one-step payment
Block — two-step payment
String
Mandatory
OrderIdUnique payment ID in the Merchant's system
Recommended format: GUID/UUID or alphanumeric. Other formats may cause failures in banking services
String [1..50]
Mandatory
AmountPayment amount in kopecks (or another minor unit of the terminal currency)
Digits only, without decimal or other separators
Integer
Mandatory
UrlURL the Customer is returned to after completing the payment on the Payture side. The Success and OrderId parameters can also be passed in the return URL
Generally, the return URL can be configured for the payment terminal via Payture support, in which case it does not need to be passed
String
Optional
ProductName of the purchase being paid for, displayed to the Customer on the payment pageString [1..50]
Optional
TotalOrder amount displayed 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
Required if the Merchant uses several 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
Required if the template uses several languages. If the parameter is not passed, the “Default” template language is used. Learn more about payment page templates
String [1..50]
Optional
PhoneCustomer's phone number
Digits only, without separators. Format: [country code][carrier code][subscriber number]
String
Optional
DescriptionAdditional payment descriptionString
Optional
IPCustomer's IP address
IPv4 or IPv6
String
Optional
ChequeFiscal receipt data 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;
OrderId=5f63838d-fb03-00c6-c890-c67cfc1c54ea;
Amount=12480;
Total=124.8;
Product=Ticket;
Phone=79156783333;
Description=MyTestTransaction;
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

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"/>
ParameterDescriptionFormat
SuccessOperation success flag. Possible values:
True — the operation succeeded
False — the operation failed
String
Mandatory
OrderIdPayment ID in the Merchant's system
Matches the value passed in the request
String [1..50]
Mandatory
AmountPayment amount in kopecks (or another minor unit of the terminal currency)
Returned if “Success=True”. Matches the value passed in the request
Integer
Optional
SessionLifeTimePayment session lifetime from the moment it is received in the Init response (in minutes)
Returned if “Success=True”. The default is 60 minutes. The value can be changed via Payture support
Integer
Optional
AttemptsCountNumber of payment attempts available to the Customer on the payment page within the current session
Returned if “Success=True”. The default is 5 attempts. The number can be changed via Payture support
Integer
Optional
SessionIdPayment session ID in the Payture system
Returned if “Success=True”
String [36]
Optional
ErrCodeError code. See error codes
Returned if “Success=False”
String
Optional