---
title: "Delete a gateway account"
description: "Refused with 409 while the account still has saved payment methods, transactions without a final result, open payment intents, open disputes, or payments from the last 120 days."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/payment-methods/delete-a-gateway-account"
---
# Delete a gateway account

> Refused with 409 while the account still has saved payment methods, transactions without a final result, open payment intents, open disputes, or payments from the last 120 days.

<api-operation method="DELETE" path="/v1/businesses/{biz}/gateway_accounts/{gwa}">
<template v-slot:docs="">

Set `status` to `disabled` to stop new charges instead.

## 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>
        gwa
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The gateway account's id (gwa_…).
    </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>
        gateway_account
      </code>
      
      . One of <code>
        gateway_account
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The gateway account's id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        deleted
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      The deleted. One of <code>
        true
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        webhook_removal
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      What happened to this account's webhook registration at the gateway. Best effort: the account is deleted whatever this says. <code>
        removed
      </code>
      
      : deleted at the gateway. <code>
        deactivated
      </code>
      
      : switched off, because the gateway cannot delete it. <code>
        not_found
      </code>
      
      : no registration has this account's URL. <code>
        manual
      </code>
      
       and <code>
        failed
      </code>
      
      : do the <code>
        instructions
      </code>
      
      . <code>
        not_applicable
      </code>
      
      : the gateway sends no webhooks to a registered URL.
    </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>
      Deleted
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such gateway account
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      The account is still in use
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X DELETE "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/gateway_accounts/gwa_XXXXXXXXXXXX01" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

</template>

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

```json [200 OK]
{
  "object": "gateway_account",
  "id": "gwa_XXXXXXXXXXXX01",
  "deleted": true,
  "webhook_removal": {
    "status": "removed",
    "instructions": [
      "Instruction"
    ]
  }
}
```

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

```json [409 Conflict]
{
  "error": {
    "type": "conflict_error",
    "message": "The account is still in use"
  }
}
```

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


## Sitemap

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