<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.barion.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Valovicsa</id>
	<title>Barion Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.barion.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Valovicsa"/>
	<link rel="alternate" type="text/html" href="https://docs.barion.com/Special:Contributions/Valovicsa"/>
	<updated>2026-11-21T02:03:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://docs.barion.com/index.php?title=Main_Page&amp;diff=1375</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Main_Page&amp;diff=1375"/>
		<updated>2018-01-19T09:47:12Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{PageTitle|title= Barion technical documentation}}&lt;br /&gt;
&lt;br /&gt;
[[file:payment-gui-montage.png|right|500px]]&lt;br /&gt;
Welcome to the technical documentation of the Barion Smart Gateway electronic payment system. In this wiki you can find the resources needed to implement quick and reliable payment services in your web shop or mobile application.&lt;br /&gt;
&lt;br /&gt;
==Before you start coding==&lt;br /&gt;
*[[Getting_started|Getting started - overview of Barion payments]]&lt;br /&gt;
*[[Sandbox|Setting up the Sandbox environment and testing payments]]&lt;br /&gt;
*[[Creating_an_account|Creating an account]]&lt;br /&gt;
*[[Creating_a_shop|Creating a shop]]&lt;br /&gt;
*[[Calling_the_API|Calling the Barion API]]&lt;br /&gt;
&amp;lt;!--*[[Responsive_web_payment|Responsive Web Payment - simple web shop payment for desktop and mobile]]--&amp;gt;&lt;br /&gt;
*[[Support|Getting support]]&lt;br /&gt;
*[[Going_live|Going live]]&lt;br /&gt;
&lt;br /&gt;
==Payment scenarios==&lt;br /&gt;
*[[Responsive_web_payment|Responsive Web Payment - simple web shop payment for desktop and mobile]]&lt;br /&gt;
*[[Reservation_payment|Payments with reservation / escrow]]&lt;br /&gt;
&amp;lt;!--*[[Mobile-app-payment|Mobile App Payment - payment for native mobile apps]]--&amp;gt;&lt;br /&gt;
*[[Token_payment|Token payments - for one click or recurring payments]]&lt;br /&gt;
*[[C2C_Payments|C2C payments - sharing economy and marketplaces]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Other useful info==&lt;br /&gt;
*[[Troubleshooting|Troubleshooting - list of common pitfalls]]&lt;br /&gt;
*[[Localisation|Localization and list of available languages]]&lt;br /&gt;
*[[Download|Downloadable resources – libraries and source code]]&lt;br /&gt;
*[[Legal_accounting|Legal and accounting information]]&lt;br /&gt;
*[[List_of_API_endpoints|List of Barion API endpoints]]&lt;br /&gt;
*[[CodeSamples|Code Samples]]&lt;br /&gt;
*[[Security Measures]]&lt;br /&gt;
*[https://www.barion.com/en Barion Website]&lt;br /&gt;
&lt;br /&gt;
==Contributors&#039; guide==&lt;br /&gt;
*[[Editing_guide|Contributor guidelines and best practices]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==Other relevant services==&lt;br /&gt;
*[[refunding|Refunding payments to customers - automated with API]]&lt;br /&gt;
*[[withdrawing|Withdrawing money to bank account  - automated with API]]&lt;br /&gt;
*[[sending-money|Sending money to other Barion accounts for free - automated with API]]--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1374</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1374"/>
		<updated>2018-01-19T09:46:38Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace, sharing economy, and facilitated payments}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Payment facilitation is a special kind of payment scenario, where the payment itself is supervised by a third party. This means that a supervising shop (called the &#039;&#039;&#039;facilitator&#039;&#039;&#039;) defines all parameters for a payment, but it does not take part in the process as a payee. This is useful in marketplace and sharing economy scenarios, where the customer buys products and services from various sellers, under the management of a service provider. The service provider may also charge fees for the service that is paid by the seller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Example:&#039;&#039;&#039; consider calling an Uber - the car driver is the seller, the passenger is the customer, and the company Uber is the facilitator. The money travels between the passenger and the driver, while the company deducts a fee from the driver.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To successfully implement facilitated payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario, and, in case you wish to combine it with the reservation feature, also [[Reservation_payment|Reservation payments]]. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to all other scenarios. &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== The marketplace scenario ==&lt;br /&gt;
The payment process is similar to all other scenarios. The only difference is that the API calls are placed by the facilitator. Neither the customer nor the payee takes any action.&lt;br /&gt;
&lt;br /&gt;
The basic structure of a facilitated payment consists of the facilitator, the customer, and one or more sellers. See the figure below.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace-nocontributor.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Seller accounts ==&lt;br /&gt;
&lt;br /&gt;
When taking part in a facilitated payment, the seller (payee) must have a registered, activated Barion wallet. They do not need to have a shop though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; if the seller does not have an account with the payment&#039;s currency, it will automatically be created for them upon successful payment.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a facilitated payment ==&lt;br /&gt;
==== 1. The facilitator prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario. The facilitator specifies the payee[s], and the optional payment parameters.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
After the customer completes the payment via the Barion Smart Gateway, the money is transferred to the facilitator.&lt;br /&gt;
A callback is sent to the facilitator.&lt;br /&gt;
&lt;br /&gt;
On the Barion Smart Gateway user interface the customer will see that the payee is the facilitator, while the sellers and items are listed in the payment details&lt;br /&gt;
&lt;br /&gt;
[[file:barion_marketplace_example_screenshot.png|700px]]&lt;br /&gt;
&lt;br /&gt;
==== 3. The sellers receive the money ====&lt;br /&gt;
The Barion system distributes the paid amount among the sellers, according to the payment transactions specified by the facilitator when preparing the payment, and also processes all payee transactions (if applicable).&lt;br /&gt;
* At this point the location and availability of the money depends on wether the facilitator uses [[Responsive_web_payment|Immediate]] or [[Reservation_payment|Reservation]] payments. See the corresponding article for details.&lt;br /&gt;
&lt;br /&gt;
== Refunding facilitated payments ==&lt;br /&gt;
When using facilitated payments, refund is a special case. As long as a reservation payment is not finished, the facilitator has complete control of the process and is able to refund the amount by finishing the payment transactions with zero amount. However, in case of a completed immediate or a finished reservation payment, the facilitator no longer has control over the process. This means that incurring refunds must be done by the seller. The facilitator and the seller must ensure the legal compliance of this in their respective environment.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Please check out the [[Marketplace_Example|detailed example of a marketplace payment]] page for more informations.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1373</id>
		<title>C2C Payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1373"/>
		<updated>2018-01-19T09:46:28Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* &amp;quot;Marketplace with agents&amp;quot; sharing economy example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{PageTitle|title=C2C payments - sharing economy and marketplaces}}&lt;br /&gt;
==C2C overview==&lt;br /&gt;
In certain business scenarios Barion is able to facilitate payments between users of the system. Hence the name C2C, meaning consumer to consumer. There are roles, as indicated on the diagram. The Customer is the user who uses the services of Seller (or multiple Sellers in case of marketplaces) and pays the Seller directly. The Facilitator, the company that facilitates the service is organizing the payment with the Barion API. The Facilitator is able to transfer a fee from each payment to herself and to one or more Contributors. The Customer does not need a Barion account, but the Seller and Contributors do. Barion transaction fees are always covered by the Facilitator, no other parties pay transaction fees.&lt;br /&gt;
&lt;br /&gt;
[[CodeSamples|Code Samples]] are available.&lt;br /&gt;
&lt;br /&gt;
Examples of use for such payments:&lt;br /&gt;
*Sharing Economy business model (such as Uber)&lt;br /&gt;
*Marketplaces, where shopper may buy from multiple Sellers in one transaction&lt;br /&gt;
*Where law mandates direct payment to Seller, e.g. in certain insurance scenarios&lt;br /&gt;
*To optimize taxation&lt;br /&gt;
&lt;br /&gt;
[[file:Sharing-economy.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C with escrow==&lt;br /&gt;
The Facilitator has the option to control the payment of the Customer to Seller, by placing the sum in an escrow and decide about fulfillment at a later time, such as when the delivery is confirmed. The funds can be partially or completely refunded to the Customer in case Seller does not deliver properly.&lt;br /&gt;
&lt;br /&gt;
For further details about escrow please check out [[Reservation_payment|Payments with reservation / escrow]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please  check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-escrow.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Uber&amp;quot; style simple sharing economy example==&lt;br /&gt;
If &amp;quot;Uber&amp;quot; was using Barion, the passenger would be the Customer, and the Driver would be the Seller. &amp;quot;Uber&amp;quot; would ask for a fee from the driver, as the blue lines indicate. Barion transaction fees would be payed by &amp;quot;Uber&amp;quot;. Drivers would need a Barion account set up before the first ride. Automatic charging would &lt;br /&gt;
be solved by [[Token_payment|Token payments]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-uber.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Marketplace with agents&amp;quot; sharing economy example==&lt;br /&gt;
This example shows a marketplace, where multiple Sellers sell goods or services to the Customer, and both the Facilitator and third party agents receive a fee.&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
Please check out the [[Marketplace_Example|detailed example of a marketplace payment]] page for more informations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C transactions mapped to API structure==&lt;br /&gt;
The following diagram helps developers match the C2C payment structure the the API Json structure.&lt;br /&gt;
[[file:sharing-economy-api-mapping.png|1000px]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1372</id>
		<title>C2C Payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1372"/>
		<updated>2018-01-19T09:46:03Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* &amp;quot;Marketplace with agents&amp;quot; sharing economy example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{PageTitle|title=C2C payments - sharing economy and marketplaces}}&lt;br /&gt;
==C2C overview==&lt;br /&gt;
In certain business scenarios Barion is able to facilitate payments between users of the system. Hence the name C2C, meaning consumer to consumer. There are roles, as indicated on the diagram. The Customer is the user who uses the services of Seller (or multiple Sellers in case of marketplaces) and pays the Seller directly. The Facilitator, the company that facilitates the service is organizing the payment with the Barion API. The Facilitator is able to transfer a fee from each payment to herself and to one or more Contributors. The Customer does not need a Barion account, but the Seller and Contributors do. Barion transaction fees are always covered by the Facilitator, no other parties pay transaction fees.&lt;br /&gt;
&lt;br /&gt;
[[CodeSamples|Code Samples]] are available.&lt;br /&gt;
&lt;br /&gt;
Examples of use for such payments:&lt;br /&gt;
*Sharing Economy business model (such as Uber)&lt;br /&gt;
*Marketplaces, where shopper may buy from multiple Sellers in one transaction&lt;br /&gt;
*Where law mandates direct payment to Seller, e.g. in certain insurance scenarios&lt;br /&gt;
*To optimize taxation&lt;br /&gt;
&lt;br /&gt;
[[file:Sharing-economy.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C with escrow==&lt;br /&gt;
The Facilitator has the option to control the payment of the Customer to Seller, by placing the sum in an escrow and decide about fulfillment at a later time, such as when the delivery is confirmed. The funds can be partially or completely refunded to the Customer in case Seller does not deliver properly.&lt;br /&gt;
&lt;br /&gt;
For further details about escrow please check out [[Reservation_payment|Payments with reservation / escrow]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please  check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-escrow.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Uber&amp;quot; style simple sharing economy example==&lt;br /&gt;
If &amp;quot;Uber&amp;quot; was using Barion, the passenger would be the Customer, and the Driver would be the Seller. &amp;quot;Uber&amp;quot; would ask for a fee from the driver, as the blue lines indicate. Barion transaction fees would be payed by &amp;quot;Uber&amp;quot;. Drivers would need a Barion account set up before the first ride. Automatic charging would &lt;br /&gt;
be solved by [[Token_payment|Token payments]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-uber.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Marketplace with agents&amp;quot; sharing economy example==&lt;br /&gt;
This example shows a marketplace, where multiple Sellers sell goods or services to the Customer, and both the Facilitator and third party agents receive a fee.&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
Please check out the [[Marketplace_Example|detailed example of a marketplace payment]] for more informations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C transactions mapped to API structure==&lt;br /&gt;
The following diagram helps developers match the C2C payment structure the the API Json structure.&lt;br /&gt;
[[file:sharing-economy-api-mapping.png|1000px]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1371</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1371"/>
		<updated>2018-01-19T09:45:04Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace, sharing economy, and facilitated payments}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Payment facilitation is a special kind of payment scenario, where the payment itself is supervised by a third party. This means that a supervising shop (called the &#039;&#039;&#039;facilitator&#039;&#039;&#039;) defines all parameters for a payment, but it does not take part in the process as a payee. This is useful in marketplace and sharing economy scenarios, where the customer buys products and services from various sellers, under the management of a service provider. The service provider may also charge fees for the service that is paid by the seller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Example:&#039;&#039;&#039; consider calling an Uber - the car driver is the seller, the passenger is the customer, and the company Uber is the facilitator. The money travels between the passenger and the driver, while the company deducts a fee from the driver.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To successfully implement facilitated payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario, and, in case you wish to combine it with the reservation feature, also [[Reservation_payment|Reservation payments]]. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to all other scenarios. &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== The marketplace scenario ==&lt;br /&gt;
The payment process is similar to all other scenarios. The only difference is that the API calls are placed by the facilitator. Neither the customer nor the payee takes any action.&lt;br /&gt;
&lt;br /&gt;
The basic structure of a facilitated payment consists of the facilitator, the customer, and one or more sellers. See the figure below.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace-nocontributor.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Seller accounts ==&lt;br /&gt;
&lt;br /&gt;
When taking part in a facilitated payment, the seller (payee) must have a registered, activated Barion wallet. They do not need to have a shop though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; if the seller does not have an account with the payment&#039;s currency, it will automatically be created for them upon successful payment.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a facilitated payment ==&lt;br /&gt;
==== 1. The facilitator prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario. The facilitator specifies the payee[s], and the optional payment parameters.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
After the customer completes the payment via the Barion Smart Gateway, the money is transferred to the facilitator.&lt;br /&gt;
A callback is sent to the facilitator.&lt;br /&gt;
&lt;br /&gt;
On the Barion Smart Gateway user interface the customer will see that the payee is the facilitator, while the sellers and items are listed in the payment details&lt;br /&gt;
&lt;br /&gt;
[[file:barion_marketplace_example_screenshot.png|700px]]&lt;br /&gt;
&lt;br /&gt;
==== 3. The sellers receive the money ====&lt;br /&gt;
The Barion system distributes the paid amount among the sellers, according to the payment transactions specified by the facilitator when preparing the payment, and also processes all payee transactions (if applicable).&lt;br /&gt;
* At this point the location and availability of the money depends on wether the facilitator uses [[Responsive_web_payment|Immediate]] or [[Reservation_payment|Reservation]] payments. See the corresponding article for details.&lt;br /&gt;
&lt;br /&gt;
== Refunding facilitated payments ==&lt;br /&gt;
When using facilitated payments, refund is a special case. As long as a reservation payment is not finished, the facilitator has complete control of the process and is able to refund the amount by finishing the payment transactions with zero amount. However, in case of a completed immediate or a finished reservation payment, the facilitator no longer has control over the process. This means that incurring refunds must be done by the seller. The facilitator and the seller must ensure the legal compliance of this in their respective environment.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Please check out [[Marketplace_Example|detailed example of a marketplace payment]].&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1370</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1370"/>
		<updated>2018-01-19T09:43:53Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace, sharing economy, and facilitated payments}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Payment facilitation is a special kind of payment scenario, where the payment itself is supervised by a third party. This means that a supervising shop (called the &#039;&#039;&#039;facilitator&#039;&#039;&#039;) defines all parameters for a payment, but it does not take part in the process as a payee. This is useful in marketplace and sharing economy scenarios, where the customer buys products and services from various sellers, under the management of a service provider. The service provider may also charge fees for the service that is paid by the seller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Example:&#039;&#039;&#039; consider calling an Uber - the car driver is the seller, the passenger is the customer, and the company Uber is the facilitator. The money travels between the passenger and the driver, while the company deducts a fee from the driver.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To successfully implement facilitated payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario, and, in case you wish to combine it with the reservation feature, also [[Reservation_payment|Reservation payments]]. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to all other scenarios. &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== The marketplace scenario ==&lt;br /&gt;
The payment process is similar to all other scenarios. The only difference is that the API calls are placed by the facilitator. Neither the customer nor the payee takes any action.&lt;br /&gt;
&lt;br /&gt;
The basic structure of a facilitated payment consists of the facilitator, the customer, and one or more sellers. See the figure below.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace-nocontributor.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Seller accounts ==&lt;br /&gt;
&lt;br /&gt;
When taking part in a facilitated payment, the seller (payee) must have a registered, activated Barion wallet. They do not need to have a shop though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; if the seller does not have an account with the payment&#039;s currency, it will automatically be created for them upon successful payment.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a facilitated payment ==&lt;br /&gt;
==== 1. The facilitator prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario. The facilitator specifies the payee[s], and the optional payment parameters.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
After the customer completes the payment via the Barion Smart Gateway, the money is transferred to the facilitator.&lt;br /&gt;
A callback is sent to the facilitator.&lt;br /&gt;
&lt;br /&gt;
On the Barion Smart Gateway user interface the customer will see that the payee is the facilitator, while the sellers and items are listed in the payment details&lt;br /&gt;
&lt;br /&gt;
[[file:barion_marketplace_example_screenshot.png|700px]]&lt;br /&gt;
&lt;br /&gt;
==== 3. The sellers receive the money ====&lt;br /&gt;
The Barion system distributes the paid amount among the sellers, according to the payment transactions specified by the facilitator when preparing the payment, and also processes all payee transactions (if applicable).&lt;br /&gt;
* At this point the location and availability of the money depends on wether the facilitator uses [[Responsive_web_payment|Immediate]] or [[Reservation_payment|Reservation]] payments. See the corresponding article for details.&lt;br /&gt;
&lt;br /&gt;
== Refunding facilitated payments ==&lt;br /&gt;
When using facilitated payments, refund is a special case. As long as a reservation payment is not finished, the facilitator has complete control of the process and is able to refund the amount by finishing the payment transactions with zero amount. However, in case of a completed immediate or a finished reservation payment, the facilitator no longer has control over the process. This means that incurring refunds must be done by the seller. The facilitator and the seller must ensure the legal compliance of this in their respective environment.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
For a detailed  example of Marketplace please check out [[Marketplace_Example|Marketplace example]].&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1369</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1369"/>
		<updated>2018-01-19T09:43:15Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace, sharing economy, and facilitated payments}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Payment facilitation is a special kind of payment scenario, where the payment itself is supervised by a third party. This means that a supervising shop (called the &#039;&#039;&#039;facilitator&#039;&#039;&#039;) defines all parameters for a payment, but it does not take part in the process as a payee. This is useful in marketplace and sharing economy scenarios, where the customer buys products and services from various sellers, under the management of a service provider. The service provider may also charge fees for the service that is paid by the seller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Example:&#039;&#039;&#039; consider calling an Uber - the car driver is the seller, the passenger is the customer, and the company Uber is the facilitator. The money travels between the passenger and the driver, while the company deducts a fee from the driver.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To successfully implement facilitated payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario, and, in case you wish to combine it with the reservation feature, also [[Reservation_payment|Reservation payments]]. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to all other scenarios. &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== The marketplace scenario ==&lt;br /&gt;
The payment process is similar to all other scenarios. The only difference is that the API calls are placed by the facilitator. Neither the customer nor the payee takes any action.&lt;br /&gt;
&lt;br /&gt;
The basic structure of a facilitated payment consists of the facilitator, the customer, and one or more sellers. See the figure below.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace-nocontributor.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Seller accounts ==&lt;br /&gt;
&lt;br /&gt;
When taking part in a facilitated payment, the seller (payee) must have a registered, activated Barion wallet. They do not need to have a shop though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; if the seller does not have an account with the payment&#039;s currency, it will automatically be created for them upon successful payment.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a facilitated payment ==&lt;br /&gt;
==== 1. The facilitator prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario. The facilitator specifies the payee[s], and the optional payment parameters.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
After the customer completes the payment via the Barion Smart Gateway, the money is transferred to the facilitator.&lt;br /&gt;
A callback is sent to the facilitator.&lt;br /&gt;
&lt;br /&gt;
On the Barion Smart Gateway user interface the customer will see that the payee is the facilitator, while the sellers and items are listed in the payment details&lt;br /&gt;
&lt;br /&gt;
[[file:barion_marketplace_example_screenshot.png|700px]]&lt;br /&gt;
&lt;br /&gt;
==== 3. The sellers receive the money ====&lt;br /&gt;
The Barion system distributes the paid amount among the sellers, according to the payment transactions specified by the facilitator when preparing the payment, and also processes all payee transactions (if applicable).&lt;br /&gt;
* At this point the location and availability of the money depends on wether the facilitator uses [[Responsive_web_payment|Immediate]] or [[Reservation_payment|Reservation]] payments. See the corresponding article for details.&lt;br /&gt;
&lt;br /&gt;
== Refunding facilitated payments ==&lt;br /&gt;
When using facilitated payments, refund is a special case. As long as a reservation payment is not finished, the facilitator has complete control of the process and is able to refund the amount by finishing the payment transactions with zero amount. However, in case of a completed immediate or a finished reservation payment, the facilitator no longer has control over the process. This means that incurring refunds must be done by the seller. The facilitator and the seller must ensure the legal compliance of this in their respective environment.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
For a detailed  example of Marketplace please check out [[Marketplace_Example|Detailed example of a marketplace payment]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1368</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1368"/>
		<updated>2018-01-19T09:42:34Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace, sharing economy, and facilitated payments}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Payment facilitation is a special kind of payment scenario, where the payment itself is supervised by a third party. This means that a supervising shop (called the &#039;&#039;&#039;facilitator&#039;&#039;&#039;) defines all parameters for a payment, but it does not take part in the process as a payee. This is useful in marketplace and sharing economy scenarios, where the customer buys products and services from various sellers, under the management of a service provider. The service provider may also charge fees for the service that is paid by the seller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Example:&#039;&#039;&#039; consider calling an Uber - the car driver is the seller, the passenger is the customer, and the company Uber is the facilitator. The money travels between the passenger and the driver, while the company deducts a fee from the driver.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To successfully implement facilitated payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario, and, in case you wish to combine it with the reservation feature, also [[Reservation_payment|Reservation payments]]. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to all other scenarios. &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== The marketplace scenario ==&lt;br /&gt;
The payment process is similar to all other scenarios. The only difference is that the API calls are placed by the facilitator. Neither the customer nor the payee takes any action.&lt;br /&gt;
&lt;br /&gt;
The basic structure of a facilitated payment consists of the facilitator, the customer, and one or more sellers. See the figure below.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace-nocontributor.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Seller accounts ==&lt;br /&gt;
&lt;br /&gt;
When taking part in a facilitated payment, the seller (payee) must have a registered, activated Barion wallet. They do not need to have a shop though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; if the seller does not have an account with the payment&#039;s currency, it will automatically be created for them upon successful payment.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a facilitated payment ==&lt;br /&gt;
==== 1. The facilitator prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario. The facilitator specifies the payee[s], and the optional payment parameters.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
After the customer completes the payment via the Barion Smart Gateway, the money is transferred to the facilitator.&lt;br /&gt;
A callback is sent to the facilitator.&lt;br /&gt;
&lt;br /&gt;
On the Barion Smart Gateway user interface the customer will see that the payee is the facilitator, while the sellers and items are listed in the payment details&lt;br /&gt;
&lt;br /&gt;
[[file:barion_marketplace_example_screenshot.png|700px]]&lt;br /&gt;
&lt;br /&gt;
==== 3. The sellers receive the money ====&lt;br /&gt;
The Barion system distributes the paid amount among the sellers, according to the payment transactions specified by the facilitator when preparing the payment, and also processes all payee transactions (if applicable).&lt;br /&gt;
* At this point the location and availability of the money depends on wether the facilitator uses [[Responsive_web_payment|Immediate]] or [[Reservation_payment|Reservation]] payments. See the corresponding article for details.&lt;br /&gt;
&lt;br /&gt;
== Refunding facilitated payments ==&lt;br /&gt;
When using facilitated payments, refund is a special case. As long as a reservation payment is not finished, the facilitator has complete control of the process and is able to refund the amount by finishing the payment transactions with zero amount. However, in case of a completed immediate or a finished reservation payment, the facilitator no longer has control over the process. This means that incurring refunds must be done by the seller. The facilitator and the seller must ensure the legal compliance of this in their respective environment.&lt;br /&gt;
&lt;br /&gt;
For a detailed  example of Marketplace please check out [[Marketplace_Example|Detailed example of a marketplace payment]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1367</id>
		<title>C2C Payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=C2C_Payments&amp;diff=1367"/>
		<updated>2018-01-19T09:40:34Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{PageTitle|title=C2C payments - sharing economy and marketplaces}}&lt;br /&gt;
==C2C overview==&lt;br /&gt;
In certain business scenarios Barion is able to facilitate payments between users of the system. Hence the name C2C, meaning consumer to consumer. There are roles, as indicated on the diagram. The Customer is the user who uses the services of Seller (or multiple Sellers in case of marketplaces) and pays the Seller directly. The Facilitator, the company that facilitates the service is organizing the payment with the Barion API. The Facilitator is able to transfer a fee from each payment to herself and to one or more Contributors. The Customer does not need a Barion account, but the Seller and Contributors do. Barion transaction fees are always covered by the Facilitator, no other parties pay transaction fees.&lt;br /&gt;
&lt;br /&gt;
[[CodeSamples|Code Samples]] are available.&lt;br /&gt;
&lt;br /&gt;
Examples of use for such payments:&lt;br /&gt;
*Sharing Economy business model (such as Uber)&lt;br /&gt;
*Marketplaces, where shopper may buy from multiple Sellers in one transaction&lt;br /&gt;
*Where law mandates direct payment to Seller, e.g. in certain insurance scenarios&lt;br /&gt;
*To optimize taxation&lt;br /&gt;
&lt;br /&gt;
[[file:Sharing-economy.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C with escrow==&lt;br /&gt;
The Facilitator has the option to control the payment of the Customer to Seller, by placing the sum in an escrow and decide about fulfillment at a later time, such as when the delivery is confirmed. The funds can be partially or completely refunded to the Customer in case Seller does not deliver properly.&lt;br /&gt;
&lt;br /&gt;
For further details about escrow please check out [[Reservation_payment|Payments with reservation / escrow]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please  check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-escrow.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Uber&amp;quot; style simple sharing economy example==&lt;br /&gt;
If &amp;quot;Uber&amp;quot; was using Barion, the passenger would be the Customer, and the Driver would be the Seller. &amp;quot;Uber&amp;quot; would ask for a fee from the driver, as the blue lines indicate. Barion transaction fees would be payed by &amp;quot;Uber&amp;quot;. Drivers would need a Barion account set up before the first ride. Automatic charging would &lt;br /&gt;
be solved by [[Token_payment|Token payments]].&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-uber.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Marketplace with agents&amp;quot; sharing economy example==&lt;br /&gt;
This example shows a marketplace, where multiple Sellers sell goods or services to the Customer, and both the Facilitator and third party agents receive a fee.&lt;br /&gt;
&lt;br /&gt;
For further details about C2C payments please check out [[Facilitated_payments|Marketplace, sharing economy, and facilitated payments]].&lt;br /&gt;
&lt;br /&gt;
For a detailed  example of Marketplace please check out [[Marketplace_Example|Detailed example of a marketplace payment]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==C2C transactions mapped to API structure==&lt;br /&gt;
The following diagram helps developers match the C2C payment structure the the API Json structure.&lt;br /&gt;
[[file:sharing-economy-api-mapping.png|1000px]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=File:Reservation_demo.png&amp;diff=1366</id>
		<title>File:Reservation demo.png</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=File:Reservation_demo.png&amp;diff=1366"/>
		<updated>2018-01-05T09:08:44Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: Valovicsa uploaded a new version of File:Reservation demo.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1365</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1365"/>
		<updated>2018-01-04T15:34:02Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* 3.b. Reservation timer elapses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payments with reservation / escrow}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A reservation (escrow) payment scenario means that upon charging the funding source of the payer, the money is not immediately handed over to the merchant. Instead, it becomes &#039;&#039;reserved&#039;&#039; (or &#039;&#039;blocked&#039;&#039;) for a given period of time. During this time window, the amount is unavailable for both the payer and the payee - consider it similar to a pending card transaction in a bank system. During the reservation period, the merchant has the right to decide wether to finalize, partially finalize or cancel the purchase. This comes in handy in situations where goods or services are not immediately available at the time of purchase, or might become unavailable by the time of shipping/fulfillment.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
In order to implement reservation payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to immediate payments. There are only additions to the immediate scenario.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== Key differences when using reservation ==&lt;br /&gt;
&lt;br /&gt;
=== The finishing step ===&lt;br /&gt;
The most important thing to note when implementing a reservation payment process is that there is an extra step required to complete the payment: &#039;&#039;&#039;finishing the reservation&#039;&#039;&#039;. This must be done by the merchant, before the reservation time runs out. This can be done by calling the [[Payment-FinishReservation-v2|v2/Payment/FinishReservation]] API endpoint. &lt;br /&gt;
The time window available is also set by the merchant during the preparation of the payment - see the &#039;&#039;ReservationPeriod&#039;&#039; parameter in the [[Payment-Start-v2|v2/Payment/Start]] API endpoint. &lt;br /&gt;
&lt;br /&gt;
=== Pre-deducted fees ===&lt;br /&gt;
The Barion system deducts fees from the merchant after each payment. In case of immediate payments, this mechanism is quite straightforward: when the payment is completed, the money is transferred to the merchant and the fee is deducted and transferred to the Barion system. When using reservation, this process becomes a bit more complicated.&lt;br /&gt;
&lt;br /&gt;
In order to prepare a reservation payment, the merchant must ensure that they have enough money to cover all the necessary fees for the payment - even if in the end the payment is finished with a smaller amount than prepared! To make sure the merchant does not spend the fees in the meantime, the Barion system reserves the fee amount in the merchant&#039;s wallet, and only deducts or releases it when the payment was successfully completed and finished.&lt;br /&gt;
&lt;br /&gt;
If the merchant does not have enough money to cover the fees, the [[Payment-Start-v2|/Payment/Start]] endpoint will return a &amp;lt;code&amp;gt;DoNotHaveEnoughMoneyToPreparePayment&amp;lt;/code&amp;gt; error code.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a reservation payment ==&lt;br /&gt;
==== 1. The merchant prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario, the two differences are that the payment type must be set to Reservation, and the caller must provide a reservation period.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
When the payer&#039;s funding source gets charged successfully, the amount gets reserved. The location of the money depends on the funding source:&lt;br /&gt;
* when paying with Barion wallet, the amount stays reserved in the wallet &amp;lt;u&amp;gt;of the payer&amp;lt;/u&amp;gt;&lt;br /&gt;
* when paying with bank card, the amount is transferred to the merchant, and stays reserved in the wallet &amp;lt;u&amp;gt;of the merchant&amp;lt;/u&amp;gt;&lt;br /&gt;
At this moment the Reservation period timer starts and the payment enters into &amp;lt;code&amp;gt;Reserved&amp;lt;/code&amp;gt; status. A callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the Barion Smart Gateway user interface is identical in all payment scenarios. The customer might not be (as they are not needed to be) aware that there is a reservation taking place in the background! Should this be an issue, the merchant should clarify this in their own respective environment.&lt;br /&gt;
&lt;br /&gt;
==== 3.a. The merchant finishes the reservation ====&lt;br /&gt;
Unless the reservation period timer passes, the merchant has to finish the reservation in order to claim the amount. When finishing a reservation, the merchant must provide the amount they want to finish the payment with. In layman&#039;s terms the merchant is stating that &#039;&#039;&amp;quot;of this reserved amount of &amp;lt;b&amp;gt;X&amp;lt;/b&amp;gt;, I would like to receive &amp;lt;b&amp;gt;Y&amp;lt;/b&amp;gt; in the end&amp;quot;&#039;&#039;, where &amp;lt;code&amp;gt;0 &amp;lt;= Y &amp;lt;= X&amp;lt;/code&amp;gt;. This is done &amp;lt;u&amp;gt;per payment transaction&amp;lt;/u&amp;gt;. The merchant can finish all transactions contained in a payment in one single API call, or in separate calls. However, each payment transaction can only be finished once.&lt;br /&gt;
&lt;br /&gt;
The finishing amount must not exceed the prepared amount for a payment transaction. The merchant can also finish a payment with the total amount of zero, if they want to cancel or storno the payment. The reservation outcome is different depending on the finishing amount.&lt;br /&gt;
* if the finishing amount equals to the prepared amount (everything was okay with the payment, all goods have been delivered or services were fulfilled), then the reserved amount is released and becomes available in the wallet of the merchant&lt;br /&gt;
* if the finishing amount is less than the prepared amount, but is greater than zero (some goods could not be delivered, the customer did not want all products in the end or a service was only partially fulfilled), the finishing amount is released and becomes available in the wallet of the merchant, and the remaining amount is refunded to the customer&lt;br /&gt;
* if the finishing amount is zero (the customer declined the order or the goods/services are not available), the whole amount is refunded to the customer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Refunds during finish&#039;&#039;&#039;&lt;br /&gt;
* if the customer paid with their Barion balance, the amount is given back to them and becomes available in their Barion wallet&lt;br /&gt;
* if the customer paid with a bank card, the amount is refunded to that bank card&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; bank card refunds can take up to 30 days depending on the bank system!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; if the bank card becomes unavailable (it is either expired or blocked by the owner) by the time of finishing the reservation, then the refund will fail and the merchant receives the full prepared amount - in this case, it is the merchant&#039;s full responsibility to arrange the return of the remaining amount to the customer!&lt;br /&gt;
&lt;br /&gt;
If the merchant finishes the reservation successfully, the payment enters into &amp;lt;code&amp;gt;Succeeded&amp;lt;/code&amp;gt; status. A callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
==== 3.b. Reservation timer elapses ====&lt;br /&gt;
If there was no finishing before the reservation timer passes, all unfinished transactions in the payment are automatically finished with an amount of zero. In this case, the unfinished amount is refunded to the customer (in the same way as the merchant would have finished the payment).&lt;br /&gt;
* if there were any finished transactions in the payment, then the payment enters into &amp;lt;code&amp;gt;PartiallySucceeded&amp;lt;/code&amp;gt; status&lt;br /&gt;
* if there was no finished transactions at all, the payment enters into &amp;lt;code&amp;gt;Expired&amp;lt;/code&amp;gt; status&lt;br /&gt;
In either case, a callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
[[file:reservation_demo.png|1100px]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=File:Reservation_demo.png&amp;diff=1364</id>
		<title>File:Reservation demo.png</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=File:Reservation_demo.png&amp;diff=1364"/>
		<updated>2018-01-04T15:33:12Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1363</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1363"/>
		<updated>2018-01-04T15:32:57Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payments with reservation / escrow}}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left:2em;&amp;quot; align=&amp;quot;right&amp;quot;&lt;br /&gt;
| __TOC__&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A reservation (escrow) payment scenario means that upon charging the funding source of the payer, the money is not immediately handed over to the merchant. Instead, it becomes &#039;&#039;reserved&#039;&#039; (or &#039;&#039;blocked&#039;&#039;) for a given period of time. During this time window, the amount is unavailable for both the payer and the payee - consider it similar to a pending card transaction in a bank system. During the reservation period, the merchant has the right to decide wether to finalize, partially finalize or cancel the purchase. This comes in handy in situations where goods or services are not immediately available at the time of purchase, or might become unavailable by the time of shipping/fulfillment.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
In order to implement reservation payments, you need to familiarize yourself with the simple [[Responsive_web_payment|Responsive Web Payment]] scenario. The preparation of payments, redirection to the Barion Smart Gateway and handling the [[Callback mechanism]] are identical to immediate payments. There are only additions to the immediate scenario.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=It is VERY strongly advised to have a detailed knowledge about the payment process, the simple immediate payment scenario and the callback processing.|color=#1993C7}}&lt;br /&gt;
&lt;br /&gt;
== Key differences when using reservation ==&lt;br /&gt;
&lt;br /&gt;
=== The finishing step ===&lt;br /&gt;
The most important thing to note when implementing a reservation payment process is that there is an extra step required to complete the payment: &#039;&#039;&#039;finishing the reservation&#039;&#039;&#039;. This must be done by the merchant, before the reservation time runs out. This can be done by calling the [[Payment-FinishReservation-v2|v2/Payment/FinishReservation]] API endpoint. &lt;br /&gt;
The time window available is also set by the merchant during the preparation of the payment - see the &#039;&#039;ReservationPeriod&#039;&#039; parameter in the [[Payment-Start-v2|v2/Payment/Start]] API endpoint. &lt;br /&gt;
&lt;br /&gt;
=== Pre-deducted fees ===&lt;br /&gt;
The Barion system deducts fees from the merchant after each payment. In case of immediate payments, this mechanism is quite straightforward: when the payment is completed, the money is transferred to the merchant and the fee is deducted and transferred to the Barion system. When using reservation, this process becomes a bit more complicated.&lt;br /&gt;
&lt;br /&gt;
In order to prepare a reservation payment, the merchant must ensure that they have enough money to cover all the necessary fees for the payment - even if in the end the payment is finished with a smaller amount than prepared! To make sure the merchant does not spend the fees in the meantime, the Barion system reserves the fee amount in the merchant&#039;s wallet, and only deducts or releases it when the payment was successfully completed and finished.&lt;br /&gt;
&lt;br /&gt;
If the merchant does not have enough money to cover the fees, the [[Payment-Start-v2|/Payment/Start]] endpoint will return a &amp;lt;code&amp;gt;DoNotHaveEnoughMoneyToPreparePayment&amp;lt;/code&amp;gt; error code.&lt;br /&gt;
&lt;br /&gt;
== The lifecycle of a reservation payment ==&lt;br /&gt;
==== 1. The merchant prepares the payment ====&lt;br /&gt;
Preparing the payment is identical to the [[Responsive_web_payment|Responsive Web Payment]] scenario, the two differences are that the payment type must be set to Reservation, and the caller must provide a reservation period.&lt;br /&gt;
&lt;br /&gt;
==== 2. The customer completes the payment ====&lt;br /&gt;
When the payer&#039;s funding source gets charged successfully, the amount gets reserved. The location of the money depends on the funding source:&lt;br /&gt;
* when paying with Barion wallet, the amount stays reserved in the wallet &amp;lt;u&amp;gt;of the payer&amp;lt;/u&amp;gt;&lt;br /&gt;
* when paying with bank card, the amount is transferred to the merchant, and stays reserved in the wallet &amp;lt;u&amp;gt;of the merchant&amp;lt;/u&amp;gt;&lt;br /&gt;
At this moment the Reservation period timer starts and the payment enters into &amp;lt;code&amp;gt;Reserved&amp;lt;/code&amp;gt; status. A callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; the Barion Smart Gateway user interface is identical in all payment scenarios. The customer might not be (as they are not needed to be) aware that there is a reservation taking place in the background! Should this be an issue, the merchant should clarify this in their own respective environment.&lt;br /&gt;
&lt;br /&gt;
==== 3.a. The merchant finishes the reservation ====&lt;br /&gt;
Unless the reservation period timer passes, the merchant has to finish the reservation in order to claim the amount. When finishing a reservation, the merchant must provide the amount they want to finish the payment with. In layman&#039;s terms the merchant is stating that &#039;&#039;&amp;quot;of this reserved amount of &amp;lt;b&amp;gt;X&amp;lt;/b&amp;gt;, I would like to receive &amp;lt;b&amp;gt;Y&amp;lt;/b&amp;gt; in the end&amp;quot;&#039;&#039;, where &amp;lt;code&amp;gt;0 &amp;lt;= Y &amp;lt;= X&amp;lt;/code&amp;gt;. This is done &amp;lt;u&amp;gt;per payment transaction&amp;lt;/u&amp;gt;. The merchant can finish all transactions contained in a payment in one single API call, or in separate calls. However, each payment transaction can only be finished once.&lt;br /&gt;
&lt;br /&gt;
The finishing amount must not exceed the prepared amount for a payment transaction. The merchant can also finish a payment with the total amount of zero, if they want to cancel or storno the payment. The reservation outcome is different depending on the finishing amount.&lt;br /&gt;
* if the finishing amount equals to the prepared amount (everything was okay with the payment, all goods have been delivered or services were fulfilled), then the reserved amount is released and becomes available in the wallet of the merchant&lt;br /&gt;
* if the finishing amount is less than the prepared amount, but is greater than zero (some goods could not be delivered, the customer did not want all products in the end or a service was only partially fulfilled), the finishing amount is released and becomes available in the wallet of the merchant, and the remaining amount is refunded to the customer&lt;br /&gt;
* if the finishing amount is zero (the customer declined the order or the goods/services are not available), the whole amount is refunded to the customer&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Refunds during finish&#039;&#039;&#039;&lt;br /&gt;
* if the customer paid with their Barion balance, the amount is given back to them and becomes available in their Barion wallet&lt;br /&gt;
* if the customer paid with a bank card, the amount is refunded to that bank card&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; bank card refunds can take up to 30 days depending on the bank system!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; if the bank card becomes unavailable (it is either expired or blocked by the owner) by the time of finishing the reservation, then the refund will fail and the merchant receives the full prepared amount - in this case, it is the merchant&#039;s full responsibility to arrange the return of the remaining amount to the customer!&lt;br /&gt;
&lt;br /&gt;
If the merchant finishes the reservation successfully, the payment enters into &amp;lt;code&amp;gt;Succeeded&amp;lt;/code&amp;gt; status. A callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
==== 3.b. Reservation timer elapses ====&lt;br /&gt;
If there was no finishing before the reservation timer passes, all unfinished transactions in the payment are automatically finished with an amount of zero. In this case, the unfinished amount is refunded to the customer (in the same way as the merchant would have finished the payment).&lt;br /&gt;
* if there were any finished transactions in the payment, then the payment enters into &amp;lt;code&amp;gt;PartiallySucceeded&amp;lt;/code&amp;gt; status&lt;br /&gt;
* if there was no finished transactions at all, the payment enters into &amp;lt;code&amp;gt;Expired&amp;lt;/code&amp;gt; status&lt;br /&gt;
In either case, a callback is sent to the merchant.&lt;br /&gt;
&lt;br /&gt;
[[file:reservation_demo.png|700px]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation-v2|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1320</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1320"/>
		<updated>2017-12-20T15:45:40Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Detailed example of a marketplace payment}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show a reservation payment process including a facilitator. After the payment, a refund will be showcased aswell.&lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their products will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings (including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|/Payment/Start]]). Two transactions will be specified, with the manufacturers set as payees.&lt;br /&gt;
For this specific payment the required JSON content would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The response JSON for this request would be the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257505a0541244bo7dffb85d5fb62ca&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.barion.com/qr/generate?paymentId=48257700-d044-344a-85df-fc75d5fu62cd&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;3db7ffbacuea463c93p5145e172fc3d6&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T12:37:39.696&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a2b7tfbncwpa663c96i2946g122fq3de&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T12:37:39.696&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.barion.com:443/Pay?Id=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.barion.com/Redirect?paymentId=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.barion.com/callback?paymentId=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Its important to save the PaymentId and the TransactionIds. These will be the key parameters for further requests.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitator, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In this case the reserved amount will stay in the payer&#039;s wallet.&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address. This way the amount is transferred the manufacturers, but stays in reserved status.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the system sends a callback to the facilitator about the reservation. The status of the payment becomes Reserved.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
The reservation is started, but it has to be finished by the facilitator before the reservation period passes (in this example this time period is 24 hours). &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=&#039;&#039;If the payment should be refunded at this point, the facilitator had to finish the reservation with a total amount of zero.&#039;&#039;|color=#1993c7}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;next day&amp;quot; the facilitator  completes the reservation. However potatoes have tainted over the night, so it will be removed from the payment. This can be achieved by removing the said product from the finishing JSON:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60F99E979-S5U2-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257505a0541244bo7dffb85d5fb62ca&amp;quot;,&lt;br /&gt;
     &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;3db7ffbacuea463c93p5145e172fc3d6&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;40&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a2b7tfbncwpa663c96i2946g122fq3de&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
They PaymentId and TransactionIds are the same as the ones got in the response from /Payment/Start!&lt;br /&gt;
&lt;br /&gt;
In case of a successful finish the following response should arrive: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;IsSuccessful&amp;quot;: true,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;6ca30e4b-1d3d-467b-8b47-87e6a555523e&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;56f399b094d14a75afc7644a3c0ed84f&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T13:47:11.251Z&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T13:47:11.251Z&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference between the finished and reserved amount (9 euros in this example) will be refunded to the payer. A callback sent to the facilitator.&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;br /&gt;
&lt;br /&gt;
So the reservation is finished at this point, but when the products arrive it turns out that the 8 piece knives set, is actually contains only seven knives. Therefore the payer demands a full refund.&lt;br /&gt;
The manufacturer initiates the refund. To start a refund the user must log in to their Barion wallet. The transaction details are under the activity tab. With the  &amp;quot;Refund the transaction amount&amp;quot; button the user will be redirected to the refund page. A refund can not exceed the paid amount, but it can be lesser than that. In this example a full refund will happen so the refunded amount will be the same as the paid one (35 euros).&lt;br /&gt;
When the user (Robert for this case) clicks on &amp;quot;Refund&amp;quot; button the following JSON will be sent to [[Payment-Refund-v2|/Payment-Refund-v2]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257700-d044-344a-85df-fc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;TransactionsToRefund&amp;quot;: [{&lt;br /&gt;
        &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
        &amp;quot;AmountToRefund&amp;quot;: 35,&lt;br /&gt;
        &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
        &amp;quot;Comment&amp;quot;: &amp;quot;Faulty product&amp;quot;&lt;br /&gt;
    }],&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
If the refund was successful the response would look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257700-d044-344a-85df-fc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;RefundedTransactions&amp;quot;: [{&lt;br /&gt;
        &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
        &amp;quot;Total&amp;quot;: 35,&lt;br /&gt;
        &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
        &amp;quot;Comment&amp;quot;: &amp;quot;Faulty product&amp;quot;,&lt;br /&gt;
        &amp;quot;Status&amp;quot;: &amp;quot;Succeded&amp;quot;&lt;br /&gt;
    }],&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Marketplace|/Marketplace]]&lt;br /&gt;
* [[Reservation|/Reservation_payment]]&lt;br /&gt;
* [[Finish reservation|/Payment-FinishReservation-v2]]&lt;br /&gt;
* [[Refund|/Payment-Refund-v2]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1319</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1319"/>
		<updated>2017-12-20T15:02:07Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Detailed example of a marketplace payment}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show a reservation payment process including a facilitator. After the payment, a refund will be showcased aswell.&lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their products will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings (including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|/Payment/Start]]). Two transactions will be specified, with the manufacturers set as payees.&lt;br /&gt;
For this specific payment the required JSON content would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The response JSON for this request would be the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257505a0541244bo7dffb85d5fb62ca&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.barion.com/qr/generate?paymentId=48257700-d044-344a-85df-fc75d5fu62cd&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;3db7ffbacuea463c93p5145e172fc3d6&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T12:37:39.696&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a2b7tfbncwpa663c96i2946g122fq3de&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T12:37:39.696&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.barion.com:443/Pay?Id=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.barion.com/Redirect?paymentId=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.barion.com/callback?paymentId=48257700d044344a85dffc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Its important to save the PaymentId and the TransactionIds. These will be the key parameters for further requests.|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitator, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In this case the reserved amount will stay in the payer&#039;s wallet.&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address. This way the amount is transferred the manufacturers, but stays in reserved status.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the system sends a callback to the facilitator about the reservation. The status of the payment becomes Reserved.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
The reservation is started, but it has to be finished by the facilitator before the reservation period passes (in this example this time period is 24 hours). &lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=NOTE|text=&#039;&#039;If the payment should be refunded at this point, the facilitator had to finish the reservation with a total amount of zero.&#039;&#039;|color=#1993c7}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;next day&amp;quot; the facilitator will finish the reservation. However potatoes have tainted over the night, so it will be removed from the payment. This can be achieved by removing the said product from the finishing JSON:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60F99E979-S5U2-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257505a0541244bo7dffb85d5fb62ca&amp;quot;,&lt;br /&gt;
     &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;3db7ffbacuea463c93p5145e172fc3d6&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;40&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a2b7tfbncwpa663c96i2946g122fq3de&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
They PaymentId and TransactionIds are the same as the ones got in the response from /Payment/Start!&lt;br /&gt;
&lt;br /&gt;
In case of a successful finish the following response should arrive: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;IsSuccessful&amp;quot;: true,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;6ca30e4b-1d3d-467b-8b47-87e6a555523e&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;56f399b094d14a75afc7644a3c0ed84f&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T13:47:11.251Z&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Succeeded&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-20T13:47:11.251Z&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference between the finished and reserved amount (9 euros in this example) will be refunded to the payer. A callback sent to the facilitator.&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;br /&gt;
&lt;br /&gt;
So the reservation is finished at this point, but when the products arrive it turns out that the 8 piece knives set, is actually contains only seven knives. Therefore the payer demands a full refund.&lt;br /&gt;
The manufacturer initiates the refund. To start a refund the user must log in to their Barion wallet. The transaction details are under the activity tab. With the  &amp;quot;Refund the transaction amount&amp;quot; button the user will be redirected to the refund page. A refund can not exceed the paid amount, but it can be lesser than that. In this example a full refund will happen so the refunded amount will be the same as the paid one (35 euros).&lt;br /&gt;
When the user (Robert for this case) clicks on &amp;quot;Refund&amp;quot; button the following JSON will be sent to [[Payment-Refund-v2|/Payment-Refund-v2]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257700-d044-344a-85df-fc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;TransactionsToRefund&amp;quot;: [{&lt;br /&gt;
        &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
        &amp;quot;AmountToRefund&amp;quot;: 40,&lt;br /&gt;
        &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
        &amp;quot;Comment&amp;quot;: &amp;quot;Faulty product&amp;quot;&lt;br /&gt;
    }],&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the refund was successful the response would look like this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;48257700-d044-344a-85df-fc75d5fu62cd&amp;quot;,&lt;br /&gt;
    &amp;quot;RefundedTransactions&amp;quot;: [{&lt;br /&gt;
        &amp;quot;TransactionId&amp;quot;: &amp;quot;6f44d84031a6424d83208abcc5824fab&amp;quot;,&lt;br /&gt;
        &amp;quot;Total&amp;quot;: 40,&lt;br /&gt;
        &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
        &amp;quot;Comment&amp;quot;: &amp;quot;Faulty product&amp;quot;,&lt;br /&gt;
        &amp;quot;Status&amp;quot;: &amp;quot;Succeded&amp;quot;&lt;br /&gt;
    }],&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Marketplace|/Marketplace]]&lt;br /&gt;
* [[Reservation|/Reservation_payment]]&lt;br /&gt;
* [[Finish reservation|/Payment-FinishReservation-v2]]&lt;br /&gt;
* [[Refund|/Payment-Refund-v2]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1311</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1311"/>
		<updated>2017-12-19T18:25:38Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their products will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers set as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Marketplace|/Marketplace]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1310</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1310"/>
		<updated>2017-12-19T18:24:10Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers given as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Marketplace|/Marketplace]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1309</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1309"/>
		<updated>2017-12-19T18:23:01Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers given as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[MarketPlace|MarketPlace]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1308</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1308"/>
		<updated>2017-12-19T18:20:47Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers given as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1307</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1307"/>
		<updated>2017-12-19T18:20:21Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers given as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, this is for demo purposes only.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1306</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1306"/>
		<updated>2017-12-19T18:19:19Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is to start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]). Two transactions will be specified, with the manufacturers given as payees.&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please do &#039;&#039;&#039;NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
The customer will see the payee is the facilitators, while the sellers are the manufacturers.&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
When the user selected from the give payment options and completed the process, the facilitator will finish the payment trough the Barion API. The money will be transfared to the facilitator.&lt;br /&gt;
&lt;br /&gt;
If the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, the user be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. The distribution of the payed amount, and the applicable fee(s) is automatically managed by the Barion system (based on the specified payment transactions by the facilitator).&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1305</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1305"/>
		<updated>2017-12-19T18:02:41Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System, and will be payed automatically.&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1304</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1304"/>
		<updated>2017-12-19T18:00:54Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=File:Marketplace_payment_payment_type_example.png&amp;diff=1303</id>
		<title>File:Marketplace payment payment type example.png</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=File:Marketplace_payment_payment_type_example.png&amp;diff=1303"/>
		<updated>2017-12-19T17:59:59Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1302</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1302"/>
		<updated>2017-12-19T17:59:45Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on a given site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API ([[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
For this concrete payment the  required JSON file would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_payment_type_example.png]]&lt;br /&gt;
&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1301</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1301"/>
		<updated>2017-12-19T17:57:57Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on an arbitrary  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API.&lt;br /&gt;
For this concrete payment the JSON file required for [[Payment-Start-v2|Payment Start]] would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet.&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]]).&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers(in this case Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1300</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1300"/>
		<updated>2017-12-19T17:56:46Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on an arbitrary  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API.&lt;br /&gt;
For this concrete payment the JSON file required for [[Payment-Start-v2|Payment Start]] would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet.&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]].&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers( Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;br /&gt;
And&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1298</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1298"/>
		<updated>2017-12-19T17:55:04Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on an arbitrary  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API.&lt;br /&gt;
For this concrete payment the JSON file required for [[Payment-Start-v2|Payment Start]] would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet.&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]].&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers( Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;br /&gt;
And&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1297</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1297"/>
		<updated>2017-12-19T17:53:06Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, from end to end. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. Neither the customer nor the payee(s) take any actions.&lt;br /&gt;
&lt;br /&gt;
The process starts with the shopping part. The user select  products on an arbitrary  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system), therefore the prices of their product will be transferred to them. Both manufacturers have a registered Barion wallet but they do not own a shop in the system.&lt;br /&gt;
The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step is start the payment for the selected products via Barion. The facilitator prepares the payment trough the Barion API.&lt;br /&gt;
For this concrete payment the JSON file required for [[Payment-Start-v2|Payment Start]] would look like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt; &lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;60I98E979-Z592-4AA2-BC9F-DF14ABA4P8F17&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Locale&amp;quot;:&amp;quot;en-US&amp;quot;,&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;terry@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;49&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order 1&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Fresh potatoes&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;kg&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 3,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 9,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Ginger, sliced&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 2,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;packs&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-02&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Truffle box&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 20,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-03&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-02&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;robert@example.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;35&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;Order  2&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;8 piece kitchen knives set&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;pc&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 35,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;SM-04&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;DO NOT&#039;&#039;&#039; copy this JSON to your project without modifications, it will &#039;&#039;&#039;NOT&#039;&#039;&#039; work.&lt;br /&gt;
&lt;br /&gt;
If the prepare is done, the user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet.&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish_example.png | 700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After a short period of time, they will be redirected back to the shop&#039;s site (the RerdirectUrl can be specified at the  [[Payment-Start-v2|Payment Start]].&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers( Terry and Robert). They will pay a fee to the facilitator (they may pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;br /&gt;
And&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1294</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1294"/>
		<updated>2017-12-19T17:15:43Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, all along. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process, but it does not take part in the process as a payee. &lt;br /&gt;
The process starts with the shopping part. The user select  products on an arbitrary  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system). The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the user is done with the shopping and all  desired products in their cart, they can complete the payment using Barion. In this case user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At this point they can choose from paying using either with their Barion wallet or with bank card.&lt;br /&gt;
If they choose the Barion wallet option, and log in successfully, they can finish the payment with any of their saved cards ( or add a new one), or with the funds in their wallet.&lt;br /&gt;
In case of bank card payment, they need to fill the required card datas and their email address.&lt;br /&gt;
&lt;br /&gt;
After the payment is successfully finished, they will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_finish_example.png]]&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers( Terry and Robert). They will pay a fee to the facilitator (they could pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;br /&gt;
And&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1289</id>
		<title>Marketplace Example</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Marketplace_Example&amp;diff=1289"/>
		<updated>2017-12-19T16:51:42Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: Created page with &amp;quot;{{PageTitle|title=Example of a marketplace pamyent}}  This guide&amp;#039;s purpose to show an immediate payment process including a facilitator, all along.   In this example a demo ma...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Example of a marketplace pamyent}}&lt;br /&gt;
&lt;br /&gt;
This guide&#039;s purpose to show an immediate payment process including a facilitator, all along. &lt;br /&gt;
&lt;br /&gt;
In this example a demo marketplace will be used as the facilitator. This facilitator will manage the payment  process. The payment will happen via the facilitator&#039;s webshop.&lt;br /&gt;
The process starts with the shopping part. The user select  products on the facilitator&#039;s  site. These products  belongs to manufacturers ( other &amp;quot;users&amp;quot; of the system). The demo products will be the followings ( including the manufacturers):&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_products_example.png]]&lt;br /&gt;
&lt;br /&gt;
If the user is done with the shopping, they can complete the payment using Barion. In this case user will be redirected to the following page:&lt;br /&gt;
&lt;br /&gt;
[[File:marketplace_payment_example.png]]&lt;br /&gt;
&lt;br /&gt;
Since this is a marketplace scenario, the payees will be the manufacturers( Terry and Robert). They will pay a fee to the facilitator (they could pay for other third parties, however in this example no other payments will happen for simplicity) for its services. These fees are calculated by the Barion System.&lt;br /&gt;
And&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=File:Marketplace_products_example.png&amp;diff=1288</id>
		<title>File:Marketplace products example.png</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=File:Marketplace_products_example.png&amp;diff=1288"/>
		<updated>2017-12-19T16:39:04Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1199</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1199"/>
		<updated>2017-12-14T10:38:43Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites is similar to [[Responsive_web_payment|Responsive web payment]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1198</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1198"/>
		<updated>2017-12-14T10:38:18Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites are similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
However as a final step the reservation should be finished  ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trough the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed yet).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1197</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1197"/>
		<updated>2017-12-14T10:26:48Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites is similar to [[Responsive_web_payment|Responsive web payment]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1196</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1196"/>
		<updated>2017-12-14T10:26:31Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites is similar to [[Responsive_web_payment|Responsive web payment]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1195</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1195"/>
		<updated>2017-12-14T10:25:55Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* The payment process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites are similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
However as a final step the reservation should be finished  ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trough the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1194</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1194"/>
		<updated>2017-12-14T10:24:20Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites are similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
The payment process and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
However as a final step the reservation should be finished  ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trough the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1189</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1189"/>
		<updated>2017-12-13T12:16:25Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* The payment process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
The payment process and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
However as a final step the reservation should be finished  ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trough the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1188</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1188"/>
		<updated>2017-12-13T12:15:41Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
The payment process and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
However as a final step the reservation should be finished at a later time ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trought the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1187</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1187"/>
		<updated>2017-12-13T12:14:37Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee (but will be reserved on the payee&#039;s wallet), in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
# In this scenario the payment starts with the &#039;&#039;&#039;preparation&#039;&#039;&#039; of the payment. This means that the webshop creates a JSON representation of the payment data. This data contains all the necessary information about the items to be purchased, the customer and the desired payment scenario.  This JSON should be sent as the body of a POST request to the &amp;lt;code&amp;gt;/v2/Payment/Start&amp;lt;/code&amp;gt; API endpoint. After the system recives the data it will be validated. If all the properties are correct a payment will be prepared in the database and a HTTP response is returned to the webshop.&lt;br /&gt;
# The &#039;&#039;&#039;response&#039;&#039;&#039; should be processed by the webshop system and the Id of the payment (&amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;) should be extracted from the response. This Id should be stored in the webshop database with the initial information about the payment. This is necessary because every following request is based on this Id.&lt;br /&gt;
# The next step is to &#039;&#039;&#039;redirect&#039;&#039;&#039; the customer to the Barion website to a specific URL with the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt; as a query parameter.&lt;br /&gt;
# After the customer paid the requested amount and the payment is completed a server to server request is initiated by Barion towards the webshop. This is called the &#039;&#039;&#039;callback mechanism&#039;&#039;&#039;.&lt;br /&gt;
# At this point the customer is advised on the screen to return to the webshop to complete the process. If the customer clicks through the customer is &#039;&#039;&#039;redirected&#039;&#039;&#039; back to the webshop.&lt;br /&gt;
# At any point of the process the webshop can request information about the payment through the &amp;lt;code&amp;gt;v2/Payment/GetPaymentState&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
# The reservation should be finished at a later time ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trought the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1186</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1186"/>
		<updated>2017-12-13T12:11:03Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee, in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive Web Payment]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
# In this scenario the payment starts with the &#039;&#039;&#039;preparation&#039;&#039;&#039; of the payment. This means that the webshop creates a JSON representation of the payment data. This data contains all the necessary information about the items to be purchased, the customer and the desired payment scenario.  This JSON should be sent as the body of a POST request to the &amp;lt;code&amp;gt;/v2/Payment/Start&amp;lt;/code&amp;gt; API endpoint. After the system recives the data it will be validated. If all the properties are correct a payment will be prepared in the database and a HTTP response is returned to the webshop.&lt;br /&gt;
# The &#039;&#039;&#039;response&#039;&#039;&#039; should be processed by the webshop system and the Id of the payment (&amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;) should be extracted from the response. This Id should be stored in the webshop database with the initial information about the payment. This is necessary because every following request is based on this Id.&lt;br /&gt;
# The next step is to &#039;&#039;&#039;redirect&#039;&#039;&#039; the customer to the Barion website to a specific URL with the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt; as a query parameter.&lt;br /&gt;
# After the customer paid the requested amount and the payment is completed a server to server request is initiated by Barion towards the webshop. This is called the &#039;&#039;&#039;callback mechanism&#039;&#039;&#039;.&lt;br /&gt;
# At this point the customer is advised on the screen to return to the webshop to complete the process. If the customer clicks through the customer is &#039;&#039;&#039;redirected&#039;&#039;&#039; back to the webshop.&lt;br /&gt;
# At any point of the process the webshop can request information about the payment through the &amp;lt;code&amp;gt;v2/Payment/GetPaymentState&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
# The reservation should be finished at a later time ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trought the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1185</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1185"/>
		<updated>2017-12-13T12:10:36Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* The Payment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive web payment]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1184</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1184"/>
		<updated>2017-12-13T12:10:23Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive web payment]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment|]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1183</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1183"/>
		<updated>2017-12-13T12:10:03Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* The Payment Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive web payment|]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment|]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1182</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1182"/>
		<updated>2017-12-13T12:08:53Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive web payment|]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment|]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
