> For the complete documentation index, see [llms.txt](https://developers.docs.bantufoundation.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docs.bantufoundation.org/api/errors/http-status-codes/horizon-specific/transaction-malformed.md).

# Transaction Malformed

The `transaction_malformed` error returns a [`400` error code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) and occurs when a client submits a malformed transaction.

There are many ways in which a transaction could be malformed, including:&#x20;

1. You submitted an empty string.
2. Your base64-encoded string is invalid.
3. Your [XDR](/api/introduction/xdr.md) structure is invalid.
4. You have leftover bytes in your [XDR](/api/introduction/xdr.md) structure.

```bash
{
  "type": "https://expansion-testnet.bantu.network/horizon-errors/transaction_malformed",
  "title": "Transaction Malformed",
  "status": 400,
  "detail": "Horizon could not decode the transaction envelope in this request. A transaction should be an XDR TransactionEnvelope struct encoded using base64.  The envelope read from this request is echoed in the `extras.envelope_xdr` field of this response for your convenience.",
  "extras": {
    "envelope_xdr": "BBBBBPORy3CoX6ox2ilbeiVjBA5WlpCSZRcjZ7VE9Wf4QVk7AAAAZAAAQz0AAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAA85HLcKhfqjHaKVt6JWMEDlaWkJJlFyNntUT1Z/hBWTsAAAAAAAAAAAL68IAAAAAAAAAAARN17BEAAABAA9Ad7OKc7y60NT/JuobaHOfmuq8KbZqcV6G/es94u9yT84fi0aI7tJsFMOyy8cZ4meY3Nn908OU+KfRWV40UCw=="
  }
}
```
