> For the complete documentation index, see [llms.txt](https://docs.saferpay.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.saferpay.com/home/interfaces/backoffice/settings/json-api-basic-client-certificate-authentication.md).

# JSON API basic/Client Certificate authentication

These two areas cover the most basic configuration a merchant must do, and that is the creation of their authentication credentials.

When using the Saferpay Payment API, the shop has to authenticate itself towards the Saferpay gateway, so Saferpay knows this request is legit. In order to do so, Saferpay offers two ways of authentication.

{% hint style="warning" %}
Either one or the other has to be used, but not both!
{% endhint %}

## Basic authentication

![(click to enlarge)](https://3537448238-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fzpi9teY7Tm2pCZ1Bw8zO%2Fuploads%2FTqA9fJFUIKNsbAqgEvVK%2FScreenshot%202026-08-13%20105148.png?alt=media\&token=f457f18e-c870-4fe3-9b83-618d7be05f33)

This is the default authentication method, available to all merchants who have an e-commerce contract. To create a new user, simply click on **Create new JSON API login.**

![(click to enlarge)](https://3537448238-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fzpi9teY7Tm2pCZ1Bw8zO%2Fuploads%2FczPvazcZjnJpYfWTIVud%2FBO_Settings_JSONApiBasicAuthentication_Create.png?alt=media\&token=83466e75-7dad-48b6-983a-3f52ec45a5dd)

The username will be created by Saferpay. However, the password and a description can be defined by you, as long as the password follows the following rules:

{% hint style="warning" %}
The password is only saved encrypted. It cannot be looked up after you have saved it, so please keep it somewhere safe.
{% endhint %}

* A length of 16 characters.
  * Allowed characters are:&#x20;
    * ABCDEFGHIJKLMNOPQRSTUVWXYZ
    * abcdefghijklmnopqrstuvwxyz
    * 1234567890
    * :+-,\_\*/$%&()\[]=!
* 1 upper- and lowercase letter.
* 1 special character or number

![(click to enlarge)](https://3537448238-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fzpi9teY7Tm2pCZ1Bw8zO%2Fuploads%2FTqRZESG6efeh5LCDa2dt%2FBO_Settings_JSONAPIBasic_Remove.png?alt=media\&token=adf369fc-6f6c-4d57-9fe0-8f83bce63c93)

You can also delete a login at any time by simply checking the box of the login and clicking on **Remove**.

## Client Certificate

![(click to enlarge)](https://3537448238-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fzpi9teY7Tm2pCZ1Bw8zO%2Fuploads%2Fl3qVOIw1QixJZd4cxnke%2FBO_Settings_JSONAPICertificate_Overview.png?alt=media\&token=3a504874-ad89-4419-bf73-817a6087cba9)

This is a more advanced method of authentication involving a certificate. In order to create a certificate, you first have to create a Certificate Signing Request, which must follow the following rules:

{% hint style="warning" %}
This certificate expires after two years and must be renewed!
{% endhint %}

{% hint style="info" %}
This method of authentication is only available for merchants with a Saferpay Business contract.
{% endhint %}

**2048-bit** Key length\
**SHA-256** Hash algorithm\
\
Content of the CSR:\
**Country name** = country code (e.g. CH)\
**Locality name** = place name\
**Organization name** = company name\
**Organizational unit name** = **Saferpay API** (mandatory)\
**Common name** = Saferpay CustomerId (not the user ID!)\
**Email address** = email address of the technical contact\
**A challenge password** = password (if assigned when creating the private key)\
\
**ATTENTION**: Keep the private key in a safe place. It will be required again later (once SIX has issued the certificate)!

Once created, you can then upload the CSR, and, as a response, you'll get the fully signed certificate, including the root certificates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.saferpay.com/home/interfaces/backoffice/settings/json-api-basic-client-certificate-authentication.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
