---
title: "Authorize a payment intent by hand"
description: "TEST BUSINESSES ONLY."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/payment-intents/authorize-a-payment-intent-by-hand"
---
# Authorize a payment intent by hand

> TEST BUSINESSES ONLY.

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

⚠️ **Test mode only.** This route DECIDES that the buyer passed the challenge, by force-resolving it at the simulated gateway. A real gateway makes that decision itself and reports it over its webhook, so a live business gets a 400 here: an intent marked `authorized` locally while the gateway still considers the buyer unauthenticated would let the next capture take money the issuer never approved.

## 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>

## Headers

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

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </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>
        payment_intent
      </code>
      
      . One of <code>
        payment_intent
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The payment intent's id (pi_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        voided
      </code>
      
       is set by the void route alongside <code>
        voided_at
      </code>
      
      . One of <code>
        inited
      </code>
      
      , <code>
        in_progress
      </code>
      
      , <code>
        authorized
      </code>
      
      , <code>
        consumed
      </code>
      
      , <code>
        expired
      </code>
      
      , <code>
        voided
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        purpose
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Whether the intent takes a payment or saves a payment method. One of <code>
        payment
      </code>
      
      , <code>
        setup
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Always 0 for a <code>
        setup
      </code>
      
       intent.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        max_amount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The mandate ceiling this <code>
        setup
      </code>
      
       intent registered with, and what a retry re-registers with. Null for <code>
        payment
      </code>
      
       intents.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The payment intent's currency (ISO-4217 code).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        attempt_count
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Payment attempts — how many times this intent has been tried at the gateway.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        last_attempt_status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Status of the NEWEST attempt. <code>
        status
      </code>
      
       above cannot express a refusal — there is no <code>
        failed
      </code>
      
       intent status, because a declined authorization leaves the intent OPEN so it can be retried — so this is what distinguishes a declined intent from one the buyer is still working through. <code>
        null
      </code>
      
       means no attempt has been made yet. 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>
        next_action
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      How the buyer completes the challenge, when one is outstanding.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the intent expires (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        voided_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the intent was voided (ISO-8601 UTC), or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the payment intent was created (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        resource_version
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      A number that goes up on every change.
    </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>
        400
      </code>
    </td>
    
    <td>
      Live business (use the gateway webhook), or intent not authorizable
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such payment intent
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/payment_intents/pi_XXXXXXXXXXXX01/authorize" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

</template>

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

```json [200 OK]
{
  "object": "payment_intent",
  "id": "pi_XXXXXXXXXXXX01",
  "status": "inited",
  "purpose": "payment",
  "amount_minor": 2900,
  "max_amount_minor": 2900,
  "currency": "USD",
  "attempt_count": 0,
  "last_attempt_status": "inited",
  "next_action": {
    "mode": "redirect",
    "approvalUrl": "ApprovalUrl",
    "clientSecret": "ClientSecret",
    "publishableKey": "PublishableKey",
    "checkout": {},
    "sdk": {
      "provider": "stripe",
      "params": {}
    },
    "formPost": {
      "action": "https://example.com/webhooks/billing",
      "fields": {}
    }
  },
  "expires_at": "2026-04-14T09:30:00Z",
  "voided_at": null,
  "created_at": "2026-03-14T09:30:00Z",
  "resource_version": 1
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "Live business (use the gateway webhook), or intent not authorizable"
  }
}
```

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

```json [409 Conflict]
{
  "error": {
    "type": "idempotency_error",
    "message": "Idempotency-Key conflict — the key is already in flight, or was reused with a different request payload."
  }
}
```

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


## Sitemap

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