# API Mutations

Source: https://fragment.dev/api-reference/ledger-mutations

[Documentation index](https://fragment.dev/llms.txt)

<a id="ledger-mutations"></a>

<a id="addledgerentries"></a>

## addLedgerEntries

Batch version of [addLedgerEntry](https://fragment.dev/markdown/api-reference/ledger-mutations.md#addledgerentry).

###### Response
Returns an [AddLedgerEntriesResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-addledgerentriesresponse)

```graphql
mutation AddLedgerEntries($entries: [AddLedgerEntryInput!]!) {
  addLedgerEntries(entries: $entries) {
    ... on AddLedgerEntriesError {
      ...AddLedgerEntriesErrorFragment
    }
    ... on AddLedgerEntriesResult {
      ...AddLedgerEntriesResultFragment
    }
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"entries": [AddLedgerEntryInput]}
```

```json
{"data": {"addLedgerEntries": AddLedgerEntriesError\}\}
```

###### Arguments

- **entries** ([[AddLedgerEntryInput!]!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-addledgerentryinput))

  The Ledger Entries to post, each with its own [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency).

<a id="addledgerentry"></a>

## addLedgerEntry

Adds a Ledger Entry to a Ledger. This Ledger Entry cannot be into a Linked Ledger Account. For that, use [reconcileTx](https://fragment.dev/markdown/api-reference/ledger-mutations.md#reconciletx)

###### Response
Returns an [AddLedgerEntryResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-addledgerentryresponse)

```graphql
mutation AddLedgerEntry(
  $entry: LedgerEntryInput!,
  $ik: SafeString!
) {
  addLedgerEntry(
    entry: $entry,
    ik: $ik
  ) {
    ... on AddLedgerEntryResult {
      ...AddLedgerEntryResultFragment
    }
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"entry": LedgerEntryInput, "ik": "some-safe-string-ik"}
```

```json
{"data": {"addLedgerEntry": AddLedgerEntryResult\}\}
```

###### Arguments

- **entry** ([LedgerEntryInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-ledgerentryinput))

  An object containing the [Ledger Lines](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-ledgerlineinput) as well as an optional description and posted timestamp.

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency)

<a id="createcustomcurrency"></a>

## createCustomCurrency

Creates a custom currency.

###### Response
Returns a [CreateCustomCurrencyResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-createcustomcurrencyresponse)

```graphql
mutation CreateCustomCurrency($customCurrency: CreateCustomCurrencyInput!) {
  createCustomCurrency(customCurrency: $customCurrency) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on CreateCustomCurrencyResult {
      ...CreateCustomCurrencyResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"customCurrency": CreateCustomCurrencyInput}
```

```json
{"data": {"createCustomCurrency": BadRequestError\}\}
```

###### Arguments

- **customCurrency** ([CreateCustomCurrencyInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-createcustomcurrencyinput))

  The custom currency to be created.

<a id="createcustomlink"></a>

## createCustomLink

Custom Links let you integrate external systems that don't have native support. See [Custom Links](https://fragment.dev/markdown/guides/sync-payments.md#custom-link)

###### Response
Returns a [CreateCustomLinkResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-createcustomlinkresponse)

```graphql
mutation CreateCustomLink(
  $ik: SafeString!,
  $name: String!
) {
  createCustomLink(
    ik: $ik,
    name: $name
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on CreateCustomLinkResult {
      ...CreateCustomLinkResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"ik": "some-safe-string-ik", "name": "abc123"}
```

```json
{"data": {"createCustomLink": BadRequestError\}\}
```

###### Arguments

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency)

- **name** ([String!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-string))

  The name of your custom link

<a id="createledger"></a>

## createLedger

Creates a Ledger.

###### Response
Returns a [CreateLedgerResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-createledgerresponse)

```graphql
mutation CreateLedger(
  $ik: SafeString!,
  $ledger: CreateLedgerInput!,
  $schema: SchemaMatchInput
) {
  createLedger(
    ik: $ik,
    ledger: $ledger,
    schema: $schema
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on CreateLedgerResult {
      ...CreateLedgerResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{
  "ik": "some-safe-string-ik",
  "ledger": CreateLedgerInput,
  "schema": SchemaMatchInput
}
```

```json
{"data": {"createLedger": BadRequestError\}\}
```

###### Arguments

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency)

