latestOpenAPI 3.1.02026-08-218667571.2 MB

a8ca30023371

Admin APIs
distributors
Wholesale Distribution

Create Contract

Create a distributor contract for an enterprise client: contract terms, an attached library TOU, and one or more tiers, atomically (PRO-1981). The client's first contract also seats the named distributor admin; later contracts inherit the existing admin.

The named admin no longer has to be a user of the client already (PRO-3268). An address that resolves to nobody is provisioned here, as a Client Admin holding the Distributor Admin role, so the account cannot exist (and cannot be signed into) before the contract that justifies it. It is invited as it is created: the ordering is what keeps the admin out early, so once the contract exists there is nothing to gain by holding the invite back. Naming a user who does already exist is unchanged: they are granted the role by the create itself, and nothing is provisioned.

Order matters both ways. Anything that would stop the provisioning is checked before the contract is written, so a rejected admin leaves no contract behind; the account itself is created after, so a rejected contract leaves no account behind. Between the two, the decision is taken again under the client's create lock, because that first read happened before anything was serialized: see resolve_admin_to_provision for what the second pass settles (a concurrent duplicate, and a replayed form carrying a different address).

post/api/v1/admin/distributors/{client_id}/contracts

Path parameters

client_idstring uuid required

Request body

namestring required
admin_emailstring nullable
admin_namestring nullable
term_startstring date required
term_endstring date required
tou_idstring uuid4 required
signup_plan_idstring nullable

Response

Successful Response

contract_idstring uuid4 required
client_idstring uuid4 required