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

# Fetching Batches

You can inspect the overall status of your transfer batches using this paginated API.

### Paging

Use the same query parameters as in the previous request, but add a `cursor` query parameter (with the cursor from the previous response).

If the `cursor` is `null`, there is nothing left to page.

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.
</ParamField>

## Path Params

<ParamField path="contractAddress" type="string" required>
  Contract address which submitted the batches.
</ParamField>

## Query Params (Optional)

<ParamField query="pointType" type="PointType">
  `pointType` can be `PHASE2_POINTS` or `PHASE2_GOLD`
</ParamField>

<ParamField query="status" type="Status">
  Status of the batch. Can be `PENDING` or `CANCELLED` or `FINALIZING` or
  `FINALIZED`.
</ParamField>

<ParamField query="createdBefore" type="string">
  For querying batches created before `createdBefore` timestamp (ISO8601)
</ParamField>

<ParamField query="createdAfter" type="string">
  For querying batches created after `createdAfter` timestamp (ISO8601)
</ParamField>

<ParamField query="sort" type="string">
  Sort by `ASC` or `DESC` creation order
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Response status.
</ResponseField>

<ResponseField name="batch" type="Batch[]">
  Batch details along with transfer details.

  <Expandable>
    <ResponseField name="id" type="string">
      Batch ID.
    </ResponseField>

    <ResponseField name="contractAddress" type="string">
      Contract address that requested the transfer of points.
    </ResponseField>

    <ResponseField name="pointType" type="PointType">
      Point type requested to be transferred. Can be `PHASE2_POINTS` or `PHASE2_GOLD`.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Timestamp when the batch was created.
    </ResponseField>

    <ResponseField name="finalizeAt" type="string">
      Timestamp when the batch was finalized.
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Timestamp when the batch was updated. If not updated then it will `null`.
    </ResponseField>

    <ResponseField name="status" type="Status">
      Status of the batch. Can be `PENDING` or `CANCELLED` or `FINALIZING` or
      `FINALIZED`.
    </ResponseField>

    <ResponseField name="points" type="string">
      Total points being transferred in the batch.
    </ResponseField>

    <ResponseField name="transferCount" type="number">
      Number of transfer that are part of the batch.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="cursor" type="string | null">
  Cursor for pagination, if it is `null` there are no results left to
  paginate.
</ResponseField>
