# Reference-only example. Transport and reconciliation are supplied by the application.
def create_reference_transaction(send, request, reconcile):
    try:
        response = send(method="POST", path="/v1/signing-transactions", body=request)
    except (TimeoutError, ConnectionError):
        return {"outcome": "UNCERTAIN", "next": "RECONCILE", "detail": reconcile(request)}
    status = response["status"]
    if status == 202:
        return {"outcome": "ACCEPTED", "transaction_id": response["body"]["transaction_id"], "next": "FOLLOW_STATE_OR_WEBHOOK"}
    if status in (400, 422):
        return {"outcome": "INVALID_INPUT", "next": "CORRECT_INPUT"}
    if status in (409, 503):
        return {"outcome": "RECONCILE", "next": "REVIEW_STORED_TRANSACTION"}
    if status == 401:
        return {"outcome": "ACCESS_REQUIRED", "next": "REVIEW_APPROVED_AUTHENTICATION"}
    return {"outcome": "UNEXPECTED", "next": "ESCALATE"}
