# GET /v2/auth/webhook/paypal

Signierte PayPal-Ereignisse verarbeiten

Empfängt den originalen PayPal-JSON-Body und prüft Provider-Signatur samt Übertragungsheadern, bevor Zahlungen, Rückerstattungen oder Händlerverbindungsstatus verarbeitet werden. Die Antwort wird früh bestätigt; ihr Erfolg beweist keine fachliche Verarbeitung. Der Legacy-GET-Alias nutzt denselben Body-Handler und kann bei gültigem Provider-Ereignis Daten verändern. Kein data-Envelope um das Provider-Event legen.

- Operation-ID: get_v2_auth_webhook_paypal
- Dokumentation: /docs/api/v2/operations/get-v2-auth-webhook-paypal-c3d16760c59a/
- OpenAPI-Version: 3.2.1
- Vollständige Spezifikation: /docs/api/v2/openapi.json
- Dokumentationsstatus: reviewed
- Ändert Zustand: ja
- Für Automation freigegeben: nein

## Server

Serverwerte stammen unverändert aus der Datei. Eine lokale Entwicklungsadresse ist keine bestätigte Produktionsadresse. `API_ORIGIN` muss auf die passende Instanz gesetzt werden.

```json
[
  {
    "url": "https://app2.edoobox.com",
    "description": "edoobox API"
  }
]
```

## Authentifizierung

Für diesen Endpunkt deklariert die Spezifikation keine OpenAPI-Authentifizierung (`security: []`). Weitere Bedingungen stehen in der Beschreibung und den edoobox-Hinweisen.

### Wirksame Security Requirements und vollständige Verfahren

```json
{
  "security": [],
  "securitySchemes": {}
}
```

## Parameter

| Name | Ort | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| PAYPAL-CERT-URL | header | ja | Originaler PayPal-Verifikationsheader. |
| PAYPAL-TRANSMISSION-ID | header | ja | Originaler PayPal-Verifikationsheader. |
| PAYPAL-TRANSMISSION-TIME | header | ja | Originaler PayPal-Verifikationsheader. |
| PAYPAL-TRANSMISSION-SIG | header | ja | Originaler PayPal-Verifikationsheader. |
| PAYPAL-AUTH-ALGO | header | ja | Originaler PayPal-Verifikationsheader. |

### Vollständige wirksame Parameterdefinitionen

```json
[
  {
    "name": "PAYPAL-CERT-URL",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    },
    "description": "Originaler PayPal-Verifikationsheader."
  },
  {
    "name": "PAYPAL-TRANSMISSION-ID",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    },
    "description": "Originaler PayPal-Verifikationsheader."
  },
  {
    "name": "PAYPAL-TRANSMISSION-TIME",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    },
    "description": "Originaler PayPal-Verifikationsheader."
  },
  {
    "name": "PAYPAL-TRANSMISSION-SIG",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    },
    "description": "Originaler PayPal-Verifikationsheader."
  },
  {
    "name": "PAYPAL-AUTH-ALGO",
    "in": "header",
    "required": true,
    "schema": {
      "type": "string"
    },
    "description": "Originaler PayPal-Verifikationsheader."
  }
]
```

## Anfrage

```json
{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "resource": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true,
        "required": [
          "id",
          "event_type",
          "resource"
        ]
      },
      "examples": {
        "request": {
          "summary": "Signierte PayPal-Ereignisse verarbeiten",
          "value": {
            "id": "WH-SYNTHETIC-EVENT",
            "event_type": "MERCHANT.ONBOARDING.COMPLETED",
            "resource": {
              "tracking_id": "account_012345abcdef_123456",
              "merchant_id": "SYNTHETIC-MERCHANT"
            }
          }
        }
      }
    }
  },
  "required": true
}
```

## Antworten

HTTP-Status und Antwortinhalt gemeinsam auswerten. Die folgenden Beschreibungen und Schemata sind die Angaben der Quelldatei.

```json
{
  "200": {
    "description": "Frühe Textbestätigung success; tatsächliche Verarbeitung erfolgt anschließend.",
    "content": {
      "text/html": {
        "schema": {
          "type": "string"
        },
        "example": "success"
      }
    }
  },
  "400": {
    "description": "Invalid request.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40006"
        }
      }
    }
  },
  "401": {
    "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40103"
        }
      }
    }
  },
  "402": {
    "description": "Missing/invalid action data or subscription/operation restriction.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80100"
        }
      }
    }
  },
  "403": {
    "description": "Permission denied. Browser CORS rejection may have an empty body.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED40340"
        }
      }
    }
  },
  "404": {
    "description": "Unknown resource/action or unsupported method.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80019"
        }
      }
    }
  },
  "422": {
    "description": "Validation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED80020"
        }
      }
    }
  },
  "429": {
    "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED42902"
        }
      }
    },
    "headers": {
      "Retry-After": {
        "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
        "schema": {
          "type": "string",
          "examples": [
            "30"
          ]
        }
      }
    }
  },
  "502": {
    "description": "Server-side operation failed.",
    "content": {
      "application/json": {
        "example": {
          "success": false,
          "error": "ED50201"
        }
      }
    }
  }
}
```

