Update a business
curl --request PATCH \
--url https://b.anny.co/api/v1/businesses/{business_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "businesses",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"name": "Acme Corporation",
"billing_email": "invoices@acme.com"
}
}
}
'import requests
url = "https://b.anny.co/api/v1/businesses/{business_id}"
payload = { "data": {
"type": "businesses",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"name": "Acme Corporation",
"billing_email": "invoices@acme.com"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'businesses',
id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
attributes: {name: 'Acme Corporation', billing_email: 'invoices@acme.com'}
}
})
};
fetch('https://b.anny.co/api/v1/businesses/{business_id}', 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/businesses/{business_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'businesses',
'id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'attributes' => [
'name' => 'Acme Corporation',
'billing_email' => 'invoices@acme.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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/businesses/{business_id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://b.anny.co/api/v1/businesses/{business_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/businesses/{business_id}")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "businesses",
"attributes": {
"name": "<string>",
"brand_name": "<string>",
"domain": "<string>",
"billing_email": "<string>",
"vat_id": "<string>",
"notes": "<string>",
"custom_entry_map": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"has_business_account": true
},
"links": {
"self": "<string>"
},
"relationships": {
"billing_address": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"logo_image": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customers": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"custom_entries": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"customer_balances": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"payment_setup": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
}
}
}Customer Management
Update a business
Update an existing business.
PATCH
/
api
/
v1
/
businesses
/
{business_id}
Update a business
curl --request PATCH \
--url https://b.anny.co/api/v1/businesses/{business_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "businesses",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"name": "Acme Corporation",
"billing_email": "invoices@acme.com"
}
}
}
'import requests
url = "https://b.anny.co/api/v1/businesses/{business_id}"
payload = { "data": {
"type": "businesses",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"attributes": {
"name": "Acme Corporation",
"billing_email": "invoices@acme.com"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'businesses',
id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
attributes: {name: 'Acme Corporation', billing_email: 'invoices@acme.com'}
}
})
};
fetch('https://b.anny.co/api/v1/businesses/{business_id}', 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/businesses/{business_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'businesses',
'id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'attributes' => [
'name' => 'Acme Corporation',
'billing_email' => 'invoices@acme.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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/businesses/{business_id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://b.anny.co/api/v1/businesses/{business_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/businesses/{business_id}")
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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"businesses\",\n \"id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"attributes\": {\n \"name\": \"Acme Corporation\",\n \"billing_email\": \"invoices@acme.com\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "businesses",
"attributes": {
"name": "<string>",
"brand_name": "<string>",
"domain": "<string>",
"billing_email": "<string>",
"vat_id": "<string>",
"notes": "<string>",
"custom_entry_map": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"has_business_account": true
},
"links": {
"self": "<string>"
},
"relationships": {
"billing_address": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"logo_image": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customers": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"custom_entries": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"customer_balances": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"payment_setup": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
}
}
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Header
Bearer Token
Pfadparameter
UUID of the business
Abfrageparameter
Organization ID
Body
application/vnd.api+json
Show child attributes
Show child attributes
Antwort
Updated
A B2B entity representing a company or organization that groups customers for billing and identification purposes.
Show child attributes
Show child attributes
⌘I