Home / Function/ create_invoice() — fastapi Function Reference

create_invoice() — fastapi Function Reference

Architecture documentation for the create_invoice() function in test_sub_callbacks.py from the fastapi codebase.

Entity Profile

Dependency Diagram

graph TD
  70aed025_8cef_033f_8d3c_dc15ecbac0c9["create_invoice()"]
  c7ec4853_513f_84fd_a1ef_04f2932e2fd2["test_sub_callbacks.py"]
  70aed025_8cef_033f_8d3c_dc15ecbac0c9 -->|defined in| c7ec4853_513f_84fd_a1ef_04f2932e2fd2
  style 70aed025_8cef_033f_8d3c_dc15ecbac0c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_sub_callbacks.py lines 54–71

def create_invoice(invoice: Invoice, callback_url: Optional[HttpUrl] = None):
    """
    Create an invoice.

    This will (let's imagine) let the API user (some external developer) create an
    invoice.

    And this path operation will:

    * Send the invoice to the client.
    * Collect the money from the client.
    * Send a notification back to the API user (the external developer), as a callback.
        * 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 {"msg": "Invoice received"}

Domain

Subdomains

Frequently Asked Questions

What does create_invoice() do?
create_invoice() is a function in the fastapi codebase, defined in tests/test_sub_callbacks.py.
Where is create_invoice() defined?
create_invoice() is defined in tests/test_sub_callbacks.py at line 54.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free