---
title: "VivaException — classe de base"
method: GET
path: "/Exceptions/VivaException"
tags: ["Exceptions"]
---

# VivaException — classe de base

`GET /Exceptions/VivaException`

Classe de base pour toutes les exceptions du SDK. Étend `RuntimeException`.

```php
use QrCommunication\VivaMerchant\Exceptions\VivaException;

try {
    $viva->orders->create(amount: 0);
} catch (VivaException $e) {
    echo $e->getMessage();     // Message d'erreur
    echo $e->httpStatus;       // Code HTTP (400, 401, 404, etc.)
    echo $e->responseBody;     // Réponse JSON brute (array|null)
    echo $e->getErrorCode();   // ErrorCode Viva (int|null)
    echo $e->getErrorText();   // ErrorText Viva (string|null)
}
```

**Propriétés :**
- `httpStatus` (`int`) — Code HTTP de la réponse
- `responseBody` (`?array`) — Corps JSON décodé de la réponse Viva

**Méthodes :**
- `getErrorCode(): ?int` — Code d'erreur Viva
- `getErrorText(): ?string` — Message d'erreur Viva

## Response `200`

Classe VivaException

---

[API](https://skmtc.net/qrcommunication/apis/viva-wallet-merchant-sdk-re-fe-rence-php.md) · [All operations](https://skmtc.net/qrcommunication/apis/viva-wallet-merchant-sdk-re-fe-rence-php/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qrcommunication/viva-wallet-merchant-sdk-re-fe-rence-php/versions/bcafd06ce584/schema)
