Management API
Automate your invoicing process with Saferpay

Documentation

Request Specification and technical documentation is available under https://saferpay.github.io/jsonapi/#ChapterRestApi.

Secure PayGate offers

With Saferpay Secure PayGate API Request, you can fully automate your invoicing process whether by e-mail, mail or online. This not only saves you time, but also enables your customers to settle the invoice using their preferred payment method.
Technical Flow

Requirements

The following requirements have to be met, in order to use the Secure PayGate REST API:
The following requirements have to be met, in order to use the Secure PayGate REST API:
    You need a Saferpay Secure PayGate contract, in order to use the Secure PayGate in the first place
      In conjunction with that, you need at least one Secure PayGate terminal, with attached payment methods of your choice.
    A Saferpay eCommerce licence and thus the existence of a valid identification with a username and password for the Saferpay system, to access the necessary API-functions.
    As of now, Klarna Payments is not supported!

Configuration

Before you can begin using the Secure PayGate, you need to configure it inside the Backoffice under Secure PayGate > Settings.

Creating an offer

To create an offer, one must execute the SecurePayGate Offers Request. Once executed, the offer will be displayed inside the Backoffice under Secure PayGate > Overview. The Application will be marked as RestApi.
(click to enlarge)
The details of API-created offers may be viewed, however it cannot be modified.
(click to enlarge)

Sending the Offer

An offer is not sent automatically!
It is intended for you to send the payment link, using your own mail client, which is supported by a lot of environments and programming languages by default. This way, you have full control over the text and especially look and feel of your e-mail.

Connecting the JSON API

The Secure PayGate Management API can be connected with the Saferpay JSON-API, specifically the PAyment Page interface, enabling you, to fully automate the creation, sending and processing of your Secure PayGate offers. For that, you must define the {{{PAYMENTPAGETOKEN}}}, as described during the initial set-up, otherwise you do not have the necessary data to execute the next step.
Once the redirect and/or the notification call arrives at your webserver, you can extract the {{{PAYMENTPAGETOKEN}}} and simply execute the Payment Page Assert. That will return the payment data of the Secure PayGate transaction to your system. This transaction is like a normal Payment Page transaction and further steps may be applied to it, for example the Capture, Partial Capture, or Cancel. Refunds via the API may also be executed, if you wish.
As of now the automatic capturing-option, as described in the Secure PayGate manual, does not apply to transactions, made via the Secure PayGate API! You always either have to capture them manually through the Saferpay Backoffice, or via the JSON API, as described above!

Try it!

We do offer a Demo Environment, where you can test the Secure PayGate Rest Api.

Secure Card Data

Similar to the Payment Page, the Secure PayGate API also has the ability to save a card, during a transaction, using Secure Card Data. Simply add the RegisterAlias container to your request, as described in the request specification:
Similar to the Payment Page, the Secure PayGate API also has the ability to save a card, during a transaction. Simply add the RegisterAlias container to your request, as described in the request specification:

Example

1
{
2
"Payment": {
3
"Amount": {
4
"Value": "404",
5
"CurrencyCode": "CHF"
6
},
7
"OrderId": "094c2a7ce1374f7ca184591f123b154d",
8
"Options": {
9
"PreAuth": true
10
}
11
},
12
"ExpirationDate": "2020-04-23",
13
"Payer": {
14
"LanguageCode": "de",
15
"BillingAddress": {
16
"FirstName": "John",
17
"LastName": "Doe",
18
"Company": "Worldline",
19
"Gender": "MALE",
20
"Street": "Mustergasse 123",
21
"Zip": "8008",
22
"City": "Zurich",
23
"CountryCode": "CH",
24
"Email": "[email protected]"
25
}
26
},
27
"BillingAddressForm": {
28
"Display": true
29
},
30
"RegisterAlias": {
31
"IdGenerator": "RANDOM"
32
}
33
}
Copied!
At this moment, only the IdGenerator value RANDOM is supported!
To use said data, you have to use the Saferpay JSON API. Please refer to this chapter, on how this can be done.

Create Access Token

The Management Api offers the possibility, to create Access Tokens for the Saferpay Fields, enabling you, to automatically set the fields up, for your webshop.

Queue terminal information

The Management Api gives you the option, to automatically request the configuration of a given Terminal. This enables you to, for instance, automatically configure your systems, should the need arise. It is also very helpful, if you have multiple shops, or franchises below you, that all need a full list of payment methods and their configured currencies, in order tofunction properly.
The TerminalInfo PaymentMethods request is exactly that. It will give you a full list of payment methods and the configured currencies, for a given terminal.
Last modified 2mo ago