Skip to content

Partners

digilife

DIGILIFE

ultraweb

ULTRAWEB

API

Introduction

Description

PAYSTO API is a software complex for managing multichannel trading infrastructure.

tip

PAYSTO API is fully compatible with Authorize.net Secure Hosted Payment Form API, which allows you to set up integration of any web resource without significant costs and in a short time.

Purpose

PAYSTO API allows you to automate payment acceptance and online order processing in Russia.

Terms and Concepts

TermDescription
RecipientThe client for whose benefit funds are credited
PayerThe person making the payment
ShopThe Recipient's information system. For example, the Payer's cart on the Recipient's website and the Recipient's billing system.

Simplified Payment Scheme

Solid lines – mandatory Dotted lines – optional.

Steps for Successful Payment

  1. Payment request;
  2. Verification of goods in the PAYSTO catalog;
  3. Payer redirection for payment;
  4. Payment status;
  5. Fiscal receipt generation;
  6. Payment status;
  7. Buyer return to Provider's website;
  8. Payment status request;
  9. Payment status.

Data Types

NameDescriptionValue Range
IntegerIntegerFrom 0 to 2147483647
Long IntegerLong IntegerFrom 0 to 4294967296
MonetaryReal, integer and fractional part separator is "." (dot), no digit separator, fractional part with accuracy to two decimal places. The presence of a dot and two digits after it is mandatory. For example, 10 must be written as 10.00, 10.123 must be written as 11.12 or 11.13from 0.01 to 1000000.00
StringString. Cannot contain the symbol "=" (equals) and the symbol "&" (ampersand).The length is defined separately for each parameter.
DatetimeCoordinated Universal Time (UTC). Presented in yyyymmddhhnn format where y – digits for the year, m – month, d – day of month, h – hour (hh – number from 0 to 23) n – minutes. For example, January 15, 2010 17:04 201001151704From 201001010000 to 205012312359
MD5A string representing a 32-bit number in hexadecimal form and in lowercase (total 32 characters 0-9, A-F).

Security

Requests

The IP of the request source is checked. Signature (mandatory).

PAYSTO Responses

Check the SSL certificate of the responding server.

Responding Server Addresses

The IP address of the responding server is specified in PAYSTO LC > Parameters

Payment Requests

Request for Invoice Payment

This step initiates the procedure for paying an invoice issued in the Shop.

Address ElementValue
Protocolhttps
MethodPost
PathInformation is provided in PAYSTO LC > Parameters
EncodingUTF8

Parameters

NameDescriptionTypeMandatory
x_descriptionPayment commentStringYes
x_loginShop codeIntegerYes
x_amountAmount to be paidMonetaryYes
x_currency_codeCurrency of the amount to be paid. Can take values USD or RUBStringYes
x_cart_currencyCurrency of the shop's cart. Values: USD, EUR or other short currency name. Passed when the cart currency is different from rubles (RUB) for display on payment pages (the amount and currency of debit are taken from x_amount and x_currency_code values).StringNo
x_line_itemCart content for payment. A detailed description of the field value is provided in the table below.StringYes
x_emailBuyer's email addressStringNo
x_fp_sequenceTransaction number assigned by the shop. This can be an invoice number or any other random number.NumericYes
x_fp_timestampUTC time in seconds, starting from January 1, 1970NumericYes
x_fp_hashSignature generated using the HMAC-MD5 hashing algorithm with fields x*login, x_fp_sequence, x_fp_timestamp, x_amount and x_currency_code separated by ^ Signature ExamplesYes
x_invoice_numInvoice number in the shopNumericYes
x_first_nameBuyer's first nameStringNo
x_last_nameBuyer's last nameStringNo
x_addressBuyer's addressStringNo
x_cityBuyer's cityStringNo
x_stateBuyer's region/stateStringNo
x_countryBuyer's countryStringNo
x_ship_to_first_nameShipping contact's first nameStringNo
x_ship_to_last_nameShipping contact's last nameStringNo
x_phoneContact phoneStringNo
x_faxContact faxStringNo
x_cust_idBuyer's ID in the shopStringNo
x_ship_to_addressShipping addressStringNo
x_ship_to_stateShipping region/stateStringNo
x_ship_to_zipShipping address zip codeStringNo
x_ship_to_countryShipping countryStringNo
x_relay_responseThe string must have the value "TRUE"StringYes
x_relay_urlPayment notification URLStringYes
// Example string: "11111^789^67897654^10.50^USD"
// Example of signature generation:
Fingerprint = HMAC-MD5 ("11111^789^67897654^10.50^USD", "secret\*key")

