Create or join a business account
curl --request POST \
--url https://b.anny.co/api/v1/business-accounts/join \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme GmbH"
}
'import requests
url = "https://b.anny.co/api/v1/business-accounts/join"
payload = { "name": "Acme GmbH" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Acme GmbH'})
};
fetch('https://b.anny.co/api/v1/business-accounts/join', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/business-accounts/join",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme GmbH'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/business-accounts/join"
payload := strings.NewReader("{\n \"name\": \"Acme GmbH\"\n}")
req, _ := http.NewRequest("POST", 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(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/business-accounts/join")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme GmbH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/business-accounts/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme GmbH\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "business-accounts",
"attributes": {
"name": "<string>",
"brand_name": "<string>",
"domain": "<string>",
"vat_id": "<string>",
"billing_email": "<string>",
"allow_subdomains": true,
"domain_auto_join": true,
"created_at": "<string>",
"updated_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"logo_image": {
"data": {
"type": "<string>",
"id": "<string>"
}
},
"primary_address": {
"data": {
"type": "<string>",
"id": "<string>"
}
},
"business_account_members": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
]
}
},
"meta": {
"membership": {
"id": "<string>",
"role": "owner",
"status": "active",
"source": "<string>",
"created_at": "<string>"
},
"can_request_join": true,
"can_accept_invite": true,
"can_reject_invite": true,
"member_count": 123,
"pending_member_count": 123
}
}
}Account
Create or join a business account
Create a new business account or join an existing one matched by slug and domain.
POST
/
api
/
v1
/
business-accounts
/
join
Create or join a business account
curl --request POST \
--url https://b.anny.co/api/v1/business-accounts/join \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme GmbH"
}
'import requests
url = "https://b.anny.co/api/v1/business-accounts/join"
payload = { "name": "Acme GmbH" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Acme GmbH'})
};
fetch('https://b.anny.co/api/v1/business-accounts/join', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/business-accounts/join",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme GmbH'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/business-accounts/join"
payload := strings.NewReader("{\n \"name\": \"Acme GmbH\"\n}")
req, _ := http.NewRequest("POST", 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(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/business-accounts/join")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme GmbH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/business-accounts/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme GmbH\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "business-accounts",
"attributes": {
"name": "<string>",
"brand_name": "<string>",
"domain": "<string>",
"vat_id": "<string>",
"billing_email": "<string>",
"allow_subdomains": true,
"domain_auto_join": true,
"created_at": "<string>",
"updated_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"logo_image": {
"data": {
"type": "<string>",
"id": "<string>"
}
},
"primary_address": {
"data": {
"type": "<string>",
"id": "<string>"
}
},
"business_account_members": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
]
}
},
"meta": {
"membership": {
"id": "<string>",
"role": "owner",
"status": "active",
"source": "<string>",
"created_at": "<string>"
},
"can_request_join": true,
"can_accept_invite": true,
"can_reject_invite": true,
"member_count": 123,
"pending_member_count": 123
}
}
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Antwort
Created or matched business account
A customer self-service business account with membership-aware visibility.
Show child attributes
Show child attributes
⌘I