- **ledger** ([CreateLedgerInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-createledgerinput))

  The payload representing the Ledger to be created

- **schema** ([SchemaMatchInput](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-schemamatchinput))

  The Schema to create this Ledger with

<a id="createpayment"></a>

## createPayment

Create a Payment.

###### Response
Returns a [CreatePaymentResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-createpaymentresponse)

```graphql
mutation CreatePayment(
  $ik: SafeString!,
  $ledger: LedgerMatchInput!,
  $payment: CreatePaymentInput!
) {
  createPayment(
    ik: $ik,
    ledger: $ledger,
    payment: $payment
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on CreatePaymentResult {
      ...CreatePaymentResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{
  "ik": "some-safe-string-ik",
  "ledger": LedgerMatchInput,
  "payment": CreatePaymentInput
}
```

```json
{"data": {"createPayment": BadRequestError\}\}
```

###### Arguments

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency). Can be up to 128 characters long.

- **ledger** ([LedgerMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgermatchinput))

  The Ledger this Payment belongs to.

- **payment** ([CreatePaymentInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-createpaymentinput))

  The Payment to create.

<a id="createpaymentmethodsetup"></a>

## createPaymentMethodSetup

Save a Payment Method for a User without charging it.

###### Response
Returns a [CreatePaymentMethodSetupResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-createpaymentmethodsetupresponse)

```graphql
mutation CreatePaymentMethodSetup(
  $ik: SafeString!,
  $ledger: LedgerMatchInput!,
  $user: UserMatchInput!
) {
  createPaymentMethodSetup(
    ik: $ik,
    ledger: $ledger,
    user: $user
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on CreatePaymentMethodSetupResult {
      ...CreatePaymentMethodSetupResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{
  "ik": "some-safe-string-ik",
  "ledger": LedgerMatchInput,
  "user": UserMatchInput
}
```

```json
{"data": {"createPaymentMethodSetup": BadRequestError\}\}
```

###### Arguments

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency) for the Payment Method Setup. Can be up to 128 characters long. This is not the idempotency key for the saved Payment Method.

- **ledger** ([LedgerMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgermatchinput))

  The Ledger the Payment Method is saved in.

- **user** ([UserMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-usermatchinput))

  The User whose payment method to save.

<a id="deletecustomtxs"></a>

## deleteCustomTxs

Delete Txs on a Custom Link. Once deleted, a Tx will not show up in listing queries, but can be resolved by if you lookup by its Fragment  ID.

###### Response
Returns a [DeleteCustomTxsResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-deletecustomtxsresponse)

```graphql
mutation DeleteCustomTxs($txs: [ID!]!) {
  deleteCustomTxs(txs: $txs) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on DeleteCustomTxsResult {
      ...DeleteCustomTxsResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"txs": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"}
```

```json
{"data": {"deleteCustomTxs": BadRequestError\}\}
```

###### Arguments

- **txs** ([[ID!]!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-id))

  The Fragment  IDs of the Txs to delete

<a id="deleteledger"></a>

## deleteLedger

Delete a Ledger.

###### Response
Returns a [DeleteLedgerResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-deleteledgerresponse)

```graphql
mutation DeleteLedger($ledger: LedgerMatchInput!) {
  deleteLedger(ledger: $ledger) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on DeleteLedgerResult {
      ...DeleteLedgerResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"ledger": LedgerMatchInput}
```

```json
{"data": {"deleteLedger": BadRequestError\}\}
```

###### Arguments

- **ledger** ([LedgerMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgermatchinput))

