Guide

November 11, 2022

The Barion API: designed with developers in mind
Product

11/11/2022

Integrating payment APIs can be a hassle, but not with Barion. If you’re a developer currently seeking information about Barion integration, you’ve come to the right place – this is a quick and dirty guide to the various Barion APIs and everything you need to know about them before getting down to implementation. 


About Barion and the Barion API💻

If you are here, it means that you’re looking for a payment gateway provider. Barion is one of these solutions: our services include debit and credit card payments, digital wallet (like Apple Pay, Google Pay, and Barion Wallet) transactions, and much more. Based on these types, there are two major scenarios that customers can use – responsive web payment, which works on desktops and mobile browsers as well, and mobile app payments, which customers can use it for checking out using their Barion mobile app. 

Let’s see now every step in the payment process and where and how the Barion API comes into the picture: 

Step 1: Customer checks out in a webshop. 

Step 2: The merchant’s (or webshop’s) server kicks things off by calling the /Payment/Start API. Barion returns a payment ID in turn, and the shop records the transaction. 

Step 3: The merchant’s website redirects the customer to the Barion payment gateway user interface. This can either be a responsive web interface or the Barion mobile app. 

Step 4: The customer enters their data and completes the payment. 

Step 5: The Barion server notifies the merchant about the status of the payment. Once the notification is received, the shop has to call the /Payment/GetPaymentState API to check if the payment went through. 

Step 6: The merchant’s server records the transaction result. 

Step 7: The user is redirected to the merchant’s return URL.  


Cool, so how do I actually integrate the API?🔧

Assuming that you possess at least intermediate back-end dev skills, and have the tools and the knowledge to call a REST API, integrating the Barion API should be a walk in the park. We highly recommend having the following: 

Tinker with our self-service sandbox mode. Sure, we understand you’d love to save time and jump to coding, but we highly suggest getting familiar with testing payments via the sandbox.  

Some patience. Yes, integrating might take only a few hours, but working with payment APIs requires some discipline. So, don’t jump to coding, but read through our documentation beforehand.  

The Barion API communicates via standard HTTP/1.1 GET or POST requests. Any of the Barion APIs accept only GET or POST requests, so there are no universal endpoints available. When you dig deeper in the trenches, you’ll find the path to each API endpoint and their respective HTTP methods.  


As for the API itself, it sends and receives all content in JSON – so make sure that the following criteria are met when you create an API request: 

1️⃣JSON strings are UTF-8 encoded 

2️⃣The MIME type of the request sent to the API is defined as application/json 

3️⃣Content length should be explicitly specified in all HTTP request headers 


Safe and secure throughout🔒

PCI DSS is the acronym you want to see before integrating any payment gateway, and Barion delivers in that category as well. The Payment Card Industry Data Security Standard is an information security standard for those orgs that handle branded credit cards. This allows us to handle cardholder data, making payments compliant and more convenient at the same time. The business you’re integrating Barion for doesn’t need to have PCI DSS as Barion takes care of that part.  


Wrapping up all loose end(point)s✔️

We aren’t joking when we say that Barion is made by nerds for nerds. Tons of knowledge and resources go into designing our APIs with the single goal of creating endpoints that are a joy to work with and take close zero effort to integrate. Either way, if you feel lost or just want to do more reading before getting down to the actual coding part of things, check out our super thorough documentation here.  

Get started

More like this

Learn more