> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Deactivate a business

DELETE https://api-sandbox.payabli.com/api/v2/businesses/{businessReference}
Content-Type: application/json

Deactivates a business. This is a soft delete: the business moves to
`Deactivated` and the record is kept.


Reference: https://docs.payabli.com/developers/api-reference/businesses/deactivate-a-business

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `businessReference` (string, required) — The business reference (`businessUuid`).

### Body (application/json)

This endpoint expects a DeactivateBusinessRequest.

- `reason` (string, optional) — Optional reason for deactivation (max 500 characters).

## Response

### 200

Business deactivated.

- `success` (boolean, required) — Whether the request succeeded.
- `message` (string, required, nullable) — A human-readable result message.
- `traceId` (string, required, nullable) — The trace identifier for the request, useful for support.
- `data` (BusinessDeactivatedResponse, required, nullable) — The deactivated business.
- `warnings` (list of BoardingWarning, required, nullable) — Non-blocking warnings.

## Errors

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 404 Not Found Error

The requested resource wasn't found.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### BusinessDeactivatedResponse

The result of deactivating a business.

- `businessUuid` (string, required) — The business reference.
- `businessStatus` (string, required) — The business status after deactivation (Deactivated).
- `deactivatedAt` (datetime, required) — When the business was deactivated.
- `reason` (string, required, nullable) — The reason recorded for the deactivation.
- `_links` (BusinessLinks, required) — Hypermedia links for the business resource.

### BoardingWarning

A non-blocking warning returned alongside a successful response.

- `code` (string, optional) — A machine-readable warning code.
- `message` (string, optional) — A human-readable description of the warning.

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### BusinessLinks

Hypermedia links for a business resource.

- `self` (string, optional) — Relative path to the business resource.

## Examples

**Request**

```json
{
  "reason": "Duplicate record"
}
```

**Response**

```json
{
  "success": true,
  "message": "Business deactivated successfully",
  "traceId": "0HNNKQIN7BJQM:0000003D",
  "data": {
    "businessUuid": "019fed33-615d-77b6-afaa-46e7ac9bf36e",
    "businessStatus": "Deactivated",
    "deactivatedAt": "2026-08-10T19:43:15.3804295Z",
    "reason": "Duplicate record",
    "_links": {
      "self": "/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e"

payload = { "reason": "Duplicate record" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"reason":"Duplicate record"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e"

	payload := strings.NewReader("{\n  \"reason\": \"Duplicate record\"\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"reason\": \"Duplicate record\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"reason\": \"Duplicate record\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e', [
  'body' => '{
  "reason": "Duplicate record"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"reason\": \"Duplicate record\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["reason": "Duplicate record"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/businesses/019fed33-615d-77b6-afaa-46e7ac9bf36e")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```