> ## Documentation Index
> Fetch the complete documentation index at: https://developer.jtl-software.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DeleteAllPaymentsBySalesOrderId

> Deletes all payments that are directly linked to a sales order. Payments that are only linked via a sales invoice associated with the sales order are deleted only if IncludeInvoicePayments is true. Either all payments are deleted or none of them (all-or-nothing); if not all payments could be deleted, the request fails and none are deleted.



**mutation** `DeleteAllPaymentsBySalesOrderId(request: DeleteAllPaymentsBySalesOrderIdCommandRequestInput!): DeleteAllPaymentsBySalesOrderIdCommandResponse!`

## Arguments

**`request`**: `DeleteAllPaymentsBySalesOrderIdCommandRequestInput!` (required)

## Returns

`DeleteAllPaymentsBySalesOrderIdCommandResponse!`

**`deleted`**: `Boolean!`

True if all payments were deleted. False if there was no payment to delete - invoice payments only count when IncludeInvoicePayments is set.

## Examples

```graphql Mutation
mutation DeleteAllPaymentsBySalesOrderId($request: DeleteAllPaymentsBySalesOrderIdCommandRequestInput!) {
  DeleteAllPaymentsBySalesOrderId(request: $request) {
    deleted
  }
}
```

```json Variables
{
  "request": {
    "salesOrderId": "id"
  }
}
```

```json Response
{
  "data": {
    "DeleteAllPaymentsBySalesOrderId": {
      "deleted": true
    }
  }
}
```