<a id="deletepaymentmethod"></a>

## deletePaymentMethod

Delete a Payment Method saved for a User.

###### Response
Returns a [DeletePaymentMethodResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-deletepaymentmethodresponse)

```graphql
mutation DeletePaymentMethod($paymentMethod: PaymentMethodMatchInput!) {
  deletePaymentMethod(paymentMethod: $paymentMethod) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on DeletePaymentMethodResult {
      ...DeletePaymentMethodResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"paymentMethod": PaymentMethodMatchInput}
```

```json
{"data": {"deletePaymentMethod": BadRequestError\}\}
```

###### Arguments

- **paymentMethod** ([PaymentMethodMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-paymentmethodmatchinput))

  The Payment Method to delete.

<a id="deleteschema"></a>

## deleteSchema

Delete a Schema

###### Response
Returns a [DeleteSchemaResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-deleteschemaresponse)

```graphql
mutation DeleteSchema($schema: SchemaMatchInput!) {
  deleteSchema(schema: $schema) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on DeleteSchemaResult {
      ...DeleteSchemaResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{"schema": SchemaMatchInput}
```

```json
{"data": {"deleteSchema": BadRequestError\}\}
```

###### Arguments

- **schema** ([SchemaMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-schemamatchinput))

<a id="instantiateledgeraccount"></a>

## instantiateLedgerAccount

Instantiates a Ledger Account from a template in the Ledger's Schema before any Ledger Entry is posted to it. Creates any missing templated ancestors.

###### Response
Returns an [InstantiateLedgerAccountResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-instantiateledgeraccountresponse)

```graphql
mutation InstantiateLedgerAccount(
  $ledger: LedgerMatchInput!,
  $parameters: Parameters,
  $path: String!
) {
  instantiateLedgerAccount(
    ledger: $ledger,
    parameters: $parameters,
    path: $path
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InstantiateLedgerAccountResult {
      ...InstantiateLedgerAccountResultFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
  }
}
```

```json
{
  "ledger": LedgerMatchInput,
  "parameters": {"bank_name": "bank-name", "deposit_amount": "10000"},
  "path": "abc123"
}
```

```json
{"data": {"instantiateLedgerAccount": BadRequestError\}\}
```

###### Arguments

- **ledger** ([LedgerMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgermatchinput))

  The Ledger whose Schema defines the account.

- **parameters** ([Parameters](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-parameters))

  Values for every parameter the account's template references: name, currency, and linked account fields.

- **path** ([String!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-string))

  The fully instantiated path of the account, e.g. assets/customer:cust-1. Must not contain placeholders.

<a id="migrateledgerentry"></a>

## migrateLedgerEntry

Migrate an existing Ledger Entry to a new type and typeVersion.

###### Response
Returns a [MigrateLedgerEntryResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-migrateledgerentryresponse)

```graphql
mutation MigrateLedgerEntry($input: MigrateLedgerEntryInput!) {
  migrateLedgerEntry(input: $input) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on MigrateLedgerEntryResult {
      ...MigrateLedgerEntryResultFragment
    }
  }
}
```

```json
{"input": MigrateLedgerEntryInput}
```

```json
{"data": {"migrateLedgerEntry": BadRequestError\}\}
```

###### Arguments

- **input** ([MigrateLedgerEntryInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-migrateledgerentryinput))

<a id="reconciletx"></a>

## reconcileTx