This example shows the process of a marketplace payment.&lt;br /&gt;
[[file:sharing-economy-marketplace.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1181</id>
		<title>Facilitated payments</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Facilitated_payments&amp;diff=1181"/>
		<updated>2017-12-13T12:07:24Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: Created page with &amp;quot;{{PageTitle|title=Marketplace}}  In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another us...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Marketplace}}&lt;br /&gt;
&lt;br /&gt;
In this scenario the shop is works as a facilitator, handling the payment transactions but the user do not pay for the shop but for another user. Both facilitator and agents ( if any included) receive a fee.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive web payment|]].&lt;br /&gt;
&lt;br /&gt;
== The Payment Process ==&lt;br /&gt;
The payment process is similar to [[Responsive_web_payment|Responsive web payment|]]. However in this case the facilitator is responsible to manage the payment.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique for the facilitator. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the facilitator only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. In this scenario there should be at least  one payee who is not the same as the one with the provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the Currency payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction Total. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. In case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Immediate&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
    &amp;quot;PayerHint&amp;quot;: &amp;quot;user@barion.com&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;EXMPLSHOP-PM-001/TR001&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;payeeuser@barion.com&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: 37.2,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;PayeeTransactions&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;agent@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 30,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Agent Fee&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Payee&amp;quot;: &amp;quot;facilitator@barion.com&amp;quot;,&lt;br /&gt;
                    &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORFEE-02&amp;quot;,&lt;br /&gt;
                    &amp;quot;Total&amp;quot;: 10,&lt;br /&gt;
                    &amp;quot;Comment&amp;quot;: &amp;quot;Facilitator Fee&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the successful response ===&lt;br /&gt;
