> For the complete documentation index, see [llms.txt](https://docs.bindpay.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindpay.xyz/sub-payees/deactivate-sub-payee.md).

# Deactivate Sub-Payee

Deactivate a subpayee to prevent further transactions - don't hesitate to reach out for additional support at support\@bindpay.xyz

#### Endpoint

```
PUT https://api.bindpay.xyz/v1/deactivate-subpayee
```

### Headers

| Header       | Value                          | Description                             |
| ------------ | ------------------------------ | --------------------------------------- |
| Content-Type | application/json               | The content type of the request         |
| x-api-key    | Your subpayee creation API key | The API key used for creating subpayees |

{% hint style="info" %}
Need a subpayee creation API key? Generate one in the developer portal
{% endhint %}

### Request Body

| Field          | Type   | Required | Description                               |
| -------------- | ------ | -------- | ----------------------------------------- |
| subPayeeApiKey | string | Yes      | The API key of the subpayee to deactivate |

### Notes

* Only the parent business can deactivate their subpayees
* Must use the subpayee creation API key, not the regular business API key
* Deactivation is permanent and cannot be undone
* Existing transactions will not be affected
* New transactions using the deactivated subpayee's API key will be rejected

### Example Request

{% code lineNumbers="true" %}

```url
curl -X PUT "https://api.bindpay.xyz/v1/deactivate-subpayee" \
     -H "Content-Type: application/json" \
     -H "x-api-key: your_subpayee_creation_api_key_here" \
     -d '{
       "subPayeeApiKey": "subpayee_api_key_to_deactivate"
     }'
```

{% endcode %}

### Response

The API will respond with a JSON object containing the deactivation details.

#### Successful Response

```json
{
  "message": "Subpayee deactivated successfully",
  "subPayeeName": "Example Subpayee",
  "deactivatedAt": "2024-03-19T12:34:56.789Z"
}
```

#### Response Fields

| Field         | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| message       | string | Success confirmation message     |
| subPayeeName  | string | Name of the deactivated subpayee |
| deactivatedAt | string | Timestamp of deactivation        |

### Status Codes

| Status Code | Error Type            | Description                           |
| ----------- | --------------------- | ------------------------------------- |
| 200         | Success               | Subpayee successfully deactivated     |
| 400         | Bad Request           | Missing API key or subpayee API key   |
| 404         | Not Found             | Parent business or subpayee not found |
| 400         | Bad Request           | Subpayee already deactivated          |
| 500         | Internal Server Error | Server error                          |

For more information on error handling and response codes, please refer to our Error Handling documentation or get in contact with <support@bindpay.xyz>.
