> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.upwardli.com/llms.txt.

# Get a Business Relationship

GET https://api.upwardli.com/v2/businesses/{business_external_id}/relationships/{relationship_id}/

Returns one relationship of a business, including removed ones. Requires the `api:read` scope on a partner token.

Reference: https://developers.upwardli.com/api-access/api-reference/businesses/relationships/get-business-relationship

## Authentication

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

## Servers

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

## Request

### Path parameters

- `business_external_id` (string, required) — The `id` of the business.
- `relationship_id` (string, required) — The `id` of the relationship, as returned when it was created.

## Response

### 200

- `id` (string, required) — The `id` of the relationship.
- `principal_id` (string, required) — The `id` of the business, or of the consumer who holds the account, that the relationship belongs to.
- `principal_type` (enum, required) — Whether the principal is a `business` or a `consumer`.
  - Allowed values: `consumer`, `business`
- `related_consumer_id` (string, required) — The `id` of the consumer attached to the principal.
- `ownership_percentage` (double, required, nullable) — Share of the business the attached consumer owns, from 0 to 100 with two decimal places. Set for business relationships, `null` otherwise.
- `relationship_type` (enum, required, nullable) — What the account holder is to the authorized user. Set for consumer relationships, `null` otherwise.
  - Allowed values: `parent`, `guardian`, `spouse`, `other`
- `role` (enum, optional) — What the attached consumer is to the principal. A business grants `beneficial_owner` or `control_person`; a consumer grants `authorized_user`.
  - Allowed values: `beneficial_owner`, `control_person`, `authorized_user`
- `status` (enum, optional) — `active` while the relationship is in effect. Removed relationships stay readable with the status `removed`.
  - Allowed values: `active`, `removed`
- `created_at` (string, optional)

## Errors

### 404 Not Found Error

The business does not exist or belongs to another partner, or the relationship does not belong to this business.

- `detail` (V2BusinessesBusinessExternalIdRelationshipsRelationshipIdGetResponsesContentApplicationJsonSchemaDetail, optional)
- `code` (integer, optional)
- `messages` (list of string, optional)

## Types

### V2BusinessesBusinessExternalIdRelationshipsRelationshipIdGetResponsesContentApplicationJsonSchemaDetail

## Examples

**Response**

```json
{
  "id": "string",
  "principal_id": "string",
  "principal_type": "consumer",
  "related_consumer_id": "string",
  "ownership_percentage": 1.1,
  "relationship_type": "parent",
  "role": "beneficial_owner",
  "status": "active",
  "created_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	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.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.get("https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.upwardli.com/v2/businesses/business_external_id/relationships/relationship_id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```