&lt;br /&gt;
After a successfully preparing the payment a JSON response is sent back as response. This JSON should be processed and some properties should be saved in the database of the webshop. The single most important property of this JSON is the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;. This should be saved into the database of the webshop along the the ids of the transactions (&amp;lt;code&amp;gt;TransactionId&amp;lt;/code&amp;gt;) attached.&lt;br /&gt;
&lt;br /&gt;
The successful response will also contain the appropriate URL where the customer should be redirected so the integration doesn&#039;t have to hard-code any URL. This information is displayed in the &amp;lt;code&amp;gt;GatewayUrl&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At this point the &#039;&#039;Status&#039;&#039; of the payment should be &amp;lt;code&amp;gt;Prepared&amp;lt;/code&amp;gt;. This means that all the necessary information is prepared for the payment but no financial transfer happened yet.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array are all the transaction that were processed. This array also contains the various fee transactions as well. So if there are transaction here that are not familiar it&#039;s because they were not sent by the webshop.&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. The transactions for  agent and facilitator fees  is prepared aswell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=105d6189-68e5-489c-8d18-e2439b99e5c2&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-AGENTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;bff280b111104a929ce17886cd76a2a5&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.275&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-FACILITATORTFEE-02&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;385af623920a4a2c8a153ebf0965f9a2&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;EUR&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T12:03:02.29&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: &amp;quot;a0715a9cd1df4318a8ea9c2fd8a8c334&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=105d618968e5489c8d18e2439b99e5c2&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1180</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1180"/>
		<updated>2017-12-13T11:26:43Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee, in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Responsive Web Payment|]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
