SupplierSupplierRelationship resource; the invite endpoint sends the referral email.
All examples assume:
Manage sub-contractor relationships
The caller’s supplier facility (derived from the API key’s contact) is the source side of every relationship it creates or lists.workOrdersRoutedTo (emails the sub-contractor receives dispatched work at) and supplierAccountEmails (account-level contacts for that sub-contractor).
Invite a sub-contractor
POST /v1/supplier/private_network/supplier_supplier_relationships/{sfId}/invite/{fromEmail}/{toEmail}/name/{fN}/{lN} sends a referral email inviting the sub-contractor onto OpenWrench.
You must create the
SupplierSupplierRelationship first (see above). If no relationship exists for (your facility, sfId) the endpoint returns 404 with could not find supplier supplier relationship.... This mirrors the buyer-side private-network invite flow. The endpoint returns 400 when the caller’s contact has no facility.
The optional JSON body may include a note; when present, its text appears in the email body under the greeting.
Recipient handling
IftoEmail does not match an existing supplier contact, the endpoint auto-creates a supplier contact at facility sfId using fN and lN before sending the email. That contact is flagged as new, which controls the CTA link (see below). If the email already resolves to a contact, no new contact is created.
Email that gets sent
The recipient attoEmail receives an email with:
- Subject:
<referrer first name> from <your facility name> has added <sub-contractor facility name> as a sub-contractor on OpenWrench.Your clientandyouare substituted when the referrer or sub-contractor facility cannot be resolved. - From alias: the referrer’s full name, so the message appears to come from a person on your team.
- CC: the referring contact at
fromEmail. - Body: a greeting to the invited contact, the
note(if any), and a “you’ll get notified at …” line listing the emails OpenWrench will send dispatched work to. - CTA link: for a brand-new supplier contact,
https://partners.useopenwrench.com/supplier/signup?email=<toEmail>so they can finish signup; otherwise the plain portal linkhttps://partners.useopenwrench.com.
workOrdersRoutedTo if it is non-empty, otherwise supplierAccountEmails if it is non-empty, otherwise the invited toEmail itself. Set the routing fields on the relationship before inviting if you want the invite to preview the real dispatch destinations.
End-to-end flow
- Create the relationship:
POST /v1/supplier/private_network/supplier_supplier_relationshipswith the sub-contractor’ssupplierFacilityId. - Optionally set
workOrdersRoutedToandsupplierAccountEmailson the relationship (PUTon the same collection) so the invite email accurately previews where work will land. - Send the invite:
POST .../supplier_supplier_relationships/{sfId}/invite/{fromEmail}/{toEmail}/name/{fN}/{lN}with an optional{ "note": "..." }body.