← Planung

Payload-Schemas

12 JSON-Schema-Definitionen fuer Events und API-Payloads nach Draft-07. Richtung in bedeutet eingehend in Campus (Webhook, Form), out bedeutet ausgehend an externe Dienste (Lexoffice, PayPal, E-Mail-Versand).

form_b2b_angebot_in [in]

Event: form.b2b.angebot.submit

B2B-Angebot Formular-Submit.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "laufzeit_monate",
        "firma",
        "ansprechpartner"
    ],
    "properties": {
        "laufzeit_monate": {
            "type": "integer",
            "minimum": 1,
            "maximum": 48
        },
        "firma": {
            "type": "object",
            "required": [
                "name",
                "strasse",
                "plz",
                "ort"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "maxLength": 200
                },
                "ust_id": {
                    "type": "string",
                    "pattern": "^DE\\d{9}$"
                }
            }
        },
        "ansprechpartner": {
            "type": "object",
            "required": [
                "vorname",
                "nachname",
                "email"
            ],
            "properties": {
                "email": {
                    "type": "string",
                    "format": "email"
                }
            }
        }
    }
}

form_ebook_kauf_in [in]

Event: form.ebook.kauf.submit

Ebook-Einmalkauf Formular.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "produkt_slug",
        "kaeufer"
    ],
    "properties": {
        "produkt_slug": {
            "type": "string"
        },
        "kaeufer": {
            "type": "object",
            "required": [
                "email",
                "rechnungsadresse"
            ],
            "properties": {
                "email": {
                    "type": "string",
                    "format": "email"
                }
            }
        }
    }
}

form_magic_code_request_in [in]

Event: form.login.magic_code.request

Magic-Code Anfrage.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "email"
    ],
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "maxLength": 200
        }
    }
}

form_magic_code_verify_in [in]

Event: form.login.magic_code.verify

Magic-Code Verify-Aktion.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "email",
        "code"
    ],
    "properties": {
        "email": {
            "type": "string",
            "format": "email"
        },
        "code": {
            "type": "string",
            "pattern": "^[A-Z0-9]{6,8}$"
        }
    }
}

paypal_webhook_payment_completed [in]

Event: webhook.paypal.payment.completed

PayPal Webhook PAYMENT.SALE.COMPLETED.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "id",
        "event_type",
        "resource"
    ],
    "properties": {
        "id": {
            "type": "string"
        },
        "event_type": {
            "const": "PAYMENT.SALE.COMPLETED"
        },
        "resource": {
            "type": "object",
            "required": [
                "id",
                "amount",
                "billing_agreement_id"
            ],
            "properties": {
                "id": {
                    "type": "string"
                },
                "amount": {
                    "type": "object",
                    "required": [
                        "total",
                        "currency"
                    ],
                    "properties": {
                        "total": {
                            "type": "string",
                            "pattern": "^\\d+\\.\\d{2}$"
                        },
                        "currency": {
                            "const": "EUR"
                        }
                    }
                },
                "billing_agreement_id": {
                    "type": "string"
                }
            }
        }
    }
}

paypal_webhook_payment_denied [in]

Event: webhook.paypal.payment.denied

PayPal Webhook PAYMENT.SALE.DENIED.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "id",
        "event_type"
    ],
    "properties": {
        "id": {
            "type": "string"
        },
        "event_type": {
            "const": "PAYMENT.SALE.DENIED"
        },
        "resource": {
            "type": "object",
            "required": [
                "id",
                "billing_agreement_id"
            ],
            "properties": {
                "id": {
                    "type": "string"
                },
                "billing_agreement_id": {
                    "type": "string"
                }
            }
        }
    }
}

lexoffice_voucher_create_out [out]

Event: api.lexoffice.voucher.create

Lexoffice Rechnung oder Gutschrift anlegen.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "voucherType",
        "voucherDate",
        "address",
        "lineItems",
        "totalPrice"
    ],
    "properties": {
        "voucherType": {
            "enum": [
                "invoice",
                "creditnote"
            ]
        },
        "voucherDate": {
            "type": "string",
            "format": "date"
        },
        "address": {
            "type": "object",
            "required": [
                "name",
                "city",
                "zip"
            ],
            "properties": {
                "name": {
                    "type": "string"
                },
                "street": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "zip": {
                    "type": "string"
                }
            }
        },
        "lineItems": {
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "name",
                    "quantity",
                    "unitPrice"
                ]
            }
        },
        "totalPrice": {
            "type": "object",
            "required": [
                "currency",
                "totalNetAmount"
            ]
        }
    }
}

paypal_subscription_create_out [out]

Event: api.paypal.subscription.create

Subscription anlegen bei PayPal.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "plan_id",
        "subscriber"
    ],
    "properties": {
        "plan_id": {
            "type": "string"
        },
        "subscriber": {
            "type": "object",
            "required": [
                "email_address",
                "name"
            ],
            "properties": {
                "email_address": {
                    "type": "string",
                    "format": "email"
                },
                "name": {
                    "type": "object",
                    "properties": {
                        "given_name": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}

mail_follow_up_out [out]

Event: mail.angebot.follow_up

Follow-up-Mail Stufe 1-3.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "to",
        "subject",
        "template",
        "vars"
    ],
    "properties": {
        "to": {
            "type": "string",
            "format": "email"
        },
        "template": {
            "enum": [
                "follow_up_1",
                "follow_up_2",
                "follow_up_3"
            ]
        },
        "vars": {
            "type": "object",
            "required": [
                "firma_name",
                "annahme_link"
            ]
        }
    }
}

mail_angebot_initial_out [out]

Event: mail.angebot.initial

Initiale Angebots-Mail.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "to",
        "subject",
        "template",
        "vars"
    ],
    "properties": {
        "to": {
            "type": "string",
            "format": "email"
        },
        "subject": {
            "type": "string"
        },
        "template": {
            "const": "angebot_initial"
        },
        "vars": {
            "type": "object",
            "properties": {
                "firma_name": {
                    "type": "string"
                },
                "angebot_pdf_url": {
                    "type": "string",
                    "format": "uri"
                },
                "annahme_link": {
                    "type": "string",
                    "format": "uri"
                }
            }
        }
    }
}

mail_mahnung_out [out]

Event: mail.mahnwesen.mahnung

Mahnung Stufe 1-3.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "to",
        "template",
        "vars"
    ],
    "properties": {
        "to": {
            "type": "string",
            "format": "email"
        },
        "template": {
            "enum": [
                "mahnung_1",
                "mahnung_2",
                "mahnung_3"
            ]
        },
        "vars": {
            "type": "object",
            "required": [
                "rechnung_nr",
                "betrag",
                "faellig_am"
            ]
        }
    }
}

mail_zertifikat_out [out]

Event: mail.zertifikat.versand

Zertifikat-Versand mit PDF-Anhang und Hash.

JSON-Schema anzeigen
{
    "type": "object",
    "required": [
        "to",
        "template",
        "vars",
        "anhang"
    ],
    "properties": {
        "to": {
            "type": "string",
            "format": "email"
        },
        "template": {
            "const": "zertifikat"
        },
        "vars": {
            "type": "object",
            "required": [
                "teilnehmer_name",
                "produkt_name",
                "zertifikat_nr"
            ]
        },
        "anhang": {
            "type": "object",
            "required": [
                "filename",
                "sha256"
            ],
            "properties": {
                "filename": {
                    "type": "string"
                },
                "sha256": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                }
            }
        }
    }
}