> 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

# Update a business address

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

Applies a partial update to a business address. Send only the fields you want to change; omitted fields are kept.

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

## 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`).
- `businessAddressReference` (string, required) — The business address reference.

### Body (application/json)

This endpoint expects an UpdateBusinessAddressRequest.

- `type` (enum, optional) — The address role.
  - Allowed values: `legal`, `billing`, `shipping`, `remittance`, `physical`, `mailing`
- `location` (enum, optional) — The physical use of the address.
  - Allowed values: `office`, `warehouse`, `retail`, `home`, `other`
- `addressLine1` (string, optional) — The first line of the street address.
- `addressLine2` (string, optional) — The second line of the street address.
- `cityLocality` (string, optional) — The city or locality.
- `stateProvince` (string, optional) — The state or province.
- `postalCode` (string, optional) — The postal or ZIP code.
- `country` (string, optional) — The two-character ISO country code.
- `floor` (string, optional) — The floor, if applicable.
- `suiteApartNumber` (string, optional) — The suite or apartment number, if applicable.

## Response

### 200

Address updated.

- `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` (BusinessAddressResponse, required, nullable) — The business address.

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `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.

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

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

### BusinessAddressResponse

A business address, returned by the address endpoints.

- `_links` (BusinessAddressLinks, required) — Hypermedia links for the business address resource.
- `businessAddressReference` (string, required) — The reference of the business-to-address link, used to read and manage the address. Valid only under its own business.
- `type` (enum, required) — The address role.
  - Allowed values: `legal`, `billing`, `shipping`, `remittance`, `physical`, `mailing`
- `location` (enum, required) — The physical use of the address.
  - Allowed values: `office`, `warehouse`, `retail`, `home`, `other`
- `addressLine1` (string, required) — The first line of the street address.
- `addressLine2` (string, required, nullable) — The second line of the street address.
- `cityLocality` (string, required) — The city or locality.
- `stateProvince` (string, required) — The state or province.
- `postalCode` (string, required) — The postal or ZIP code.
- `country` (string, required) — The two-character ISO country code.
- `floor` (string, required, nullable) — The floor, if applicable.
- `suiteApartNumber` (string, required, nullable) — The suite or apartment number, if applicable.

### PayabliErrorBodyResponseData

Object with detailed error context.

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

### BusinessAddressLinks

Hypermedia links for a business address resource.

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

## Examples

**Request**

```json
{
  "type": "billing"
}
```

**Response**

```json
{
  "success": true,
  "message": "Address updated successfully",
  "traceId": "0HNOF89NNTM7O:000000C9",
  "data": {
    "_links": {
      "self": "/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9",
      "business": "/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55"
    },
    "businessAddressReference": "019fed1a-67d6-768a-b4cc-29d4299e21d9",
    "type": "billing",
    "location": "warehouse",
    "addressLine1": "202 Warehouse Ln",
    "addressLine2": null,
    "cityLocality": "Austin",
    "stateProvince": "TX",
    "postalCode": "73302",
    "country": "US",
    "floor": null,
    "suiteApartNumber": null
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9"

payload = { "type": "billing" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"billing"}'
};

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/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9"

	payload := strings.NewReader("{\n  \"type\": \"billing\"\n}")

	req, _ := http.NewRequest("PATCH", 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/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"billing\"\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.patch("https://api-sandbox.payabli.com/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"billing\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-sandbox.payabli.com/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9', [
  'body' => '{
  "type": "billing"
}',
  '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/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"billing\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55/addresses/019fed1a-67d6-768a-b4cc-29d4299e21d9")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```