Results of 1 - 1 of about 1 for InvoiceEvent (0.001 sec.)
- OpenAPI Callbacks 9414
- OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre
...= FastAPI () class Invoice ( BaseModel ): id : str title : Union [ str , None ] = None customer : str total : float class InvoiceEvent ( BaseModel ): description : str paid : bool class InvoiceEventReceived ( BaseModel ): ok : bool invoices_callback_router...= APIRouter () @invoices_callback_router . post ( "{$callback_url}/invoices/{$request.body.id}" , response_model = InvoiceEventReceived ) def invoice_notification ( body : InvoiceEvent ): pass @app . post ( "/invoices/" , callbacks = invoices_callbac...allback. * At this point is that the API will somehow send a POST request to the external API with the notification of the invoice event (e.g. "payment successful"). """ # Send the invoice, collect the money, send the notification (the callback) return { "ms... - https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
PREV
1
NEXT