get.
Open the Page
Callopen_page with { "page": "plan_and_billing" }. It is available to Buyer,
Seller and Organization accounts. The opening call changes nothing. The Page
reads the organization of the selected account itself, so you do not pass an
organization.
A person can do the work that needs a human in the Page: review and accept the
current Terms, and set up where a Seller is paid. Bank details are typed into the
Page and never pass through the model.
Read billing from an agent
get with { "kind": "billing" } returns the organization’s billing in one
read. It takes no ID, filter or include. It always reads the organization of the
selected account, so check object.organization.customerId before you act on
it. Billing: plan and invoices lists every
field. Start with nextAction: the server names the next step, so a caller
never works it out from raw fields.
nextAction.type is NONE when nothing is owed. Any other type is the step to
take, in this order: accept Terms, accept the governing agreement, choose a plan,
add billing details, then set up payment. nextAction.severity is success or
warning, and nextAction.canCompleteInChat is true only when the step is
accepting Terms and the signed-in person can do it from this session.
What you can do
Every write needs an authenticated user with direct authority on the
organization. An administrator of a child account does not have that authority
over its parent organization. A write that names a Terms version is refused when
that version is no longer current, and nothing changes. Read again, then ask the
person to review the new version.
When another organization manages billing
A member of an account whose organization manages its billing, and who is not one of that organization’s administrators, does not get a failure from the read.get returns the organization that manages billing and
changeableBy: "organization_administrator", and the Page shows the same
message. Only an administrator of the managing organization can view or change
its billing. See Response variants.