# Unzer

## Introduction

The Emporix system allows to integrate with [Unzer](https://www.unzer.com/en/) as the payment provider.

What we support, is the [Pay by Invoice](https://www.unzer.com/en/unzer-invoice/) solution as the post-checkout approach. No other Unzer integration is possible at the moment.

{% hint style="info" %}
To enable Uzer, you do not need Spreedly environment.
{% endhint %}

The diagram shows how Unzer sequence looks like when it's integrated with Emporix:

<figure><img src="/files/ejGpiNMo3fudkKoAOX4x" alt=""><figcaption></figcaption></figure>

## Gateway configuration

### Prerequisite

For the Emporix and Unzer configuration, you need to have the **private key** and the **public key** from your Unzer account.

### Creating the payment mode

To create the new payment mode, execute the following request:

```json
curl --location --request POST 'https://api.emporix.io/payment-gateway/{TENANT}/paymentmodes/config' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {EMPORIX_AUTH_TOKEN}' \
--data-raw '{
    "code": "unzer",
    "active": true,
    "provider": "UNZER",
    "configuration": {
        "Unzer/PaymentMethodType": "{UNZER_PAYMENT_METHOD_TYPE}",
        "Unzer/PublicKey": "{UNZER_PUBLIC_KEY}",
        "Unzer/PrivateKey": "{UNZER_PRIVATE_KEY}",
        "Unzer/CustomerType": "{UNZER_CUSTOMER_TYPE}",
        "Unzer/ReturnURL" : "{UNZER_RETURN_URL}"
    }
}'
```

* UNZER\_PAYMENT\_METHOD\_TYPE - PAYLATER\_INVOICE is the supported payment method.
* UNZER\_PUBLIC\_KEY - The public key from your Unzer account.
* UNZER\_PRIVATE\_KEY - The private key from your Unzer account.
* UNZER\_CUSTOMER\_TYPE - Either B2B or B2C.
* UNZER\_RETURN\_URL - The URL to which the customer should be redirected after an external payment.

## Storefront implementation

The integration with Unzer does not require any specific implementation on the storefront side. Emporix implements the `server-side-only` integration with Unzer, therefore there is no need to generate any token - it's done by the Emporix Payment Gateway service.

The only thing you need to ensure is that you’re providing the following data during the authorization request:

```json
{
  "order":
    {
      "id":"{ORDER_ID}"
    },
  "paymentModeId":"{PAYMENT_MODE_ID}"
}
```

* ORDER\_ID - Identifier of an order.
* paymentModeId - Identifier of the payment mode that you got from <https://api.emporix.io/payment-gateway/{TENANT}/paymentmodes/frontend> endpoint.

{% hint style="info" %}
To learn more about the Unzer solution, see the [Unzer](https://docs.unzer.com/payment-methods/unzer-invoice-upl/accept-unzer-invoice-upl-server-side-only-integration/) documentation.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/ce/extensibility-and-integrations/payments/unzer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
