> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Unzer

> Inspect Unzer payments and charges and create direct charges and refunds via the Unzer Payment API

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: Basic auth.
* **Connection**: HTTP Basic auth with `UNZER_PRIVATE_KEY` as the username and `UNZER_API_PASSWORD` as the password.
* **Docs**: [https://docs.unzer.com/server-side-integration/api-basics/authentication/](https://docs.unzer.com/server-side-integration/api-basics/authentication/)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable             | Required | Description                                                                                                                                                                                     |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UNZER_PRIVATE_KEY`  | Yes      | Unzer private API key (s-priv-.... for sandbox, p-priv-.... for production), used as the HTTP Basic username [Docs](https://docs.unzer.com/server-side-integration/api-basics/authentication/). |
| `UNZER_API_PASSWORD` | No       | HTTP Basic password for the Unzer API - always empty, leave as the default empty string [Docs](https://docs.unzer.com/server-side-integration/api-basics/authentication/).                      |

## Setup

1. **Get Unzer API keys**: Request a free test account at [https://docs.unzer.com/](https://docs.unzer.com/) (or sign an Unzer contract for production). You receive a key pair per environment: a public key (s-pub-.... / p-pub-...) and a private key (s-priv-.... / p-priv-...).
2. **Set environment variables**: Add UNZER\_PRIVATE\_KEY=s-priv-.... (sandbox) or p-priv-.... (production) to your .env. Leave UNZER\_API\_PASSWORD empty - the API authenticates with HTTP Basic using the private key as the username and an empty password.
3. **Create a payment type**: Charges require a payment type ID (e.g. s-crd-.... for a card) created client-side via Unzer UI components or the payment types API, so that raw card data never touches your server.
4. **Verify access**: Run Get Payment with a known payment ID, or create a small test charge in sandbox with a test payment type ID.

* Never use the public key (s-pub-/p-pub-) for server-side calls; only the private key authenticates this API. Keep it secret.
* Sandbox keys (s-priv-...) and production keys (p-priv-...) both target [https://api.unzer.com](https://api.unzer.com) - the key prefix determines the environment.
* Amounts are in the currency's major units (e.g. 49.99 EUR).

Provider API reference: [https://docs.unzer.com/server-side-integration/api-basics/](https://docs.unzer.com/server-side-integration/api-basics/)

## Tools

| Tool                 | Access | Description                                                                                                                                                                   |
| -------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Get Payment          | Read   | Retrieve a payment resource with its state, amounts (total, charged, canceled, remaining), and linked transactions                                                            |
| Get Charge           | Read   | Retrieve a specific charge transaction of a payment, including amount, status, and processing details                                                                         |
| Create Charge        | Write  | Directly charge a payment type (one-step payment without prior authorization) using a payment type ID                                                                         |
| Refund Charge        | Write  | Cancel (refund) a charge fully or partially, returning money to the customer                                                                                                  |
| Authorize Payment    | Write  | Reserve funds on a payment type without charging yet (first step of the two-step authorize-then-charge flow, e.g. charge on shipment); reservations are held for about 7 days |
| Charge Authorization | Write  | Capture a previously authorized payment, fully (empty body) or partially (with amount) - the second step of the authorize-then-charge flow                                    |
| Cancel Authorization | Write  | Cancel (reverse) an uncaptured authorization fully or partially, releasing the reserved funds - distinct from refunding a charge                                              |

## Example prompts

* Look up an Unzer payment I specify and summarize its state and the total, charged, canceled, and remaining amounts.
* Refund a charge on an Unzer payment I specify and confirm the refunded amount.
