Payment initiation

Payment initiation
  • Payment of invoice can be initiated by making the POST request to the URL /direct/v1/ (in case of 1st Direct Post version)
  • The POST method call should contain the fields described below:
  • Form parameters (M – mandatory):
Field Usage Description
X-Shop-Name M Shop code. Will be provided in account profile which will be sent to merchant
X-Nonce M Random symbols which are used for encryption and must be unique for each request. Length must be between 5 and 32 symbols.
X-Request-Signature M Encrypted signature of the request
order_id M Unique order ID/bill number in the merchant system (max 30 symbols)
amount M Payment amount. Decimal point – “.” Two decimal digits available (example: 200.00). (amount value > 0)
currency M Currency (alphabetic code, example EUR, 3 symbols based on ISO 4217)
payment_method M Payment method. Described in the section Integration manual - Direct POST#Available payment methods.
due_date
Order/Bill due date. Expiration time until order can be paid.
Format: dd-mm-yy HH:mm:ss (example, 31-12-07 13:14:06).
If the field is empty, then shop's configuration value is used
Customer information
customer.personal_code Personal identification number (max 25 symbols)
customer.first_name Customer's name. It is designed to identify a customer and prevent fraud (max 50 symbols)
customer.last_name Customer's last name. It is designed to identify a customer and prevent fraud (max 50 symbols)
customer.email Customer's e-mail address. It is designed to identify a customer and prevent fraud (max 50 symbols)
customer.zip ZIP code (max 50 symbols)
customer.city Customer's city. It is designed to identify a customer and prevent fraud (max 50 symbols)
customer.address Address (max 50 symbols)
customer.phone Phone (max 50 symbols)
customer.site_id Customer Id on site of merchant (max 50 symbols)
customer.country Customer's country. It is designed to identify a customer and prevent fraud (2 symbols code, example LV, US, etc)
customer.user_time Local time (max 50 symbols)
customer.user_timezone Local time zone (max 50 symbols)
customer.ip Original request IP address (max 30 symbols). In case of DirectPost not using (IP is taking from request headers)
customer.additional_params
Additional parameter array (e.g. browser data etc.)
Form: customer.additional_params['key'] = 'key_value'
(key – max 50 symbols, key_value – max 255 symbols)
example:
customer.additional_params['screen_resolution'] = '800x600'
customer.additional_params['cookie_info_id'] = 'info'
customer.additional_params['locale'] = 'en_US' or customer.additional_params['locale'] = 'en'. Both formats are valid.
(It is used for payment form language definition. Validation is based on ISO standard definition)
customer.additional_data Additional data in text format (max 1024 symbols)
List of products relevant to the payment
product[i].name Product name (max 100 symbols)
product[i].amount Amount (Decimal point – “.” Two decimal digits available (example: 200.00))
product[i].discount Discount of product
product[i].discount_percent Discount percentage (from 0.00 to 100.00, two fraction digits)
product[i].unit Unit value (max 50 symbols)
product[i].vat VAT amount (Decimal point – “.” Two decimal digits available (example: 200.00))
product[i].vat_percent VAT percentage (positive (or zero) decimal value, fraction - 2 digits)
Input parameters for dynamic descriptor
merchant_name_a Allowed prefix for dynamic merchant name generation
merchant_name_b Allowed suffix for dynamic merchant name generation
Optional fields for recurring payments
active
True/false
true – activate payment, false – terminate payment
recurring_template_expiry Template expiration Date/Time
recurring_period Subsequent payment period in CRON format
  • Fields for signature calculation: <order_id><amount><currency><payment_method><X-Nonce><ShopPassword>
Example:
Key Value Example
REQUEST params:
Content-Type application/x-www-form-urlencoded
X-Shop-Name TEST2
X-Nonce l4gMIo1OHiVDteJjQMNWr4txb
X-Request-Signature 6076538778a039bff41761ee2de3d6f17aecedfe4e6843a8cd028b253974c45082fcf472a4cbd2ff3913b51c7b40bc0a622e4a7e314ca02c9825cfefbba13ca0
order_id order-1978
amount 44
currency EUR
payment_method FD_SMS
customer.personal_code 123456-1234
customer.first_name John
customer.last_name Doe
customer.email test@test.com
customer.zip 123456
customer.city Riga
customer.phone +12345678
customer.country LV
customer.address test street, 1b - 125
customer.additional_params['user_id'] user-123
customer.additional_data Some other data
product[0].name Product 1
product[0].amount 2
product[0].discount 0
product[0].discount_percent 0
product[0].unit Unit 1
product[0].vat 0.64
product[0].vat_percent 10
product[1].name Product 2
product[1].amount 2
product[1].discount 0
product[1].discount_percent 0
product[1].unit Unit 2
product[1].vat 0.64
product[1].vat_percent 10
merchant_name_a null
merchant_name_b null