Webhooks

Viva Wallet supports webhooks, a simple and powerful solution that allows you to receive notifications each time a specific event takes place.

Overview

To receive webhook notifications, you need to create a public URL resource that can receive (via POST) objects of type Message<TransactionEventData>.

Message has the following documented properties:

TransactionEventData has the following documented properties:

Create transaction event

This is the same as the event type Transaction Payment Created in the Viva Wallet banking app:

Transaction Payment Created webhook

To access this feature:

  1. Log in to Viva Wallet banking app.
  2. Visit Settings > API Access.
  3. Click on the Create Webhook link.

EventTypeId: 1796 (JSON object)

{
  "EventData":{
	"Amount": 100.50,
	"CardNumber": "411111XXXXXX1111",
	"CardTypeId": 0,
	"ClientId": "90a7114f-3a7a-466b-8a45-000111222555",
	"CompanyName": "Viva Ηλεκτρονικές Υπηρεσίες",
	"CurrencyCode": 978,
	"CurrentInstallment": 0,
	"CustomerTrns": "Customer description",
	"Email": "customer@viva.gr",
	"FullName": "Customer FullName",
	"InsDate": "2014-06-18T14:20:30.45+03:00",
	"MerchantId": "90a7114f-3a7a-466b-8a45-000111222666",
	"MerchantTrns": "Merchant Reference",
	"OrderCode": 776027772607,
	"ParentId": "90a7114f-3a7a-466b-8a45-000111222777",
	"ResellerCompanyName": "Παπασωτηρίου",
	"ResellerId": "90a7114f-3a7a-466b-8a45-000111222888",
	"ResellerSourceAddress": "Πανεπιστημίου 37 και Κοραή, Αθήνα",
 	"ResellerSourceCode": "2233",
	"ResellerSourceName": "Πανεπιστημίου",
	"SourceCode": "[4-digit code of your payment source]",
	"StatusId": "F",
	"TotalCommission": 2.71,
	"TotalFee": 0.50,
	"TotalInstallments": 0,
	"TransactionId": "90a7114f-3a7a-466b-8a45-000111222888",
	"TransactionTypeId": 5
  },
  "EventTypeId": 1796,
  "Created": "2014-06-18T14:20:30.45+03:00"
}

Property TransactionTypeId can have one of the following values:

TypeId Description
0 Capture from Preauth
1 Authorization Hold
5 Charge Card
6 Charge Card w. Installments
9 Wallet Charge
15 Dias Payment
16 Cash Payment

E.g. For a transaction of type 6 (Charge Card w. Installments) you will only receive a notification for the initial charge, concerning the total amount. You will not receive any notification for the subsequent installments (type 5) at any time. 

Cancel / refund transaction event

This is the same as the event type Transaction Reversal Created in the Viva Wallet banking app:

Transaction Reversal Created webhook

To access this feature:

  1. Log in to Viva Wallet banking app.
  2. Visit Settings > API Access.
  3. Click on the Create Webhook link.

EventTypeId: 1797 (JSON object)

{
  "EventData":{
	"Amount": -100.50,
	"CardNumber": "411111XXXXXX1111",
	"CardTypeId": 0,
	"ClientId": "90a7114f-3a7a-466b-8a45-000111222555",
	"CompanyName": "Viva Ηλεκτρονικές Υπηρεσίες",
	"CurrencyCode": 978,
	"CurrentInstallment": 0,
	"CustomerTrns": "Customer description",
	"Email": "customer@viva.gr",
	"FullName": "Customer FullName",
	"InsDate": "2014-06-18T14:20:30.45+03:00",
	"MerchantId": "90a7114f-3a7a-466b-8a45-000111222666",
	"MerchantTrns": "Merchant Reference",
	"OrderCode": 776027772607,
	"ParentId": "90a7114f-3a7a-466b-8a45-000111222777",
	"ResellerCompanyName": "Παπασωτηρίου",
	"ResellerId": "90a7114f-3a7a-466b-8a45-000111222888",
	"ResellerSourceAddress": "Πανεπιστημίου 37 και Κοραή, Αθήνα",
 	"ResellerSourceCode": "2233",
	"ResellerSourceName": "Πανεπιστημίου",
	"SourceCode": "[4-digit code of your payment source]",
	"StatusId": "F",
	"TotalCommission": -2.71,
	"TotalFee": -0.50,
	"TotalInstallments": 0,
	"TransactionId": "90a7114f-3a7a-466b-8a45-000111222888",
	"TransactionTypeId": 7
  },
  "EventTypeId": 1797,
  "Created": "2014-06-18T14:20:30.45+03:00"
}

Property TransactionTypeId can have one of the following values:

TypeId Description
4 Refund Card Transaction
7 Void Card Transaction
11 Wallet Refund Transaction
13 Refund Card Transaction from Claim
17 Void Cash

Transaction price calculated event

This is the same as the event type Transaction Price Calculated in the Viva Wallet banking app:

Transaction Price Calculated webhook

To access this feature:

  1. Log in to Viva Wallet banking app.
  2. Visit Settings > API Access.
  3. Click on the Create Webhook link.

Bank transfer created event

This is the same as the event type Command Bank Transfer Created in the Viva Wallet banking app:

Bank Transfer Created webhook

To access this feature:

  1. Log in to Viva Wallet banking app.
  2. Visit Settings > API Access.
  3. Click on the Create Webhook link.

Bank transfer executed event

This is the same as the event type Command Bank Transfer Executed in the Viva Wallet banking app:

Bank Transfer Executed webhook

To access this feature:

  1. Log in to Viva Wallet banking app.
  2. Visit Settings > API Access.
  3. Click on the Create Webhook link.

Obligation captured

This event is available only if you’re setting up an online marketplace with us. Please speak to your Viva Wallet sales representative to request access. Alternatively, you can contact us directly via our live chat facility. Simply click on the live chat icon in the bottom right-hand corner of this page.

Obligation cancelled

This event is available only if you’re setting up an online marketplace with us. Please speak to your Viva Wallet sales representative to request access. Alternatively, you can contact us directly via our live chat facility. Simply click on the live chat icon in the bottom right-hand corner of this page.

Webhook URL verification

The API call below uses basic authentication.

In order to use a new webhook URL, Viva Wallet needs to verify that the given URL is available for immediate use.

Each time you enter a new webhook URL via the banking app, you need to verify it (by clicking on the “verify” link next to URL input textbox). This action will start the process of a simple GET http call to your URL. Your page should print a JSON response such as the one shown in this example:

{
  "Key":"B3248222FDCD1885AEAFE51CCC1B5607F00903F6"
}

To receive your unique webhook authorization code, all you need to do is call the following API action with standard API authentication headers. Set the response to application/json. The demo environment has a base URL of https://demo.vivapayments.com/ and for the live environment it’s https://www.vivapayments.com/.

get    /api/messages/config/token

This call will give you the above requested key which you can print to the page as is. You can always disable a webhook (without deleting it), to temporarily stop receiving notifications.

Viva Wallet IP addresses for whitelisting

In case you need to set up IP restrictions, webhooks are sent from the following Viva Wallet IP addresses:

Production:

  • 51.138.37.238
  • 20.54.89.16
  • 13.80.70.181
  • 13.80.71.223
  • 13.79.28.70

Demo:

  • 20.50.240.57
  • 40.74.20.78
  • 94.70.170.65
  • 94.70.174.36
  • 94.70.255.73
  • 94.70.248.18
  • 83.235.24.226

Further information

Check out the related tutorial below for more details on this topic: