Create billing entity
curl --request POST \
--url https://api.withorb.com/v1/account/billing_entities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legal_name": "<string>",
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"external_billing_entity_id": "<string>",
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 1,
"auto_collection": true,
"manual_issuance": true,
"email_delivery": true,
"automatic_tax_enabled": true
}
}
'import requests
url = "https://api.withorb.com/v1/account/billing_entities"
payload = {
"name": "<string>",
"legal_name": "<string>",
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"external_billing_entity_id": "<string>",
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 1,
"auto_collection": True,
"manual_issuance": True,
"email_delivery": True,
"automatic_tax_enabled": True
}
}
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: '<string>',
legal_name: '<string>',
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>'
},
external_billing_entity_id: '<string>',
tax_registrations: [{code: '<string>', value: '<string>', applies_to: '<string>'}],
invoice_settings: {
memo: '<string>',
net_terms: 1,
auto_collection: true,
manual_issuance: true,
email_delivery: true,
automatic_tax_enabled: true
}
})
};
fetch('https://api.withorb.com/v1/account/billing_entities', 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://api.withorb.com/v1/account/billing_entities",
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' => '<string>',
'legal_name' => '<string>',
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>'
],
'external_billing_entity_id' => '<string>',
'tax_registrations' => [
[
'code' => '<string>',
'value' => '<string>',
'applies_to' => '<string>'
]
],
'invoice_settings' => [
'memo' => '<string>',
'net_terms' => 1,
'auto_collection' => true,
'manual_issuance' => true,
'email_delivery' => true,
'automatic_tax_enabled' => true
]
]),
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://api.withorb.com/v1/account/billing_entities"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\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://api.withorb.com/v1/account/billing_entities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withorb.com/v1/account/billing_entities")
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\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"external_billing_entity_id": "<string>",
"is_default": true,
"status": "active",
"name": "<string>",
"legal_name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 123,
"auto_collection": true,
"manual_issuance": true,
"email_delivery": true,
"automatic_tax_enabled": true
},
"payment_gateway_connections": [
{
"payment_provider_type": "stripe",
"payment_gateway_connection_id": "<string>",
"is_default": true
}
],
"default_payment_gateway_connection_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}Billing entity
Create billing entity
This endpoint creates a billing entity: a legal entity the account invoices from, with its own legal name, address,
tax registrations, and invoice settings. external_billing_entity_id cannot be changed after creation. This
endpoint requires an admin API key.
POST
/
account
/
billing_entities
Create billing entity
curl --request POST \
--url https://api.withorb.com/v1/account/billing_entities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"legal_name": "<string>",
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"external_billing_entity_id": "<string>",
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 1,
"auto_collection": true,
"manual_issuance": true,
"email_delivery": true,
"automatic_tax_enabled": true
}
}
'import requests
url = "https://api.withorb.com/v1/account/billing_entities"
payload = {
"name": "<string>",
"legal_name": "<string>",
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"external_billing_entity_id": "<string>",
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 1,
"auto_collection": True,
"manual_issuance": True,
"email_delivery": True,
"automatic_tax_enabled": True
}
}
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: '<string>',
legal_name: '<string>',
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>'
},
external_billing_entity_id: '<string>',
tax_registrations: [{code: '<string>', value: '<string>', applies_to: '<string>'}],
invoice_settings: {
memo: '<string>',
net_terms: 1,
auto_collection: true,
manual_issuance: true,
email_delivery: true,
automatic_tax_enabled: true
}
})
};
fetch('https://api.withorb.com/v1/account/billing_entities', 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://api.withorb.com/v1/account/billing_entities",
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' => '<string>',
'legal_name' => '<string>',
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>'
],
'external_billing_entity_id' => '<string>',
'tax_registrations' => [
[
'code' => '<string>',
'value' => '<string>',
'applies_to' => '<string>'
]
],
'invoice_settings' => [
'memo' => '<string>',
'net_terms' => 1,
'auto_collection' => true,
'manual_issuance' => true,
'email_delivery' => true,
'automatic_tax_enabled' => true
]
]),
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://api.withorb.com/v1/account/billing_entities"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\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://api.withorb.com/v1/account/billing_entities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withorb.com/v1/account/billing_entities")
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\": \"<string>\",\n \"legal_name\": \"<string>\",\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"external_billing_entity_id\": \"<string>\",\n \"tax_registrations\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"applies_to\": \"<string>\"\n }\n ],\n \"invoice_settings\": {\n \"memo\": \"<string>\",\n \"net_terms\": 1,\n \"auto_collection\": true,\n \"manual_issuance\": true,\n \"email_delivery\": true,\n \"automatic_tax_enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"external_billing_entity_id": "<string>",
"is_default": true,
"status": "active",
"name": "<string>",
"legal_name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"tax_registrations": [
{
"code": "<string>",
"value": "<string>",
"applies_to": "<string>"
}
],
"invoice_settings": {
"memo": "<string>",
"net_terms": 123,
"auto_collection": true,
"manual_issuance": true,
"email_delivery": true,
"automatic_tax_enabled": true
},
"payment_gateway_connections": [
{
"payment_provider_type": "stripe",
"payment_gateway_connection_id": "<string>",
"is_default": true
}
],
"default_payment_gateway_connection_id": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "https://docs.withorb.com/reference/error-responses#400-constraint-violation",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#404-feature-not-available",
"status": 400,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#413-request-too-large",
"status": 413,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "<string>",
"title": "<string>"
}{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 123,
"detail": "<string>",
"title": "<string>"
}Body
application/json
Response
Created
A billing entity is a legal entity an account invoices from, with its own legal name, address and tax registrations.
Was this page helpful?