Sandbox.vipps-direct-api - Vipps direct API 
Page of - last modified by Asbjørn Ulsberg on 2019/07/11 15:00 
Vipps direct API 

Asbjørn Ulsberg

2019/07/11 15:00
Table of Contents
Introduction
API Requests
Options before posting a payment
Purchase flow
Options after posting a payment
Capture Sequence
Cancel Sequence
Reversal Sequence

Vipps is a two-phase payment method supported by the major norwegian banks. In the direct API scenario, PayEx receives a mobile number (MSISDN) directly from the merchant UI.   PayEx performs a payment that the consumer must confirm in the Vipps mobile app.
Introduction
�	When the consumer/end-user starts the purchase process, you make a POST request towards PayEx with the collected Purchase information.
�	After that, you need to collect the consumer's mobile number and make a POST request towards PayEx.
�	PayEx will handle the dialogue with Vipps and the consumer will have to confirm the purchase in the Vipps app.
�	If CallbackURL is set you will receive a payment callback when the Vipps dialogue is completed, and you will have to make a GETrequest to check the payment status.
�	The flow is explained in the picture below:

API Requests
The API requests are displayed in the purchase flow. The options you can choose from when creating a payment with key operation set to Value Purchase are listed below. The general REST based API model is described in the technical reference.
Options before posting a payment
All valid options when posting a payment with operation equal to Purchase, are described in the technical reference.
Type of authorization (Intent).
�	: The intent of a Vipps purchase is always Authorization. The amount will be reserved but not charged. You will later (i.e. if a physical product, when you are ready to ship the purchased products) have to make a Capture or Cancel request.
General
�	: When implementing a scenario, it is optional to set a CallbackURL  in the POST request. If callbackURL is set PayEx will send a postback request to this URL when the consumer has fulfilled the payment. See the Callback API description here.
Purchase flow
The sequence diagram below shows the two requests you have to send to PayEx to make a purchase. The links will take you directly to the API description for the specific request.  
Options after posting a payment
�	 It is possible to abort a payment if the payment has no successful transactions.
�	Vipps only support two-phase transactions (Authorize), which mean that you must implement the Capture and Cancel requests.
�	For reversals, you will need to implement the Reversal request.
�	Whenever changes to the payment occur a Callback request will be posted to the callbackUrl, generated when the payment was created.
Capture Sequence
Capture can only be perfomed on a payment with a successfully authorized transaction. It is possible to do a part-capture where you capture a smaller amount than the authorized amount. You can later do more captures on the same payment up to the total authorization amount.
Cancel Sequence
Cancel can only be done on a authorized transaction. If you do cancel after doing a part-capture you will cancel the different between the capture amount and the authorization amount.
Reversal Sequence
Reversal can only be done on a payment where there are some captured amount not yet reversed.