# DepositPreauth

[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/DepositPreauth.cpp)

Grant preauthorization to send payments to your account. This is only useful if you are using (or plan to use) [Deposit Authorization](/docs/concepts/accounts/depositauth).

You can use this transaction before you enable Deposit Authorization. This may be useful to ensure a smooth transition from not requiring deposit authorization to requiring it.

DepositPreauth
## Example  JSON

Single account preauthorization

```json
{
  "TransactionType" : "DepositPreauth",
  "Account" : "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
  "Authorize" : "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
  "Fee" : "10",
  "Flags" : 2147483648,
  "Sequence" : 2
}
```

Credential preauthorization

```json
{
  "TransactionType" : "DepositPreauth",
  "Account" : "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
  "AuthorizeCredentials": [{
    "Credential": {
      "Issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
      "CredentialType": "6D795F63726564656E7469616C"
    }
  }],
  "Fee" : "10",
  "Flags": 0,
  "Sequence": 230984
}
```

##  Fields

In addition to the [common fields](/docs/references/protocol/transactions/common-fields),  transactions use the following fields:

| Field | JSON Type | [Internal Type](/docs/references/protocol/binary-format) | Required? | Description |
|  --- | --- | --- | --- | --- |
| `Authorize` | String - [Address](/docs/references/protocol/data-types/basic-data-types#addresses) | AccountID | No | An account to preauthorize. |
| `AuthorizeCredentials` | Array | Array | No | A set of credentials to authorize.  |
| `Unauthorize` | String | AccountID | No | An account whose preauthorization should be revoked. |
| `UnauthorizeCredentials` | Array | Array | No | A set of credentials whose preauthorization should be revoked.  |


You must provide **exactly one** of `Authorize`, `AuthorizeCredentials`, `Unauthorize`, or `UnauthorizeCredentials`.

If this transaction is successful, it creates or removes a [DepositPreauth entry](/docs/references/protocol/ledger-data/ledger-entry-types/depositpreauth) in the ledger, based on the field provided.

### AuthorizeCredentials Objects

If provided, each member of the `AuthorizeCredentials` field or `UnauthorizeCredentials` field must be an inner object with the following fields:

| Field | JSON Type | [Internal Type](/docs/references/protocol/binary-format) | Required? | Description |
|  --- | --- | --- | --- | --- |
| `Issuer` | String - [Address](/docs/references/protocol/data-types/basic-data-types#addresses) | AccountID | Yes | The issuer of the credential. |
| `CredentialType` | String - Hexadecimal | Blob | Yes | The credential type of the credential. |


## Error Cases

In addition to error types that can occur for all transactions, DepositPreauth transactions can result in the following error codes:

| Error Code | Description |
|  --- | --- |
| `tecDUPLICATE` | The transaction would create a preauthorization that already exists. |
| `tecINSUFFICIENT_RESERVE` | The sender would not meet the [reserve requirement](/docs/concepts/accounts/reserves) after adding another entry to the ledger. (A DepositPreauth entry counts as one item towards the authorizer's owner reserve.) |
| `tecNO_ENTRY` | The transaction tried to revoke a preauthorization that does not exist in the ledger. |
| `tecNO_ISSUER` | One or more specified credential issuers does not exist in the ledger. |
| `tecNO_TARGET` | The transaction tried to authorize an account that is not a funded account in the ledger. |
| `temCANNOT_PREAUTH_SELF` | The address in the `Authorize` field is the sender of the transaction. You cannot preauthorize yourself. |
| `temDISABLED` | A required amendment is not enabled. |


## See Also

- [DepositPreauth object](/docs/references/protocol/ledger-data/ledger-entry-types/depositpreauth)