## Aufrufbeispiele

Anpassen vor dem Ausführen. Platzhalter und veröffentlichte Beispiele sind synthetisch. Die Beispiele senden hier keine Anfrage; sie ergänzen keine unbekannten Pflichtfelder.

### cURL

```sh
# Request Body: synthetisches Beispiel aus der Spezifikation; Werte und Vollständigkeit vor Verwendung prüfen.
: "${API_ORIGIN:?API_ORIGIN setzen}"
: "${HEADER_PAYPAL_CERT_URL:?HEADER_PAYPAL_CERT_URL setzen}"
: "${HEADER_PAYPAL_TRANSMISSION_ID:?HEADER_PAYPAL_TRANSMISSION_ID setzen}"
: "${HEADER_PAYPAL_TRANSMISSION_TIME:?HEADER_PAYPAL_TRANSMISSION_TIME setzen}"
: "${HEADER_PAYPAL_TRANSMISSION_SIG:?HEADER_PAYPAL_TRANSMISSION_SIG setzen}"
: "${HEADER_PAYPAL_AUTH_ALGO:?HEADER_PAYPAL_AUTH_ALGO setzen}"
cat > payload.json <<'EDOOBOX_JSON_EXAMPLE'
{
  "id": "WH-SYNTHETIC-EVENT",
  "event_type": "MERCHANT.ONBOARDING.COMPLETED",
  "resource": {
    "tracking_id": "account_012345abcdef_123456",
    "merchant_id": "SYNTHETIC-MERCHANT"
  }
}
EDOOBOX_JSON_EXAMPLE
curl --request 'GET' \
  --url "${API_ORIGIN%/}"'/v2/auth/webhook/paypal' \
  --header 'PAYPAL-CERT-URL: '"${HEADER_PAYPAL_CERT_URL}" \
  --header 'PAYPAL-TRANSMISSION-ID: '"${HEADER_PAYPAL_TRANSMISSION_ID}" \
  --header 'PAYPAL-TRANSMISSION-TIME: '"${HEADER_PAYPAL_TRANSMISSION_TIME}" \
  --header 'PAYPAL-TRANSMISSION-SIG: '"${HEADER_PAYPAL_TRANSMISSION_SIG}" \
  --header 'PAYPAL-AUTH-ALGO: '"${HEADER_PAYPAL_AUTH_ALGO}" \
  --header 'Content-Type: application/json' \
  --data-binary '@payload.json'
```

### JavaScript (Node.js)

```javascript
// Fetch unterstützt GET mit Request Body nicht.
// Verwende das cURL- oder Python-Beispiel oder einen HTTP-Client mit Unterstützung dieser Methode.
throw new Error("Für GET mit Request Body ist kein gültiges Fetch-Beispiel verfügbar.");
```

### Python

```python
# Request Body: synthetisches Beispiel aus der Spezifikation; Werte und Vollständigkeit vor Verwendung prüfen.
import os
import urllib.parse
import urllib.request
import urllib.error

path = "/v2/auth/webhook/paypal"
url = os.environ["API_ORIGIN"].rstrip("/") + path
headers = {}
headers["PAYPAL-CERT-URL"] = "" + os.environ["HEADER_PAYPAL_CERT_URL"]
headers["PAYPAL-TRANSMISSION-ID"] = "" + os.environ["HEADER_PAYPAL_TRANSMISSION_ID"]
headers["PAYPAL-TRANSMISSION-TIME"] = "" + os.environ["HEADER_PAYPAL_TRANSMISSION_TIME"]
headers["PAYPAL-TRANSMISSION-SIG"] = "" + os.environ["HEADER_PAYPAL_TRANSMISSION_SIG"]
headers["PAYPAL-AUTH-ALGO"] = "" + os.environ["HEADER_PAYPAL_AUTH_ALGO"]
headers["Content-Type"] = "application/json"
body = "{\"id\":\"WH-SYNTHETIC-EVENT\",\"event_type\":\"MERCHANT.ONBOARDING.COMPLETED\",\"resource\":{\"tracking_id\":\"account_012345abcdef_123456\",\"merchant_id\":\"SYNTHETIC-MERCHANT\"}}".encode("utf-8")

# Redirects nicht automatisch verfolgen.
class NoRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None
request = urllib.request.Request(url, headers=headers, method="GET", data=body)
try:
    response = urllib.request.build_opener(NoRedirect).open(request, timeout=30)
except urllib.error.HTTPError as error:
    response = error
print(response.status, response.read().decode("utf-8", errors="replace"))
# HTTP-Status und dokumentierte error/success-Felder gemeinsam prüfen.
```

