Organizations

The buying company on revenexx — commercial terms, the three access axes, addresses, and the organization_metrics projection with its chunked refresh and freshness check.

An organization is the buying company: the unit a contract, a credit limit and a price list belong to. Its people are contacts.

Request
curl "https://api.revenexx.com/v1/customers/organizations?limit=50" \
  -H "X-Revenexx-Tenant: <TENANT_SLUG>" \
  -H "X-Revenexx-Api-Key: rvxk_..."

The row

FieldMeaning
nameLegal or trading name of the company, never a person.
customer_numberThe number the company carries in the merchant's own ERP — the key an ERP integration joins on. Free text, no enforced format.
vat_idVAT 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.
brancheIndustry, in the merchant's own words. Free text — no code list. Segment rules match it exactly and case-sensitively.
statusactive or blocked. Access, not pipeline.
lifecycle_stageWhere the company stands in the sales pipeline. One of the tenant's own lifecycle stages.
delivery_blocktrue stops shipments while leaving login and ordering alone.
credit_limitCeiling on open receivables in the market's currency. Null means no limit — not a limit of zero.
payment_termsOne of the tenant's own payment terms. Null falls back to the market's default_payment_terms.
price_listThe 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.
settingsFree-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_idThe 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: true stops shipments and leaves login and ordering alone — the "they may order, we are just not sending anything until this is settled" state.
  • credit_limit is 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.

Address
{
  "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"
}
FieldNote
typeOne of the tenant's own address types, seeded with billing and shipping. A merchant can add their own.
is_defaultOne default per owner and type. Setting it moves the flag off the previous holder.
countryISO 3166-1 alpha-2, exactly two letters. What shipping and tax both key off.
zipText — leading zeros are real in most countries.
regionRequired by some destinations (US, CA), unused by most European ones.
companyOften 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.

Request
curl "https://api.revenexx.com/v1/customers/organization_metrics?limit=50" \
  -H "X-Revenexx-Tenant: <TENANT_SLUG>" \
  -H "X-Revenexx-Api-Key: rvxk_..."
FieldMeaning
order_count, revenue_totalEver, in currency.
order_count_30d/90d/365d, revenue_30d/90d/365dRolling windows measured back from orders_as_of, not calendar months.
avg_order_value, avg_order_value_365dComputed from the sums. Zero when there were no orders.
first_order_at, last_order_atNull if the company never ordered — which is what makes them usable as "is this a customer at all?".
currencyThe single currency all counted orders were in. Null when there were none, and also when there were several.
currency_mixedtrue when the company ordered in more than one currency. The sums are still stored, but they are not comparable against a threshold.
orders_as_ofThe instant the rolling windows were measured from.
computed_atHow 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

Request
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.

It is bounded by a wall-clock budget. While 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

Request
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_list points at.
Was this page helpful?