Organizations
An organization is the buying company: the unit a contract, a credit limit and a price list belong to. Its people are contacts.
curl "https://api.revenexx.com/v1/customers/organizations?limit=50" \
-H "X-Revenexx-Tenant: <TENANT_SLUG>" \
-H "X-Revenexx-Api-Key: rvxk_..."
The row
| Field | Meaning |
|---|---|
name | Legal or trading name of the company, never a person. |
customer_number | The number the company carries in the merchant's own ERP — the key an ERP integration joins on. Free text, no enforced format. |
vat_id | VAT identification number — the closest thing a B2B buyer has to a legal identity. Validated against the EU verification service when the tenant's organization_vat_id_required setting is on; stored verbatim otherwise, including for buyers outside the EU. |
branche | Industry, in the merchant's own words. Free text — no code list. Segment rules match it exactly and case-sensitively. |
status | active or blocked. Access, not pipeline. |
lifecycle_stage | Where the company stands in the sales pipeline. One of the tenant's own lifecycle stages. |
delivery_block | true stops shipments while leaving login and ordering alone. |
credit_limit | Ceiling on open receivables in the market's currency. Null means no limit — not a limit of zero. |
payment_terms | One of the tenant's own payment terms. Null falls back to the market's default_payment_terms. |
price_list | The code of the price list this company buys on. Plain text pointing into the prices app; nothing here validates it, so a code naming no list simply prices nothing. |
settings | Free-form per-organization settings. This app never branches on a key in here — but a segment rule can address a top-level key as setting:<key>, which is what the blob is for. |
external_team_id | The platform team this organization is mirrored as, which is what makes its people a team for storefront auth. Written by the platform, ignored on any write you send. |
Three ways to stop a company, and they are not interchangeable
status: "blocked"stops the company's people logging in. It is also where a rejected registration parks the company it founded.delivery_block: truestops shipments and leaves login and ordering alone — the "they may order, we are just not sending anything until this is settled" state.credit_limitis an amount that feeds the decision whether an order is accepted.
Blocking the login to stop a delivery locks out exactly the people who could settle the invoice. Use delivery_block.
Addresses
Addresses live in their own entity at /v1/customers/addresses, and exactly one of organization_id / contact_id is set: a company address shared by everyone in it, or a personal one only that contact uses.
{
"organization_id": "…",
"type": "shipping",
"is_default": true,
"name": "Wareneingang",
"company": "Beispiel Industrietechnik GmbH",
"street": "Industriestraße 14",
"street2": "Tor 3",
"zip": "80331",
"city": "München",
"country": "DE"
}
| Field | Note |
|---|---|
type | One of the tenant's own address types, seeded with billing and shipping. A merchant can add their own. |
is_default | One default per owner and type. Setting it moves the flag off the previous holder. |
country | ISO 3166-1 alpha-2, exactly two letters. What shipping and tax both key off. |
zip | Text — leading zeros are real in most countries. |
region | Required by some destinations (US, CA), unused by most European ones. |
company | Often the owning organization's name, but not always — a delivery to a construction site carries the site. |
Buying metrics
organization_metrics is a materialized projection: one row per organization, with what it bought. Revenue lives in the orders app and cannot be joined across apps, so it is pulled and stored here.
curl "https://api.revenexx.com/v1/customers/organization_metrics?limit=50" \
-H "X-Revenexx-Tenant: <TENANT_SLUG>" \
-H "X-Revenexx-Api-Key: rvxk_..."
| Field | Meaning |
|---|---|
order_count, revenue_total | Ever, in currency. |
order_count_30d/90d/365d, revenue_30d/90d/365d | Rolling windows measured back from orders_as_of, not calendar months. |
avg_order_value, avg_order_value_365d | Computed from the sums. Zero when there were no orders. |
first_order_at, last_order_at | Null if the company never ordered — which is what makes them usable as "is this a customer at all?". |
currency | The single currency all counted orders were in. Null when there were none, and also when there were several. |
currency_mixed | true when the company ordered in more than one currency. The sums are still stored, but they are not comparable against a threshold. |
orders_as_of | The instant the rolling windows were measured from. |
computed_at | How stale the numbers are. |
Rows exist for companies that never ordered — all zeros rather than missing, so a "never bought" rule matches something.
Refreshing, in a loop
curl -X POST https://api.revenexx.com/v1/customers/organization_metrics/refresh \
-H "X-Revenexx-Tenant: <TENANT_SLUG>" \
-H "X-Revenexx-Api-Key: rvxk_..." \
-H "Content-Type: application/json" \
-d '{}'
The refresh walks organizations in id order, asks the orders app for a rollup of a batch at a time, and materializes the answer. Rows are only rewritten when a value actually changed, so a routine refresh costs almost no writes.
done is false, POST again with the returned cursorandas_of. Pinning as_of is what stops the rolling windows sliding underneath a multi-call refresh.For the targeted case — a company just ordered — send organization_ids and it refreshes exactly those in a single call.
GET /v1/customers/organization_metrics/freshness answers how stale the projection is, which is what a "last updated" indicator and a scheduled job's decision to run should read.
Activity from the company page
curl -X POST "https://api.revenexx.com/v1/customers/organizations/{id}/events" \
-H "X-Revenexx-Tenant: <TENANT_SLUG>" \
-H "X-Revenexx-Api-Key: rvxk_..." \
-H "Content-Type: application/json" \
-d '{"contact_id":"…","kind":"call","subject":"Annual pricing review"}'
Timeline entries are always filed against a person, even when they are logged from the company page — see Contacts.
Where to go next
- Contacts — the people inside the company.
- Segments — grouping companies by these columns and metrics.
- Value lists — payment terms, address types, lifecycle stages.
- Price lists — what
price_listpoints at.