# In this scenario the payment starts with the &#039;&#039;&#039;preparation&#039;&#039;&#039; of the payment. This means that the webshop creates a JSON representation of the payment data. This data contains all the necessary information about the items to be purchased, the customer and the desired payment scenario.  This JSON should be sent as the body of a POST request to the &amp;lt;code&amp;gt;/v2/Payment/Start&amp;lt;/code&amp;gt; API endpoint. After the system recives the data it will be validated. If all the properties are correct a payment will be prepared in the database and a HTTP response is returned to the webshop.&lt;br /&gt;
# The &#039;&#039;&#039;response&#039;&#039;&#039; should be processed by the webshop system and the Id of the payment (&amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;) should be extracted from the response. This Id should be stored in the webshop database with the initial information about the payment. This is necessary because every following request is based on this Id.&lt;br /&gt;
# The next step is to &#039;&#039;&#039;redirect&#039;&#039;&#039; the customer to the Barion website to a specific URL with the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt; as a query parameter.&lt;br /&gt;
# After the customer paid the requested amount and the payment is completed a server to server request is initiated by Barion towards the webshop. This is called the &#039;&#039;&#039;callback mechanism&#039;&#039;&#039;.&lt;br /&gt;
# At this point the customer is advised on the screen to return to the webshop to complete the process. If the customer clicks through the customer is &#039;&#039;&#039;redirected&#039;&#039;&#039; back to the webshop.&lt;br /&gt;
# At any point of the process the webshop can request information about the payment through the &amp;lt;code&amp;gt;v2/Payment/GetPaymentState&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
# The reservation should be finished at a later time ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trought the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1179</id>
		<title>Reservation payment</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Reservation_payment&amp;diff=1179"/>
		<updated>2017-12-13T11:26:06Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Payment with reservation}}&lt;br /&gt;
