# Create Batch Sweeping

## Create a Batch Transfer

Initiate a mutation to create an assets batch transfer request to sweep asset funds from multiple source wallets to a destination wallet address within your inabit organization.

{% hint style="warning" %}
Please note that this feature is permitted **only** for **inabit** **wallets**.
{% endhint %}

```graphql
mutation SweepWallets($data: SweepTransactionInput!) {
  sweepWallets(data: $data) {
    transactionId
  }
}
```

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### Body (<mark style="color:orange;">SweepTransactionInput</mark>) object

| Name                                                     | Type   | Description       |
| -------------------------------------------------------- | ------ | ----------------- |
| id<mark style="color:red;">\*</mark> (destinationWallet) | String | Wallet ID         |
| id<mark style="color:red;">\*</mark> (blockchain)        | String | Blockchain ID     |
| id<mark style="color:red;">\*</mark> (financialAsset)    | String | Asset ID          |
| id<mark style="color:red;">\*</mark> (Organization)      | String | Organization ID   |
| id<mark style="color:red;">\*</mark> (sourceWalletIds)   | String | Source Wallet IDs |

Example body:

```graphql
{
    "data": {
      "destinationWalletId": "master-wallet",
      "blockchain": {
        "id": "clefn78h5012plc6rxbmofnop"
      },
      "financialAsset": {
        "id": "cmaa9a52t24s28n018pz2zle4"
      },
      "organization": {
        "id": "org-98765"
      },
      "sourceWalletIDs": ["wallet-001", "wallet-002"]
    }
  }
}
```

### Response

Return values:

| Name          | Type   | Description       |
| ------------- | ------ | ----------------- |
| transactionId | String | Batch Transfer ID |

{% tabs %}
{% tab title="🟢 Success" %}

```javascript
{
  "data": {
    "sweepWallets": {
      "transactionId": "tx-46a89bcf-33d3-4a88-90de-59c5f201b9ab"
    }
  }
}
```

{% endtab %}

{% tab title="🔴 Failure" %}

```javascript
{
}
```

{% endtab %}
{% endtabs %}

### Try it out!

{% embed url="<https://studio.apollographql.com/sandbox/explorer?endpoint=https://api.inabit.dev/graphql&explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABACp4CGSAzuVCgJYRIAUAJAO4AW+C6pF1WgyYB1bngQBVJPRwIAkkgAOMFAEIAlEWAAdJESIoBNOoxZcefDuIRbd+g0Xpg9jouTgQYqV44BGADbQANZQnOT0+vZuBkgeCL5uUBBgCQ4GAL6JRFAS5CgIYACCKNm5CPmFAELE0TEAZjABAQBy8dlZ6UT1CGluSBAF2VQo+TBU2tkGI2NUHdns5M0IKJNdse3rTi5dnW71kZRQ9EtFVFQrazE5KX2Oe470VEVQUAgB+JU7bkp4jH8oAjZCgFSQAZQAIsDKgBRSQAJWywQIpQcnQyIAANCAAG7kP7kQIIKgYEB1HQgCwSCl8OoGCnOGlEClQZoBAj1ThgABWAAZeewAJx+FBYYIIAAsAHZ2BcqAAPCm+dFYkBKCAjeoBegAc04KAA8kpPsIkGDcvQlGhMCAMkA>" %}
