Invoice D788BC5E 0006
Invoice D788BC5E 0006
Introduction
Viatel provides a payment solution where merchants can sell services online to end-users.
Endpoint
The API has the following base end-points in stage and production:
Environment URL
Stage https://stage-checkout.viatel.se
Production https://checkout.viatel.se
ValidateCredentials
POST /api/v1/AgentLine/ValidateCredentials
When the merchant saves the settings, a backend request should be sent to validate that the MerchantId and API
Key was given correctly. The request must be sent to the environment for which it is specified (production or
stage).
Input Parameters
Nonce int64 The value must increase for each purchase. Take Ticks, number of Yes
(long) milliseconds since 1970.
Verification string Hash calculated over selected parameters with the API Yes
Key to make sure the request is untampered.
Result
Base64(SHA256(UTF8Bytes(MerchantId&Nonce&ApiKey))
Request Example
Coding example in C#
CreateOrder
POST /api/v1/AgentLine/CreateOrder
When the end-user clicks his/her preferred purchase-button, a request should be made to Viatel’s API which will
return an HTML snippet that should be displayed to the end-user.
Input Parameters
OrderId string(15) Order number that the merchant can use to Set the value to Yes
connect the purchase in their own CRM system. MerchantId + “-” +
The value doesn’t need to be unique. Nonce
AccountNumber string The account to be used. If the value is “0”, a new From Form Yes
account will be created.
Amount int Amount to be paid and specified in minor units From Widget Yes
according to ISO 4217, e.g. 100 is set as 10000. (the value should be
multiplied by 100)
Value int The amount to be deposited to the end- From Widget (if set) No
user. Specified in minor units exactly like Amount. (the value should be
multiplied by 100)
Currency string Currency code, e.g. SEK or EUR, according to From Widget Yes
ISO 4217
OrderText string Text description for the purchase and is shown on From Widget No
the payment page and on the confirmation page.
ApproveTopUp boolean The end-user’s approval to allow topup. From Form Yes
ApproveAutomaticTopUp boolean The end-user’s approval to allow automatic topup From Form Yes
when the account is out of balance.
Name string The end-user’s name. Used in the payment From Form No
confirmation and for customer service.
Email string The end-user’s e-mail address. Used in the From Form No
payment confirmation and for customer service.
SuccessURL string URL the end-user will be redirected to after a From Settings No
successful payment or when the end-user clicks
the button on the payment confirmation page.
CancelURL string URL the end-user will be redirected to if the end- From Settings No
user chooses to cancel the payment.
Nonce int64 The value must increase for each purchase. Take Ticks, number Yes
(long) of milliseconds since
1970.
ResultCode int Specifies if the request was successful, or an error code specifying the reason for the failed request.
Positive value (>=0) means request was successful, otherwise means the request failed.
ResultCode Description
100 Successful
Base64(SHA256(UTF8Bytes(MerchantId&AccountNumber&Amount&Value&Currency&ApproveTopUp
&ApproveAutomaticTopUp&SuccessURL&CancelURL&Nonce&ApiKey))
Request Example
Coding example in C#
The values for approveTopUp and approveAutomaticTopUp in the MAC calculations should be set as "true" and
"false".