The x_line_item field must contain one line from the user's shopping cart being paid for, consisting of several elements separated by the | delimiter. The number of fields passed must correspond to the number of items in the cart.

x_line_item field format

NameDescriptionMandatory
Item IDItem identifier. String up to 31 characters longYes
item nameItem name. String up to 31 characters longYes
item descriptionItem description. String up to 255 characters long.Yes
item quantityQuantity. Must be a positive number.Yes
item price (unit cost)Cost per unit of goods. Real, integer and fractional part separator is "." (dot), no digit separator, fractional part with accuracy to two decimal places. The presence of a dot and two digits after it is mandatory. For example, 10 must be written as 10.00, 10.123 must be written as 11.12 or 11.13Yes
item taxableIs the item subject to VAT. Possible values: TRUE, FALSE, T, F, YES, NO, Y, N, 1, 0No

Example of a cart being passed:

x_line_item=item1<|>golf balls<|><|>2<|>18.95<|>Y&
x_line_item=item2<|>golf bag<|>Wilson golf carry bag, red<|>1<|>39.99<|>Y&
x_line_item=item3<|>book<|>Golf for Dummies<|>1<|>21.99<|>Y&

Payment Details

This step notifies the Shop about the results of invoice payment.

warning

For this request, the shop must check:

  • The IP address from which the request originated;
  • The invoice number;
  • The payment amount;
  • The signature.

Failure to perform these checks can seriously weaken protection against fraudsters.

Address ElementValue
Protocolhttps
MethodPost
PathSpecified in x_relay_url when sending a payment request
EncodingUTF8

Parameters

NameDescriptionType
x*response_codePayment result 1 – paid 2 – declined 3 – errorInteger
x_trans_idPAYSTO payment numberLong Integer
x_invoice_numPayment number in the shopInteger
x_MD5_HashSignature generated using the MD5 hashing algorithm with a secret key and fields x_login, x_trans_id, x_amount Example string "secret*key111119876543211.00"MD5
x_amountPayment amountMonetary
x_cust_idValue is equal to the corresponding parameter in the payment requestString
x_first_nameValue is equal to the corresponding parameter in the payment requestString
x_last_nameValue is equal to the corresponding parameter in the payment requestString
x_addressValue is equal to the corresponding parameter in the payment requestString
x_cityValue is equal to the corresponding parameter in the payment requestString
x_stateValue is equal to the corresponding parameter in the payment requestString
x_zipValue is equal to the corresponding parameter in the payment requestString
x_countryValue is equal to the corresponding parameter in the payment requestString
x_phoneValue is equal to the corresponding parameter in the payment requestString
x_faxValue is equal to the corresponding parameter in the payment requestString
x_cust_idValue is equal to the corresponding parameter in the payment requestString
x_emailValue is equal to the corresponding parameter in the payment requestString
x_ship_to_first_nameValue is equal to the corresponding parameter in the payment requestString
x_ship_to_last_nameValue is equal to the corresponding parameter in the payment requestString
x_ship_to_addressValue is equal to the corresponding parameter in the payment requestString
x_ship_to_cityValue is equal to the corresponding parameter in the payment requestString
x_ship_to_stateValue is equal to the corresponding parameter in the payment requestString
x_ship_to_zipValue is equal to the corresponding parameter in the payment requestString
x_ship_to_countryValue is equal to the corresponding parameter in the payment requestString
Interpretation of HTTP CODE 200 responseInterpretation of no response, other HTTP CODE, Timeout
It is considered that the shop service received the notification.It is considered that the shop service is unavailable and cannot fulfill its obligations to the buyer. Funds received from the buyer will be blocked.

Returning the Buyer to the Shop

At this step, the Buyer returns to the Shop.

warning

The data of this request passes through the Buyer's computer and can be forged by an unscrupulous Buyer. Therefore, it is not recommended to set the status for the issued invoice on Success url and Fail Url pages. Use Result Url for this purpose.

tip

We recommend using the same page address for Success url and Fail Url, where based on the saved data when processing the Result url (or by re-querying the invoice status in PAYSTO), redirect the user to the final successful (unsuccessful) payment page.

It is important to understand that this step is performed from the Buyer's computer after some time has passed since the Buyer transitioned from the Shop to PAYSTO, so the Shop may need to authorize the Buyer to display private data.