## Vollständige Operationsdefinition und edoobox-Hinweise

Alle Originalfelder einschliesslich `x-edoobox-*`, requestBody und responses bleiben erhalten. Teilweise dokumentierte Schemata sind kein vollständiger Validierungsvertrag.

```json
{
  "operationId": "get_v2_auth_webhook_paypal",
  "summary": "Signierte PayPal-Ereignisse verarbeiten",
  "description": "Empfängt den originalen PayPal-JSON-Body und prüft Provider-Signatur samt Übertragungsheadern, bevor Zahlungen, Rückerstattungen oder Händlerverbindungsstatus verarbeitet werden. Die Antwort wird früh bestätigt; ihr Erfolg beweist keine fachliche Verarbeitung. Der Legacy-GET-Alias nutzt denselben Body-Handler und kann bei gültigem Provider-Ereignis Daten verändern. Kein data-Envelope um das Provider-Event legen.",
  "tags": [
    "auth"
  ],
  "security": [],
  "parameters": [
    {
      "name": "PAYPAL-CERT-URL",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Originaler PayPal-Verifikationsheader."
    },
    {
      "name": "PAYPAL-TRANSMISSION-ID",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Originaler PayPal-Verifikationsheader."
    },
    {
      "name": "PAYPAL-TRANSMISSION-TIME",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Originaler PayPal-Verifikationsheader."
    },
    {
      "name": "PAYPAL-TRANSMISSION-SIG",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Originaler PayPal-Verifikationsheader."
    },
    {
      "name": "PAYPAL-AUTH-ALGO",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Originaler PayPal-Verifikationsheader."
    }
  ],
  "responses": {
    "200": {
      "description": "Frühe Textbestätigung success; tatsächliche Verarbeitung erfolgt anschließend.",
      "content": {
        "text/html": {
          "schema": {
            "type": "string"
          },
          "example": "success"
        }
      }
    },
    "400": {
      "description": "Invalid request.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40006"
          }
        }
      }
    },
    "401": {
      "description": "Missing/expired token, missing account context, account paused or model-specific authorization failure.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40103"
          }
        }
      }
    },
    "402": {
      "description": "Missing/invalid action data or subscription/operation restriction.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80100"
          }
        }
      }
    },
    "403": {
      "description": "Permission denied. Browser CORS rejection may have an empty body.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED40340"
          }
        }
      }
    },
    "404": {
      "description": "Unknown resource/action or unsupported method.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80019"
          }
        }
      }
    },
    "422": {
      "description": "Validation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED80020"
          }
        }
      }
    },
    "429": {
      "description": "Request/login rate limit exceeded. Honor Retry-After when supplied; legacy rate-limit paths may omit it. Retry only proven reads within a bounded deadline; a mutation is never automatically replayed after an ambiguous response.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED42902"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "description": "Optional server delay in whole seconds or an HTTP date. Absence is not permission for an immediate retry.",
          "schema": {
            "type": "string",
            "examples": [
              "30"
            ]
          }
        }
      }
    },
    "502": {
      "description": "Server-side operation failed.",
      "content": {
        "application/json": {
          "example": {
            "success": false,
            "error": "ED50201"
          }
        }
      }
    }
  },
  "x-edoobox-mutates-state": true,
  "x-edoobox-runtimeMutationGuard": false,
  "x-edoobox-get-effect": "business-mutation",
  "x-edoobox-documentationReview": {
    "file": "docs/openapi/operation-contracts/05-auth.json",
    "notes": []
  },
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "event_type": {
              "type": "string"
            },
            "resource": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "additionalProperties": true,
          "required": [
            "id",
            "event_type",
            "resource"
          ]
        },
        "examples": {
          "request": {
            "summary": "Signierte PayPal-Ereignisse verarbeiten",
            "value": {
              "id": "WH-SYNTHETIC-EVENT",
              "event_type": "MERCHANT.ONBOARDING.COMPLETED",
              "resource": {
                "tracking_id": "account_012345abcdef_123456",
                "merchant_id": "SYNTHETIC-MERCHANT"
              }
            }
          }
        }
      }
    },
    "required": true
  },
  "x-edoobox-source": {
    "file": "application/controllers/V2.php",
    "method": "coreV2",
    "line": 28
  },
  "x-edoobox-documentationStatus": "reviewed",
  "x-edoobox-readOnly": false,
  "x-edoobox-safeForAutomation": false,
  "x-edoobox-permission": {
    "description": "No account-JWT resource permission levels are applied. Authentication requirements, if any, are defined by this route source-specific boundary and dedicated security scheme.",
    "checkedByDispatcher": false,
    "levels": []
  }
}
```
