Update a customer balance
curl --request PATCH \
--url https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "customer-balances",
"id": "b8cc57d2-55e1-4926-acd2-b3f5c5ed4648",
"attributes": {
"status": "paid"
}
}
}
'import requests
url = "https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}"
payload = { "data": {
"type": "customer-balances",
"id": "b8cc57d2-55e1-4926-acd2-b3f5c5ed4648",
"attributes": { "status": "paid" }
} }
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: 'customer-balances',
id: 'b8cc57d2-55e1-4926-acd2-b3f5c5ed4648',
attributes: {status: 'paid'}
}
})
};
fetch('https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}', 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/customer-balances/{customer_balance_uuid}",
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' => 'customer-balances',
'id' => 'b8cc57d2-55e1-4926-acd2-b3f5c5ed4648',
'attributes' => [
'status' => 'paid'
]
]
]),
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/customer-balances/{customer_balance_uuid}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\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/customer-balances/{customer_balance_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}")
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\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "customer-balances",
"attributes": {
"total": 123,
"currency": "<string>",
"label": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"issue_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"links": {
"self": "<string>"
},
"relationships": {
"balanceable": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customer_account": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"invoices": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"master_invoice": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"payment_setup": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
}
}
}Orders & Billing
Update a customer balance
Update mutable customer-balance fields.
Typical usage is status management. Allowed status transitions:
open→void(cancel the balance)issued→paid(mark as paid after manual payment)issued→void(cancel after issuance)
PATCH
/
api
/
v1
/
customer-balances
/
{customer_balance_uuid}
Update a customer balance
curl --request PATCH \
--url https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "customer-balances",
"id": "b8cc57d2-55e1-4926-acd2-b3f5c5ed4648",
"attributes": {
"status": "paid"
}
}
}
'import requests
url = "https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}"
payload = { "data": {
"type": "customer-balances",
"id": "b8cc57d2-55e1-4926-acd2-b3f5c5ed4648",
"attributes": { "status": "paid" }
} }
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: 'customer-balances',
id: 'b8cc57d2-55e1-4926-acd2-b3f5c5ed4648',
attributes: {status: 'paid'}
}
})
};
fetch('https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}', 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/customer-balances/{customer_balance_uuid}",
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' => 'customer-balances',
'id' => 'b8cc57d2-55e1-4926-acd2-b3f5c5ed4648',
'attributes' => [
'status' => 'paid'
]
]
]),
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/customer-balances/{customer_balance_uuid}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\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/customer-balances/{customer_balance_uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/customer-balances/{customer_balance_uuid}")
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\": \"customer-balances\",\n \"id\": \"b8cc57d2-55e1-4926-acd2-b3f5c5ed4648\",\n \"attributes\": {\n \"status\": \"paid\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "customer-balances",
"attributes": {
"total": 123,
"currency": "<string>",
"label": "<string>",
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"issue_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"links": {
"self": "<string>"
},
"relationships": {
"balanceable": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"customer_account": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
},
"invoices": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
],
"links": {
"self": "<string>"
}
},
"master_invoice": {
"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 customer balance
Abfrageparameter
Organization ID
Body
application/vnd.api+json
Show child attributes
Show child attributes
Antwort
Updated
Consolidated billing bucket for a customer across a billing period.
Show child attributes
Show child attributes
⌘I