Address ElementValue
Protocolhttps
MethodPost
PathSpecified during shop registration
EncodingUTF8

Parameters match those described in Payment Details

Payment Information

warning

For these requests, it is recommended to check the SSL certificate of the responding server to prevent DNS spoofing.

Statement for a Period

Address ElementValue
Protocolhttps
MethodGet
Pathhttps://paysto.com/api/Payment/GetList

Parameters

NameDescriptionTypeMandatory
FROMstart of the period (default – beginning of the current day).DatetimeYes
TOend of the period (default – current moment).DatetimeYes
PAYSTO_SHOP_IDShop IDIntegerYes
PAYSTO_REQUEST_NOSequential (common for all request types) IS request counter, each subsequent value must be greater than the previous one.Long IntegerNo
PAYSTO_MD5Signature of transmitted data. MD5 checksum.MD5Yes

Response Values

HTTP CODEComment
200CSV file in the format Datetime,PAYSTO_PAYMENT_ID,PAYSTO_INVOICE_ID,PAYSTO_SUM,accountSum,status, statusNote If there were no payments for the specified period – an empty file

Column Description

NameDescriptionType
DatetimeDate and time of application registration.Datetime
PAYSTO_PAYMENT_IDPAYSTO transaction numberLong Integer
PAYSTO_INVOICE_IDTransmitted invoice number in the shop.String up to 50 characters
PAYSTO_SUMApplication amount (the amount that was actually intended to be paid/already paid)Monetary
accountSumMovement on Client Account. Positive – balance increase, negative – balance decrease.Monetary
statusApplication status code.Application Status
statusNoteComment on status. For example, if the status is RES_ERROR – then the error description.String

Response Values

HTTP CODEComment
403Security conditions violated. Check transmitted parameters and settings.
404Shop not found

Payment Details

Address ElementValue
Protocolhttps
MethodGet
Pathhttps://paysto.com/api/Payment/GetByInvoiceId

Parameters

NameDescriptionTypeMandatory
PAYSTO_INVOICE_IDTransmitted invoice number in the shop.String up to 50 charactersYes
PAYSTO_SHOP_IDShop IDIntegerYes
PAYSTO_REQUEST_NOSequential (common for all request types) IS request counter, each subsequent value must be greater than the previous one.Long IntegerNo
PAYSTO_MD5Signature of transmitted data. MD5 checksum.MD5Yes

Response Values

HTTP CODEComment
200CSV file in the format Datetime,PAYSTO_PAYMENT_ID,PAYSTO_INVOICE_ID,PAYSTO_SUM,accountSum,status, statusNote

Column Description

NameDescriptionType
DatetimeDate and time of application registration.Datetime
PAYSTO_PAYMENT_IDPAYSTO transaction numberLong Integer
PAYSTO_INVOICE_IDTransmitted invoice number in the shop.String up to 50 characters
PAYSTO_SUMApplication amount (the amount that was actually intended to be paid/already paid)Monetary
accountSumMovement on Client Account. Positive – balance increase, negative – balance decrease.Monetary
statusApplication status code.Application Status
statusNoteComment on status. For example, if the status is RES_ERROR – then the error description.String

Response Values

HTTP CODEComment
403Security conditions violated. Check transmitted parameters and settings.
404No invoice with this number found for this shop

Account Status

warning

For these requests, it is recommended to check the SSL certificate of the responding server to prevent DNS spoofing.

Balance Check

Address ElementValue
Protocolhttps
MethodGet / Post (recommended)
Pathhttps://paysto.com/api/Common/Balance

Parameters

NameDescriptionTypeMandatory
PAYSTO_SHOP_IDShop ID, issued upon registration.IntegerYes
PAYSTO_REQUEST_NOSequential (common for all request types) request number, each subsequent value must be greater than the previous one.Long IntegerNo
PAYSTO_MD5Signature of transmitted data. MD5 checksum.MD5Yes
ResponseDescriptionType
HTTP CODE 200Scalar value. Available balance.Monetary
HTTP CODE 403Security conditions violated. Check transmitted parameters and settings.
HTTP CODE 404Shop not found

Appendix. Connection Parameters

Data obtained from the Personal Account interface (registration required):

  1. Shop ID;
  2. Address for API requests;
  3. Responding server address;
  4. Secret key (set by the user during connection);

Connection Settings