def METHOD_NAME(order):
    if order.is_draft() or order.is_unconfirmed() or order.is_expired():
        raise ValidationError(
            {
                "orderId": ValidationError(
                    "Cannot request an invoice for draft, "
                    "unconfirmed or expired order.",
                    code=InvoiceErrorCode.INVALID_STATUS.value,
                )
            }
        )
    if not order.billing_address:
        raise ValidationError(
            {
                "orderId": ValidationError(
                    "Cannot request an invoice for order without billing address.",
                    code=InvoiceErrorCode.NOT_READY.value,
                )
            }
        )