This mutation is used to [reconcile](https://fragment.dev/markdown/guides/reconcile-payments.md#reconcile-a-tx) transactions from an external system into a Ledger Entry. This mutation does not require an idempotency key since a transaction can only be reconciled once per Linked Ledger Account. If you are reconciling a transfer between two Link Accounts which are both linked to the same Ledger, use a transit account in between to split the transfer into two reconcileTx calls.

###### Response
Returns a [ReconcileTxResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-reconciletxresponse)

```graphql
mutation ReconcileTx($entry: LedgerEntryInput!) {
  reconcileTx(entry: $entry) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on ReconcileTxResult {
      ...ReconcileTxResultFragment
    }
  }
}
```

```json
{"entry": LedgerEntryInput}
```

```json
{"data": {"reconcileTx": BadRequestError\}\}
```

###### Arguments

- **entry** ([LedgerEntryInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-ledgerentryinput))

  The ledger entry containing lines that specify the transaction from a linked ledger account to reconcile, as well as the ledger account with which to offset the external transaction.

<a id="refundpayment"></a>

## refundPayment

Refund a settled Payment.

###### Response
Returns a [RefundPaymentResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-refundpaymentresponse)

```graphql
mutation RefundPayment(
  $ik: SafeString!,
  $payment: PaymentMatchInput!,
  $refund: RefundPaymentInput!
) {
  refundPayment(
    ik: $ik,
    payment: $payment,
    refund: $refund
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on RefundPaymentResult {
      ...RefundPaymentResultFragment
    }
  }
}
```

```json
{
  "ik": "some-safe-string-ik",
  "payment": PaymentMatchInput,
  "refund": RefundPaymentInput
}
```

```json
{"data": {"refundPayment": BadRequestError\}\}
```

###### Arguments

- **ik** ([SafeString!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-safestring))

  The [Idempotency Key](https://fragment.dev/markdown/api-reference/ledger-overview.md#idempotency) for this Payment Refund. Can be up to 128 characters long.

- **payment** ([PaymentMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-paymentmatchinput))

  The Payment to refund.

- **refund** ([RefundPaymentInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-refundpaymentinput))

  The Payment Refund to create.

<a id="reverseledgerentry"></a>

## reverseLedgerEntry

Reverses a Ledger Entry

###### Response
Returns a [ReverseLedgerEntryResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-reverseledgerentryresponse)

```graphql
mutation ReverseLedgerEntry($id: ID!) {
  reverseLedgerEntry(id: $id) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on ReverseLedgerEntryResult {
      ...ReverseLedgerEntryResultFragment
    }
  }
}
```

```json
{"id": "3116551f-5efc-4c9e-84ac-5a36a51b09c1"}
```

```json
{"data": {"reverseLedgerEntry": BadRequestError\}\}
```

###### Arguments

- **id** ([ID!](https://fragment.dev/markdown/api-reference/ledger-types.md#scalars-and-enums-id))

  The Fragment  ID of the Ledger Entry to reverse

<a id="storeschema"></a>

## storeSchema

Stores a Schema in your workspace. If no Schema with the same key exists in your worksapce, a new Schema is created. Else, the Schema is updated, and every Ledger associated with it is migrated to the latest version.

###### Response
Returns a [StoreSchemaResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-storeschemaresponse)

```graphql
mutation StoreSchema($schema: SchemaInput!) {
  storeSchema(schema: $schema) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on StoreSchemaResult {
      ...StoreSchemaResultFragment
    }
  }
}
```

```json
{"schema": SchemaInput}
```

```json
{"data": {"storeSchema": BadRequestError\}\}
```

###### Arguments

- **schema** ([SchemaInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-schemainput))

  The Schema to store.

<a id="synccustomaccounts"></a>

## syncCustomAccounts

Once you've created a [Custom Link](https://fragment.dev/markdown/guides/sync-payments.md#custom-link), create accounts under it using this mutation. Each Custom Account is an immutable, single-entry view of all the transactions in the external account. You can sync up to 100 Custom Accounts in one API call.

###### Response
Returns a [SyncCustomAccountsResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-synccustomaccountsresponse)

```graphql
mutation SyncCustomAccounts(
  $accounts: [CustomAccountInput!]!,
  $link: LinkMatchInput!
) {
  syncCustomAccounts(
    accounts: $accounts,
    link: $link
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on SyncCustomAccountsResult {
      ...SyncCustomAccountsResultFragment
    }
  }
}
```

```json
{
  "accounts": [CustomAccountInput],
  "link": LinkMatchInput
}
```

```json
{"data": {"syncCustomAccounts": BadRequestError\}\}
```

###### Arguments

- **accounts** ([[CustomAccountInput!]!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-customaccountinput))

  A list of external accounts to sync

- **link** ([LinkMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-linkmatchinput))

  An object containing the ID or creation IK of a Custom Link.

<a id="synccustomtxs"></a>

## syncCustomTxs

You can create transactions under a Custom Account in a [Custom Link](https://fragment.dev/markdown/guides/sync-payments.md#custom-link) using this mutation. Once you've imported transactions, you can use the reconcileTx mutation to add them to a Ledger via the Linked Ledger Account. You can sync up to 100 Custom Transactions in one API call.

###### Response
Returns a [SyncCustomTxsResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-synccustomtxsresponse)

```graphql
mutation SyncCustomTxs(
  $link: LinkMatchInput!,
  $txs: [CustomTxInput!]!
) {
  syncCustomTxs(
    link: $link,
    txs: $txs
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on SyncCustomTxsResult {
      ...SyncCustomTxsResultFragment
    }
  }
}
```

```json
{
  "link": LinkMatchInput,
  "txs": [CustomTxInput]
}
```

```json
{"data": {"syncCustomTxs": BadRequestError\}\}
```

###### Arguments

- **link** ([LinkMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-linkmatchinput))

  An object containing the ID or creation IK of a Custom Link.

- **txs** ([[CustomTxInput!]!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-customtxinput))

  A list of external transactions to sync

<a id="updateledger"></a>

## updateLedger

Updates a Ledger. Currently, you can change only the Ledger 'name'.

###### Response
Returns an [UpdateLedgerResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-updateledgerresponse)

```graphql
mutation UpdateLedger(
  $ledger: LedgerMatchInput!,
  $update: UpdateLedgerInput!
) {
  updateLedger(
    ledger: $ledger,
    update: $update
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on UpdateLedgerResult {
      ...UpdateLedgerResultFragment
    }
  }
}
```

```json
{
  "ledger": LedgerMatchInput,
  "update": UpdateLedgerInput
}
```

```json
{"data": {"updateLedger": BadRequestError\}\}
```

###### Arguments

- **ledger** ([LedgerMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgermatchinput))

  An object containing the ID of the Ledger to update.

- **update** ([UpdateLedgerInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-updateledgerinput))

  A payload of fields to update. Currently, you can change only the Ledger 'name'.

<a id="updateledgerentry"></a>

## updateLedgerEntry

Update a ledger entry

###### Response
Returns an [UpdateLedgerEntryResponse!](https://fragment.dev/markdown/api-reference/ledger-types.md#response-types-updateledgerentryresponse)

```graphql
mutation UpdateLedgerEntry(
  $ledgerEntry: LedgerEntryMatchInput!,
  $update: UpdateLedgerEntryInput!
) {
  updateLedgerEntry(
    ledgerEntry: $ledgerEntry,
    update: $update
  ) {
    ... on BadRequestError {
      ...BadRequestErrorFragment
    }
    ... on InternalError {
      ...InternalErrorFragment
    }
    ... on UpdateLedgerEntryResult {
      ...UpdateLedgerEntryResultFragment
    }
  }
}
```

```json
{
  "ledgerEntry": LedgerEntryMatchInput,
  "update": UpdateLedgerEntryInput
}
```

```json
{"data": {"updateLedgerEntry": BadRequestError\}\}
```

###### Arguments

- **ledgerEntry** ([LedgerEntryMatchInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#matchinput-types-ledgerentrymatchinput))

  The Ledger Entry that is being updated

- **update** ([UpdateLedgerEntryInput!](https://fragment.dev/markdown/api-reference/ledger-types.md#input-types-updateledgerentryinput))

  The payload containing the fields to update. Only a Ledger Entry's tags and its Ledger Lines' tags can be updated.
