# paymentUnapplyFromInvoices

Remove a payment from an invoice

**Scope required:** billing:write

```graphql
mutation paymentUnapplyFromInvoices ($paymentId: ID!, $invoiceIds: [ID!]!) {
  paymentUnapplyFromInvoices (paymentId: $paymentId, invoiceIds: $invoiceIds) {
      errors
      invoices
      payment {
        accountId
        amount
        amountUnapplied
        baseCurrencyCash
        baseCurrencyId
        completedAt
        conversionRate
        createdAt
        currencyId
        description
        errorCode
        errorMessage
        fees
        id
        isLegacy
        memo
        paymentProcessor
        receivedAt
        remoteTransactionId
        startedAt
        updatedAt
      }
  }
}
```

## Arguments

```json
{
  "paymentId": "456123",
  "invoiceIds": [
    "456123"
  ]
}
```

| Name       | Type      | Description |
| ---------- | --------- | ----------- |
| paymentId  | ID        |             |
| invoiceIds | List (ID) |             |

## Response

| Name     | Type                                                                           | Description |
| -------- | ------------------------------------------------------------------------------ | ----------- |
| errors   | List (String)                                                                  |             |
| invoices | List ([Invoice](https://docs.bunny.com/developer/api-reference/types/invoice)) |             |
| payment  | [Payment](https://docs.bunny.com/developer/api-reference/types/payment)        |             |