&lt;br /&gt;
If at the moment of payment the amount of the transaction is not eventual, it is possible to reserve the money, and finalize it later in one or more steps. In case of reservation there is only one condition, the final amount cannot be higher then the reserved one. If the reservation ends with 0 currency, the reserved amount will be refunded to the user. Reservations both work with e-money or bank cards.  If bank card was used the amount will be immediately sent to the payee, in case of e-money the amount will be reserved at the payer. The  reserved money can not be used until the reservation finished&lt;br /&gt;
&lt;br /&gt;
== Prerequisites==&lt;br /&gt;
The prerequisites and  is similar to [[Responsive_web_payment|Calling_the_API|]].&lt;br /&gt;
&lt;br /&gt;
== The payment process ==&lt;br /&gt;
# In this scenario the payment starts with the &#039;&#039;&#039;preparation&#039;&#039;&#039; of the payment. This means that the webshop creates a JSON representation of the payment data. This data contains all the necessary information about the items to be purchased, the customer and the desired payment scenario.  This JSON should be sent as the body of a POST request to the &amp;lt;code&amp;gt;/v2/Payment/Start&amp;lt;/code&amp;gt; API endpoint. After the system recives the data it will be validated. If all the properties are correct a payment will be prepared in the database and a HTTP response is returned to the webshop.&lt;br /&gt;
# The &#039;&#039;&#039;response&#039;&#039;&#039; should be processed by the webshop system and the Id of the payment (&amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt;) should be extracted from the response. This Id should be stored in the webshop database with the initial information about the payment. This is necessary because every following request is based on this Id.&lt;br /&gt;
# The next step is to &#039;&#039;&#039;redirect&#039;&#039;&#039; the customer to the Barion website to a specific URL with the &amp;lt;tt&amp;gt;PaymentId&amp;lt;/tt&amp;gt; as a query parameter.&lt;br /&gt;
# After the customer paid the requested amount and the payment is completed a server to server request is initiated by Barion towards the webshop. This is called the &#039;&#039;&#039;callback mechanism&#039;&#039;&#039;.&lt;br /&gt;
# At this point the customer is advised on the screen to return to the webshop to complete the process. If the customer clicks through the customer is &#039;&#039;&#039;redirected&#039;&#039;&#039; back to the webshop.&lt;br /&gt;
# At any point of the process the webshop can request information about the payment through the &amp;lt;code&amp;gt;v2/Payment/GetPaymentState&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
# The reservation should be finished at a later time ( within the &amp;lt;tt&amp;gt;ReservationPeriod&amp;lt;/tt&amp;gt; ) trought the &amp;lt;code&amp;gt;v2/Payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Preparing the payment ==&lt;br /&gt;
To prepare a new payment an HTTP POST request should be made to the [[Payment-Start-v2|&amp;lt;tt&amp;gt;/v2/Payment/Start&amp;lt;/tt&amp;gt;]] API endpoint. The body of this request should contain a well-formed JSON representation of the desired payment process. To see the full specification of this endpoint head over to the [[Payment-Start-v2|API reference]]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Structure &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The structure of a Barion Gateway payment is hierarchical. The payment is the meta information that describes the process. This payment contains at least one transaction. The transaction represents a financial transfer from a customer to a seller. The payment can contain multiple transactions, this is up to the webshop to decide how the structure of the whole process should be represented. The purchased products should be represented in the &amp;lt;tt&amp;gt;Items &amp;lt;/tt&amp;gt; array of the transactions. The total payment amount will be calculated from the attached transactions. The amount specified for the items is not validated against the transaction Total it is up to the integrator to make sure it is calculated appropriately. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Identification &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To make sure that the payment can be properly identified always generate an Id for the payment, that is is unique in the webshop. This should be sent in the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; property. This is true for all the transactions attached to the payment. For this user the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; of the [[PaymentTransaction]] entity. If the webshop only handles one transaction per payment it is possible to use the same Id for both the &amp;lt;code&amp;gt;PaymentRequestId&amp;lt;/code&amp;gt; and the &amp;lt;code&amp;gt;POSTransactionId&amp;lt;/code&amp;gt; although it is not recommended. In addition to this you can also provide an &amp;lt;code&amp;gt;OrderNumber&amp;lt;/code&amp;gt; for the payment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Payment scenario&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this scenario the &amp;lt;code&amp;gt;PaymenType&amp;lt;/code&amp;gt; should be set to &amp;lt;code&amp;gt;Reservation&amp;lt;/code&amp;gt; indicating that the financial transaction should be finished at a later time. This means that the amount charged will be placed to reservation until the transaction is not completed. The property &amp;lt;code&amp;gt;ReservationPeriod&amp;lt;/code&amp;gt; should  be set as well, indicating how long will the reservation stay active. &lt;br /&gt;
&lt;br /&gt;
Every attached transaction has a &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; property. That property indicates the user wallet that will receive the amount of the transaction. It is very important to make sure that this wallet &#039;&#039;is the same wallet&#039;&#039; that opened the webshop. In technical terms the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; provided should belong to one of the Payee&#039;s shop. This is valid for all the transactions attached to the particular payment. If one of the payees is different the scenario autmatically will be upgraded to sharing economy scenario.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Currency&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can define the currency of the payment by specifying the &amp;lt;tt&amp;gt;Currency&amp;lt;/tt&amp;gt; payment property. It is important to mention that multi-currency transactions are not supported. This means that the currency you define for the payment will be automatically the currency of all the attached transactions. The currency also defines the available precision of the transaction &amp;lt;tt&amp;gt;Total&amp;lt;/tt&amp;gt;. For example for HUF payments no decimal digits allowed while for EUR payments two decimal digits can be used. To be able to receive payments in the selected currency the shop has to have an account created in that currency in the wallet. This means that if the shop only has HUF and USD accounts in its wallet, EUR payments will not be allowed to prepare. However in case of market place or sharing economy scenario, the agents and facilitator&#039;s accounts will be created for the given currency ( if not existed already).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Example preparation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is an example POST Start with minimum provided information.&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Always double check your POSKey and Payee properties. The POSKey is different in the sandbox and live Barion systems.|color=#FF7A3D}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;POSKey&amp;quot;: &amp;quot;630ee026-3e19-469f-8325-afc9bd1ae6a6&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentType&amp;quot;: &amp;quot;Reservation&amp;quot;,&lt;br /&gt;
    &amp;quot;ReservationPeriod&amp;quot;: &amp;quot;1.00:00:00&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;GuestCheckOut&amp;quot; : true,&lt;br /&gt;
    &amp;quot;FundingSources&amp;quot;: [&amp;quot;All&amp;quot;],&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;Payee&amp;quot;: &amp;quot;{{shoplogin}}&amp;quot;,&lt;br /&gt;
            &amp;quot;Total&amp;quot;: &amp;quot;1000&amp;quot;,&lt;br /&gt;
            &amp;quot;Comment&amp;quot;: &amp;quot;A brief description of the transaction&amp;quot;,&lt;br /&gt;
            &amp;quot;Items&amp;quot;: [&lt;br /&gt;
                {&lt;br /&gt;
                    &amp;quot;Name&amp;quot;: &amp;quot;iPhone 7 smart case&amp;quot;,&lt;br /&gt;
                    &amp;quot;Description&amp;quot;: &amp;quot;Durable elegant phone case / matte black&amp;quot;,&lt;br /&gt;
                    &amp;quot;Quantity&amp;quot;: 1,&lt;br /&gt;
                    &amp;quot;Unit&amp;quot;: &amp;quot;piece&amp;quot;,&lt;br /&gt;
                    &amp;quot;UnitPrice&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;ItemTotal&amp;quot;: 25.2,&lt;br /&gt;
                    &amp;quot;SKU&amp;quot;: &amp;quot;EXMPLSHOP/SKU/PHC-01&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            ]&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example success response ====&lt;br /&gt;
In this response there are no errors because the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array is empty. There is no fee charged for the payment because there is only one transaction in the &amp;lt;code&amp;gt;Transactions&amp;lt;/code&amp;gt; array and it&#039;s the one the webshop sent in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;PaymentId&amp;quot;: &amp;quot;00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;PaymentRequestId&amp;quot;: &amp;quot;TEST-01&amp;quot;,&lt;br /&gt;
    &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
    &amp;quot;QRUrl&amp;quot;: &amp;quot;https://api.demo.barion.com/qr/generate?paymentId=00e75116-f5ea-4cd2-b09c-c95dcd1eff30&amp;amp;size=Large&amp;quot;,&lt;br /&gt;
    &amp;quot;Transactions&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;POSTransactionId&amp;quot;: &amp;quot;TEST-01-01&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionId&amp;quot;: &amp;quot;8056a2755d4543f294a7d861fc9b41ca&amp;quot;,&lt;br /&gt;
            &amp;quot;Status&amp;quot;: &amp;quot;Prepared&amp;quot;,&lt;br /&gt;
            &amp;quot;Currency&amp;quot;: &amp;quot;HUF&amp;quot;,&lt;br /&gt;
            &amp;quot;TransactionTime&amp;quot;: &amp;quot;2017-12-13T09:45:57.118&amp;quot;,&lt;br /&gt;
            &amp;quot;RelatedId&amp;quot;: null&lt;br /&gt;
        }&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;RecurrenceResult&amp;quot;: &amp;quot;None&amp;quot;,&lt;br /&gt;
    &amp;quot;GatewayUrl&amp;quot;: &amp;quot;https://secure.demo.barion.com:443/Pay?Id=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;RedirectUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/Redirect?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;CallbackUrl&amp;quot;: &amp;quot;https://testshop.demo.barion.com/callback?paymentId=00e75116f5ea4cd2b09cc95dcd1eff30&amp;quot;,&lt;br /&gt;
    &amp;quot;Errors&amp;quot;: []&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Processing the error response ===&lt;br /&gt;
