---
title: "List an intent’s attempts"
description: "Oldest first."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/payment-intents/list-an-intent-s-attempts"
---
# List an intent’s attempts

> Oldest first.

<api-operation method="GET" path="/v1/businesses/{biz}/payment_intents/{pi}/attempts">
<template v-slot:docs="">

Each attempt is one interaction with the gateway. `span_id` correlates an attempt with its gateway request/response logs; `trace_id` is the request or job that made it.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pi
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Payment intent id (pi_…)
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        list
      </code>
      
      . One of <code>
        list
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      The rows on this page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        payment_attempt
      </code>
      
      . One of <code>
        payment_attempt
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The payment attempt's id (pia_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.attempt_number
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      1-based; unique per intent. Earlier attempts are never mutated by a retry.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The attempt's status. One of <code>
        inited
      </code>
      
      , <code>
        requires_action
      </code>
      
      , <code>
        authorized
      </code>
      
      , <code>
        consumed
      </code>
      
      , <code>
        failed
      </code>
      
      , <code>
        voided
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.id_at_gateway
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The attempt's id at the gateway.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.error_code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The gateway's error code, if the attempt failed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.error_text
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The gateway's error message, if the attempt failed.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.trace_id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The request or job that made this attempt.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.span_id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      This attempt's gateway request/response logs share this id, across requests. Null on older attempts.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the payment attempt was created (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.updated_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the payment attempt was last changed (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.resource_version
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      A number that goes up on every change.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.payment_method
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Null when the attempt named no instrument (a <code>
        setup
      </code>
      
       intent before the buyer supplies one), or when the vaulted method has since been deleted — an attempt keeps no FK, so its history survives the card.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.payment_method_type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        card
      </code>
      
       | <code>
        upi
      </code>
      
       | <code>
        wallet
      </code>
      
       | …
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.payment_method_brand
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The card brand used.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.payment_method_last4
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The last four digits of the card used.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Success
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such payment intent
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/payment_intents/pi_XXXXXXXXXXXX01/attempts" \
  -H "Authorization: Bearer $TMBILLING_API_KEY"
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "list",
  "data": [
    {
      "object": "payment_attempt",
      "id": "pia_XXXXXXXXXXXX01",
      "attempt_number": 0,
      "status": "inited"
    }
  ]
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such payment intent"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
