> For the complete documentation index, see [llms.txt](https://docs.yoplanning.support/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yoplanning.support/de/developpeur/tutoriel-dacces-au-catalogue/verification-de-la-disponibilite-via-lapi-yoplanning.md).

# Verfügbarkeitsprüfung über die Yoplanning-API

**Endpunkt: /api/v3.1/teams/\[teamId]/order-validation**

Mit dieser API-Methode können Sie vor Abschluss der Bestellung prüfen, ob der Inhalt des Warenkorbs noch verfügbar ist. Dies ist besonders nützlich, um Überbuchungssituationen zu vermeiden, wenn viele Kunden gleichzeitig reservieren.

***

**Beispiel für die Verwendung mit CURL**

**Endpunkt:**

```
/api/v3.1/teams/[teamId]/order-validation
```

**Beschreibung :**

Sie müssen denselben JSON-Code senden, den Sie zum Aufgeben einer Bestellung verwendet haben. Der einzige Unterschied besteht in der URL.

**Beispiel :**

```bash
curl -H "Content-Type: application/json" -X POST -d '{
    "external_reference" : "956",
    "items" : [{
        "session_group" : "53071a97-0c2d-4973-89f5-cafd10665b3b",
        "price" : {"amount" : 51.25},
        "client" : {
            "id" : "71ea849f-226c-4302-a433-528179634aa7",
            "first_name" : "John",
            "last_name" : "Doe",
            "email" : "john.doe@gmail.com"
        }
    }],
    "payments" : [{
        "amount" : 51.25,
        "client" : {
            "first_name" : "Framold",
            "last_name" : "Doe",
            "email" : "john.doe@gmail.com"
        }
    }]
}' https://yoplanning.pro/api/v3.1/teams/5a90332e-568f-4980-9859-88a984844a4d/order-validation -H 'Authorization: Token 4504c2cb0d87a93106d4de029f407c86149f2ada'
```

**Antwort bei Verfügbarkeit:**

```json
{
    "success": true
}
```

**Antwort bei Nichtverfügbarkeit:**

```json
{
    "success": false, 
    "unavailable_items": {
        "group_ids": ["2265cac0-cba5-46eb-8095-b89f93e7473f"], 
        "dry_resource_ids": [], 
        "voucher_ids": [], 
        "resources": []
    }
}
```

***

**Tipps zur Verwendung und Best Practices**

1. **Überprüfung vor jedem Auftragsabschluss:** Verwenden Sie diese Methode vor dem Abschluss eines Auftrags, um sicherzustellen, dass alle erforderlichen Ressourcen noch verfügbar sind.
2. **Fehlermanagement:** Sorgen Sie bei Nichtverfügbarkeit für ein entsprechendes Fehlermanagement, um den Kunden zu informieren und Alternativen anzubieten.
3. **Automatisierung:** Integrieren Sie diese Überprüfung in einen automatisierten Prozess für Echtzeittransaktionen, insbesondere in Zeiten hoher Aktivität.

***

**Häufige Fehler und Lösungen**

1. **Fehler 404 nicht gefunden):**
   * **Ursache:** Ungültiger Endpunkt oder falsche Team-ID.
   * **Lösung:** Überprüfen Sie die URL und die verwendete Team-ID.
2. **Fehler 401 (nicht autorisiert):**
   * **Ursache:** Authentifizierungsproblem.
   * **Lösung:** Überprüfen Sie das Authentifizierungstoken und stellen Sie sicher, dass es gültig und aktiv ist.
3. **Fehler 400 (Ungültige Anfrage):**
   * **Ursache:** Falsches JSON-Format oder fehlende Daten.
   * **Lösung:** Stellen Sie sicher, dass der gesendete JSON-Code korrekt formatiert ist und alle erforderlichen Informationen enthalten sind.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.yoplanning.support/de/developpeur/tutoriel-dacces-au-catalogue/verification-de-la-disponibilite-via-lapi-yoplanning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
