> ## Documentation Index
> Fetch the complete documentation index at: https://ixoworld-canonical.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Claims and Collections

> Create, submit, and evaluate claims and collections on the IXO blockchain using the IXO MultiClient SDK

Claims and collections are central to managing interactions and transactions on the IXO blockchain. This guide shows you how to implement common claim operations.

## Creating a Collection

Set up a new collection for submitting and evaluating claims.

```typescript theme={null}
const response = await CreateCollection(
  "entityDid1234",      // The DID of the entity creating the collection
  "protocolDid1234",    // The DID of the associated protocol
  "paymentsAccount1234" // Account to handle payments
);
```

### Parameters

<AccordionGroup>
  <Accordion title="entityDid" icon="fingerprint">
    DID of the entity creating the collection
  </Accordion>

  <Accordion title="protocolDid" icon="file-code">
    DID of the protocol under which the collection falls
  </Accordion>

  <Accordion title="paymentsAccount" icon="wallet">
    Account to handle collection-related payments
  </Accordion>

  <Accordion title="signer (optional)" icon="user">
    Transaction signer
  </Accordion>

  <Accordion title="cw20Address (optional)" icon="coins">
    CW20 token address for payments
  </Accordion>
</AccordionGroup>

## Querying Collections

Retrieve collection data using the IXO Blocksync GraphQL API.

```graphql theme={null}
query MyQuery {
  claimCollection(id: "99") {
    id
    startDate
    endDate
    entity
    protocol
    admin
    count
    evaluated
    approved
    rejected
    disputed
    claimSchemaTypesLoaded
    invalidated
    payments
    quota
    state
  }
}
```

<Tip>
  Replace the `id` field with your specific collection ID to get detailed information about that collection.
</Tip>

## Managing Claims

### Submitting a Claim

Submit a new claim to an existing collection.

```typescript theme={null}
const response = await MsgExecAgentSubmit(
  "claimId1234",        // Unique identifier for the claim
  "collectionId1234",   // Identifier of the collection
  "adminAddress1234"    // Admin address authorizing the claim submission
);
```

### Evaluating a Claim

Assess and evaluate a submitted claim.

```typescript theme={null}
const response = await MsgExecAgentEvaluate(
  "claimId1234",        // Unique identifier for the claim
  "collectionId1234",   // Identifier of the collection
  "adminAddress1234"    // Admin address authorizing the claim evaluation
);
```

## Querying Claims

Retrieve detailed information about claims using GraphQL.

```graphql theme={null}
query MyQuery {
  claim(claimId: "bafkreihzugslzexyu2c6o6nmtm7vxbsyelo7pzmcppsmqawj2s6blmgojy") {
    schemaType
    claimId
    agentAddress
    agentDid
    collectionId
    paymentsStatus
    submissionDate
    evaluationByClaimId {
      status
      verificationProof
      amount
      evaluationDate
      oracle
      reason
    }
  }
}
```

## Claims Function Reference

<AccordionGroup>
  <Accordion title="CreateCollection" icon="folder-plus">
    Creates a new collection.

    **Parameters:** `entityDid, protocolDid, paymentsAccount, signer?, cw20Address?`
  </Accordion>

  <Accordion title="UpdateCollectionState" icon="pen-to-square">
    Updates collection state.

    **Parameters:** `collectionId, adminAddress, signer?`
  </Accordion>

  <Accordion title="MsgClaimIntent" icon="paper-plane">
    Submits a claim intent.

    **Parameters:** `claimId, collectionId, adminAddress`
  </Accordion>

  <Accordion title="MsgExecAgentSubmit" icon="upload">
    Submits a claim.

    **Parameters:** `claimId, collectionId, adminAddress`
  </Accordion>

  <Accordion title="MsgExecAgentEvaluate" icon="clipboard-check">
    Evaluates a claim.

    **Parameters:** `claimId, collectionId, adminAddress`
  </Accordion>

  <Accordion title="GrantEntityAccountClaimsSubmitAuthz" icon="key">
    Grants submission authorization.

    **Parameters:** *Varies by implementation*
  </Accordion>

  <Accordion title="GrantEntityAccountClaimsEvaluateAuthz" icon="key">
    Grants evaluation authorization.

    **Parameters:** *Varies by implementation*
  </Accordion>

  <Accordion title="DisputeClaim" icon="triangle-exclamation">
    Initiates a claim dispute.

    **Parameters:** *Varies by implementation*
  </Accordion>

  <Accordion title="MsgExecWithdrawal" icon="money-bill-transfer">
    Executes payment withdrawal.

    **Parameters:** *Varies by implementation*
  </Accordion>
</AccordionGroup>

## Troubleshooting

<Accordion title="Invalid Collection Parameters">
  * Ensure all DIDs and account addresses are correct
  * Verify payment account details are accurate
  * Check that the protocol DID exists and is valid
</Accordion>

<Accordion title="Claim Submission Errors">
  * Check that the claim ID is unique and valid
  * Ensure the admin address has the necessary permissions
  * Verify the collection is in a state that accepts claims
</Accordion>

<Accordion title="Evaluation Issues">
  * Confirm the claim is in a state ready for evaluation
  * Verify the evaluator has the correct authorization
  * Check that the collection is still active and valid
</Accordion>

<Tip>
  Always verify the status and details of claims and collections through the GraphQL API before performing operations on them.
</Tip>