If there is something wrong during the preparation an error response will be provided. If this happens the &amp;lt;code&amp;gt;Errors&amp;lt;/code&amp;gt; array will be filled out with information about the problem.&lt;br /&gt;
&lt;br /&gt;
==== Possible error responses ====&lt;br /&gt;
{| class=&amp;quot;wikitable api-table&amp;quot;&lt;br /&gt;
! Error code || Description&lt;br /&gt;
|-&lt;br /&gt;
| ModelValidationError || This happens when some of the input properties fail the basic validation. For example when transaction set to reservation but no ReservationPeriod was given &lt;br /&gt;
|-&lt;br /&gt;
| AuthenticationFailed || The provided &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt; is invalid. Check that the key used is appropriate for the environment. The test and production environment are separate so the keys are only valid for one environment. Another problem could be that the provided key is the public key and not the private key. For API requests the secret API key should be used.&lt;br /&gt;
|-&lt;br /&gt;
| ShopIsClosed || The shop is closed in the Barion system, no payments are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidUser|| There is a problem with one of the participants taking part in the payment. All of them should be registered Barion users.&lt;br /&gt;
|-&lt;br /&gt;
| UserCantReceiveEMoney|| There is a problem with the recipient of the payment. Every &amp;lt;code&amp;gt;Payee&amp;lt;/code&amp;gt; specified in the attached transactions should be a fully registered user of Barion. &lt;br /&gt;
|-&lt;br /&gt;
| NotExistingCurrency || The currency specified for the payment is not supported by the Barion system.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidFundingSource || The specified funding source is not valid. Check the &amp;lt;code&amp;gt;FundingSources&amp;lt;/code&amp;gt; input parameter.&lt;br /&gt;
|-&lt;br /&gt;
| InvalidCulture || The specified culture is not supported by the Barion system. &lt;br /&gt;
|-&lt;br /&gt;
| DoNotHaveEnoughMoneyToPreparePayment || In certain corner cases when the webshops Barion balance and the incoming money is not enough to cover the Barion fee this error message is sent.&lt;br /&gt;
|-&lt;br /&gt;
| PaymentStatusNotValid || The status of the payment is InProgress already.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example error response ====&lt;br /&gt;
For example this is the error response when the authentication data (the &amp;lt;code&amp;gt;POSKey&amp;lt;/code&amp;gt;) is not correct.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;Errors&amp;quot;: [&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;ErrorCode&amp;quot;: &amp;quot;AuthenticationFailed&amp;quot;,&lt;br /&gt;
      &amp;quot;Title&amp;quot;: &amp;quot;User authentication failed.&amp;quot;,&lt;br /&gt;
      &amp;quot;Description&amp;quot;: &amp;quot;The login information provided is incorrect. There is no such user in the system or the password is incorrect.&amp;quot;,&lt;br /&gt;
      &amp;quot;EndPoint&amp;quot;: &amp;quot;https://api.barion.com/v2/payment/start&amp;quot;,&lt;br /&gt;
      &amp;quot;AuthData&amp;quot;: null,&lt;br /&gt;
      &amp;quot;HappenedAt&amp;quot;: &amp;quot;2017-02-03T13:18:07.8878292Z&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Redirecting the customer ==&lt;br /&gt;
After a successful payment preparation the next step is to redirect the customer to the secure Barion site. The URL is provided in the response of the &amp;lt;code&amp;gt;Payment/Start&amp;lt;/code&amp;gt; request. &#039;&#039;&#039;Make sure that the user is redirected properly no iframe hacks are allowed.&#039;&#039;&#039; At this point the webshop gives the flow control to the Barion system. There is no need for constant &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; requests, at least for a reasonable time period. The callback mechanism will take care of the notification. However mistakes could happen so after a reasonable time the webshop can make a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request just to rule out any callback errors. Again, this should not be frequent, let the user fill out its credit card information. If you want to shorten the period the user is allowed to pay you can specify this time period in the &amp;lt;code&amp;gt;PaymentWindow&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
Once the customer arrives to the secure Barion server the payment GUI is displayed. At this point the customer either pays with e-money or with its credit card. If the payment fails for any reason (invalid card for example) the customer can try the payment again &#039;&#039;&#039;without leaving the Barion payment GUI&#039;&#039;&#039;. This means that the customer won&#039;t return automatically to webshop when the payment fails. This is worth mentioning because this could lengthen the time the customer takes at the Barion server.&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=IMPORTANT|text=Do not try to pay with the account that owns the shop! It is not permitted to purchase in your own shop!|color=#FF7A3D}}&lt;br /&gt;
&lt;br /&gt;
== Processing the callback ==&lt;br /&gt;
Once the payment completed a callback request is sent to webshop&#039;s server to the specified URL. In fact any change happens in the state of the payment a callback is sent out to notify the webshop. This can be interpreted as a signal to start a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request towards the Barion system. &#039;&#039;&#039;The callback signal is only a signal does not indicate the success of the payment!&#039;&#039;&#039; Therefore a &amp;lt;code&amp;gt;GetPaymentState&amp;lt;/code&amp;gt; request is mandatory to make sure that the appropriate payment state is registered in the webshop as well. Read more about the whole [[Callback_mechanism|callback mechanism]].&lt;br /&gt;
&lt;br /&gt;
{{NotificationBox|title=WARNING|text=Flooding the Barion servers with unnecessary API calls, instead of relying on the callback mechanism, may lead to suspension of the shop.|color=#ff0000}}&lt;br /&gt;
&lt;br /&gt;
== Requesting information about the payment ==&lt;br /&gt;
Once the webshop server received the callback the webshop needs to request information about the outcome of the payment process. For this a [[Payment-GetPaymentState-v2|&amp;lt;tt&amp;gt;Payment/GetPaymentState&amp;lt;/tt&amp;gt;]] request should be sent to the Barion API.&lt;br /&gt;
&lt;br /&gt;
== Processing the returning customer ==&lt;br /&gt;
At the end of the payment process the customer decides whether to return to the webshop or just close the browser. Therefore &#039;&#039;&#039;no financial decision should be made based on the returning customer&#039;&#039;&#039;. The only valid way to decide what to do with the order to request information about the payment through the GetPaymentState API endpoint.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
* [[Payment-GetPaymentState-v2|/Payment/GetPaymentState]]&lt;br /&gt;
* [[Payment-Start-v2|/Payment/Start]]&lt;br /&gt;
* [[Payment-FinishReservation|/Payment/FinishReservation]]&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=Payment-FinishReservation-v2&amp;diff=1178</id>
		<title>Payment-FinishReservation-v2</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=Payment-FinishReservation-v2&amp;diff=1178"/>
		<updated>2017-12-13T10:41:34Z</updated>

		<summary type="html">&lt;p&gt;Valovicsa: /* Output properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageTitle|title=Finish reservation}}&lt;br /&gt;
&lt;br /&gt;
{{api_callmethod&lt;br /&gt;
|method=POST&lt;br /&gt;
|uri=/v2/Payment/FinishReservation&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;/payment/FinishReservation&amp;lt;/code&amp;gt; API endpoint is used to finalize a reserved payment in the Barion system.&lt;br /&gt;
&lt;br /&gt;
Prerequisites before use:&lt;br /&gt;
* [[Creating_an_account|Creating an account in Barion]]&lt;br /&gt;
* [[Creating_a_shop|Creating a shop in Barion]]&lt;br /&gt;
* [[Calling_the_API| Start a payment]]&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
This API endpoint is designed to be used in the following scenarios:&lt;br /&gt;
* [[Payment_with_reservation|Payment with reservation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With this API call the shop can finalize  transactions approved by users. The users can approve their transaction via the Barion GUI. In case of reservation, the transaction can not be finished if the amount exceeds the one what user approved. If a transaction finished with 0 currency then the users gets back the full reserved amount. If the finalized  amount is lesser than the reserved amount, the margin will be refunded to the user’s wallet. For every &lt;br /&gt;
finalization the shop’s owner must identify itself via Barion API.  &lt;br /&gt;
&lt;br /&gt;
== Input properties ==&lt;br /&gt;
&lt;br /&gt;
{{api_input_table_header}}&lt;br /&gt;
|-&lt;br /&gt;
| POSKey || Guid || &lt;br /&gt;
* Required&lt;br /&gt;
|| The secret API key of the shop, generated by Barion. This lets the shop to authenticate through the Barion API, but does not provide access to the account owning the shop itself.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|PaymentId || Guid || *Required || Payment identifier, generated by Barion&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Transactions || [[PaymentTransaction]][] || *Required || Array of transactions&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Output properties ==&lt;br /&gt;
&lt;br /&gt;
{{api_output_table_header}}&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Isuccessful || bool || Result of the transaction&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| PaymentId || Guid || The identifier of the newly initialized payment, generated by the Barion system.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| PaymentRequestId || string || The payment identifier supplied by the API caller in the request.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| Status || [[PaymentStatus]]|| The status of the payment in the Barion system. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|Transactions|| [[ProcessedTransaction]][] || Related transactions&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Valovicsa</name></author>
	</entry>
</feed>