client.locations.listPracticeLocations(practiceId) -> ListPracticeLocationsResponse
-
-
-
Requires locations:read on a practice key or an authorized platform key. Lists active and archived locations by name, with cursor pagination. Use status to filter. Location records are shared between Test and Live for the same practice.
-
-
-
client.locations().listPracticeLocations( "prac_01j2y8m6jcc9tt24af5pw9x1bc", ListPracticeLocationsRequest .builder() .startingAfter("loc_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("loc_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
status:
Optional<ListPracticeLocationsRequestStatus>
-
-
client.locations.createPracticeLocation(practiceId, request) -> CreatePracticeLocationResponse
-
-
-
Requires locations:write and Idempotency-Key for API keys. Creates an active location with a unique name in this practice. Locations are shared between Test and Live. Use the returned ID for Team location access.
-
-
-
client.locations().createPracticeLocation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", CreatePracticeLocationRequest .builder() .idempotencyKey("Idempotency-Key") .name("name") .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
String
-
city:
Optional<String>
-
country:
Optional<String>
-
line1:
Optional<String>
-
line2:
Optional<String>
-
name:
String
-
phone:
Optional<String>
-
postalCode:
Optional<String>
-
state:
Optional<String>
-
timezone:
Optional<String>— Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record.
-
-
client.locations.getPracticeLocation(practiceId, locationId) -> GetPracticeLocationResponse
-
-
-
Requires locations:read. Returns one active or archived location in the authorized practice.
-
-
-
client.locations().getPracticeLocation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "loc_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeLocationRequest .builder() .build() );
-
-
-
practiceId:
String
-
locationId:
String
-
-
client.locations.updatePracticeLocation(practiceId, locationId, request) -> UpdatePracticeLocationResponse
-
-
-
Requires locations:write and Idempotency-Key for API keys. Updates only supplied fields; null clears optional contact and address fields. Archived locations cannot be updated. Changes apply to both Test and Live.
-
-
-
client.locations().updatePracticeLocation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "loc_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePracticeLocationRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
locationId:
String
-
idempotencyKey:
String
-
city:
Optional<String>
-
country:
Optional<String>
-
line1:
Optional<String>
-
line2:
Optional<String>
-
name:
Optional<String>
-
phone:
Optional<String>
-
postalCode:
Optional<String>
-
state:
Optional<String>
-
timezone:
Optional<String>— Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record.
-
-
client.locations.archivePracticeLocation(practiceId, locationId) -> ArchivePracticeLocationResponse
-
-
-
Requires locations:write and Idempotency-Key for API keys. Retains the location and historical associations. Archived locations cannot receive new Team assignments. Repeating archive returns the archived location. Changes apply to both Test and Live.
-
-
-
client.locations().archivePracticeLocation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "loc_01j2y8m6jcc9tt24af5pw9x1bc", ArchivePracticeLocationRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
locationId:
String
-
idempotencyKey:
String
-
-
client.apiKeys.createPlatformPracticeApiKey(practiceId, request) -> CreatePlatformPracticeApiKeyResponse
-
-
-
Creates a practice API key for a connected practice. Requires a platform key with service_keys:write and every requested scope. The practice key uses the platform key's Test or Live mode and cannot outlive it. Requires Idempotency-Key for safe retries; the secret is returned in the encrypted replay response for 24 hours.
-
-
-
client.apiKeys().createPlatformPracticeApiKey( "practiceId", CreatePlatformPracticeApiKeyRequest .builder() .idempotencyKey("Idempotency-Key") .name("name") .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
String
-
allowedIps:
Optional<List<String>>
-
expiresAt:
Optional<String>
-
name:
String
-
scopes:
Optional<List<CreatePlatformPracticeApiKeyRequestScopesItem>>
-
-
client.apiKeys.getApiAccess() -> GetApiAccessResponse
-
-
-
Returns the subject, mode, and scopes for the API key.
-
-
-
client.apiKeys().getApiAccess();
-
-
client.account.getAccount() -> GetAccountResponse
-
-
-
Returns the platform organization, request livemode, and effective access. API keys report scopes and the service_key role; dashboard sessions report membership permissions. operatingMode describes organization Live access, not the credential's Test/Live mode.
-
-
-
client.account().getAccount( GetAccountRequest .builder() .orgId("acct_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
orgId:
Optional<String>
-
-
client.catalog.listCatalogItems() -> ListCatalogItemsResponse
-
-
-
Lists catalog items for the authenticated account and mode. Use view=medications for priced prescription groups with offer counts, pharmacy counts, and strengths; the default view=offers returns individual offers. Use relatedToCatalogItemId to find offers for the same medication and route. When practiceId is supplied, a practice price overrides the platform price and missing overrides inherit the platform price.
-
-
-
client.catalog().listCatalogItems( ListCatalogItemsRequest .builder() .relatedToCatalogItemId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .catalogItemId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .pharmacyIds( ListCatalogItemsRequestPharmacyIds.of("pharm_01j2y8m6jcc9tt24af5pw9x1bc") ) .endingBefore("cat_01j2y8m6jcc9tt24af5pw9x1bc") .orgId("acct_01j2y8m6jcc9tt24af5pw9x1bc") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("cat_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
view:
Optional<ListCatalogItemsRequestView>
-
relatedToCatalogItemId:
Optional<String>
-
catalogKind:
Optional<ListCatalogItemsRequestCatalogKind>
-
sort:
Optional<ListCatalogItemsRequestSort>
-
catalogItemId:
Optional<String>
-
availability:
Optional<ListCatalogItemsRequestAvailability>
-
pharmacyIds:
Optional<ListCatalogItemsRequestPharmacyIds>
-
dosageForms:
Optional<ListCatalogItemsRequestDosageForms>
-
endingBefore:
Optional<String>
-
hideControlledSubstances:
Optional<Boolean>
-
hideUnpriced:
Optional<Boolean>
-
limit:
Optional<Integer>
-
orgId:
Optional<String>
-
practiceId:
Optional<String>
-
query:
Optional<String>
-
requirement:
Optional<ListCatalogItemsRequestRequirement>
-
routes:
Optional<ListCatalogItemsRequestRoutes>
-
startingAfter:
Optional<String>
-
-
client.catalog.listPharmacies() -> ListPharmaciesResponse
-
-
-
Lists pharmacies available to the authenticated account, including approved invite-only relationships.
-
-
-
client.catalog().listPharmacies( ListPharmaciesRequest .builder() .endingBefore("pharm_01j2y8m6jcc9tt24af5pw9x1bc") .orgId("acct_01j2y8m6jcc9tt24af5pw9x1bc") .pharmacyId("pharm_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("pharm_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
orgId:
Optional<String>
-
pharmacyId:
Optional<String>
-
query:
Optional<String>
-
shipsToState:
Optional<String>
-
startingAfter:
Optional<String>
-
-
client.catalog.listShippingOptions(catalogItemId) -> List<ListShippingOptionsResponseItem>
-
-
-
Returns an array of at most 50 reviewed shipping services eligible for a catalog item, destination, and API mode. destinationState must be a USPS state or territory code. Each option has one temperature; pharmacy catalog summaries list all supported temperatures.
-
-
-
client.catalog().listShippingOptions( "cat_01j2y8m6jcc9tt24af5pw9x1bc", ListShippingOptionsRequest .builder() .destinationState("destinationState") .build() );
-
-
-
catalogItemId:
String
-
destinationState:
String
-
destinationType:
Optional<ListShippingOptionsRequestDestinationType>
-
-
client.catalog.retrievePrescribingOptions(catalogItemId) -> RetrievePrescribingOptionsResponse
-
-
-
Requires catalog:read. Returns reviewed SIG presets, guided patterns, quantity constraints and product requirements for a practice and mode. Revisions identify changed defaults. No patient-specific rationale or diagnosis is inferred.
-
-
-
client.catalog().retrievePrescribingOptions( "cat_01j2y8m6jcc9tt24af5pw9x1bc", RetrievePrescribingOptionsRequest .builder() .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
catalogItemId:
String
-
practiceId:
String
-
-
client.orders.listOrders() -> ListOrdersResponse
-
-
-
client.orders().listOrders( ListOrdersRequest .builder() .endingBefore("ord_01j2y8m6jcc9tt24af5pw9x1bc") .orderId("ord_01j2y8m6jcc9tt24af5pw9x1bc") .patientId("pat_01j2y8m6jcc9tt24af5pw9x1bc") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("ord_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
query:
Optional<String>
-
externalOrderId:
Optional<String>
-
createdAfter:
Optional<String>
-
createdBefore:
Optional<String>
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
orderId:
Optional<String>
-
patientId:
Optional<String>
-
patientExternalId:
Optional<String>
-
practiceId:
Optional<String>
-
sort:
Optional<ListOrdersRequestSort>
-
startingAfter:
Optional<String>
-
status:
Optional<ListOrdersRequestStatus>
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.orders.createOrder(request) -> CreateOrderResponse
-
-
-
Creates one unsigned order with 1–20 prescriptions for one patient in one practice. Supply patientId or patient; inline patient creation requires patients:write. Prescriber is optional: select by npi, provider id, or integration-scoped externalId, or leave the draft unassigned until signing. First-use prescriber registration requires team:write. Legacy userId is supported but cannot be combined with prescriber. Idempotency-Key is required.
-
-
-
client.orders().createOrder( CreateOrderRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .prescriptions( Arrays.asList( CreateOrderRequestPrescriptionsItem .builder() .daysSupply(1) .dispensing( CreateOrderRequestPrescriptionsItemDispensing .builder() .build() ) .directions("directions") .medicationId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .quantity( CreateOrderRequestPrescriptionsItemQuantity.of(CreateOrderRequestPrescriptionsItemQuantityOne.INFINITY) ) .quantityUnit("quantityUnit") .refills(1) .build() ) ) .build() );
-
-
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<CreateOrderRequestPrescriber>
-
otcItems:
Optional<List<CreateOrderRequestOtcItemsItem>>
-
externalOrderId:
Optional<String>
-
metadata:
Optional<Map<String, Optional<CreateOrderRequestMetadataValue>>>
-
patientId:
Optional<String>
-
patient:
Optional<CreateOrderRequestPatient>
-
shippingAddressId:
Optional<String>
-
prescriptions:
List<CreateOrderRequestPrescriptionsItem>
-
-
client.orders.getOrder(orderId) -> GetOrderResponse
-
-
-
client.orders().getOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", GetOrderRequest .builder() .build() );
-
-
-
orderId:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.orders.cancelOrder(orderId, request) -> CancelOrderResponse
-
-
-
Requests cancellation. HTTP 200 means the request was handled; check cancellation.status for confirmed, pending, partial, or failed. Only confirmed means the entire order is cancelled. Shipment possession makes a fulfillment cancellation too late.
-
-
-
client.orders().cancelOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", CancelOrderRequest .builder() .idempotencyKey("Idempotency-Key") .reason("reason") .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
reason:
String
-
-
client.orders.actOnOrderException(orderId, exceptionId, request) -> ActOnOrderExceptionResponse
-
-
-
Acknowledge, retry, contact, or resolve an order exception in the credential's Test/Live mode. assign_to_me requires a signed-in dashboard user; API keys receive 400 and may use acknowledge instead. Actor headers do not create a dashboard assignee.
-
-
-
client.orders().actOnOrderException( "ord_01j2y8m6jcc9tt24af5pw9x1bc", "fex_01j2y8m6jcc9tt24af5pw9x1bc", ActOnOrderExceptionRequest .builder() .idempotencyKey("Idempotency-Key") .action(ActOnOrderExceptionRequestAction.ACKNOWLEDGE) .build() );
-
-
-
orderId:
String
-
exceptionId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
action:
ActOnOrderExceptionRequestAction
-
note:
Optional<String>
-
-
client.orders.listOrderEvents(orderId) -> ListOrderEventsResponse
-
-
-
client.orders().listOrderEvents( "ord_01j2y8m6jcc9tt24af5pw9x1bc", ListOrderEventsRequest .builder() .endingBefore("evt_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("evt_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
orderId:
String
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.orders.getOrderTestSimulation(orderId) -> GetOrderTestSimulationResponse
-
-
-
Requires orders:write. Available only in Test mode.
-
-
-
client.orders().getOrderTestSimulation( "ord_01j2y8m6jcc9tt24af5pw9x1bc", GetOrderTestSimulationRequest .builder() .build() );
-
-
-
orderId:
String
-
-
client.orders.updateOrderTestSimulation(orderId, request) -> UpdateOrderTestSimulationResponse
-
-
-
Requires orders:write and Idempotency-Key. Configure before submission or queue a valid pharmacy event in manual mode. Events use normal order history and Test webhooks. Live requests are rejected.
-
-
-
client.orders().updateOrderTestSimulation( "ord_01j2y8m6jcc9tt24af5pw9x1bc", UpdateOrderTestSimulationRequest .builder() .idempotencyKey("Idempotency-Key") .mode(UpdateOrderTestSimulationRequestMode.AUTOMATIC) .scenario(UpdateOrderTestSimulationRequestScenario.SUCCESSFUL) .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
mode:
UpdateOrderTestSimulationRequestMode
-
scenario:
UpdateOrderTestSimulationRequestScenario
-
action:
Optional<UpdateOrderTestSimulationRequestAction>
-
-
client.orders.previewOrder(request) -> PreviewOrderResponse
-
-
-
Requires orders:write and catalog:read. Supply exactly one of patientId, patientExternalId, or inline patient details. External-ID lookup additionally requires patients:read; inline details require patients:write. Resolves defaults and explicit edits for 1–20 prescriptions. Reuses stored patient details when identifiers match; otherwise previews inline details without creating a patient. Complete previews contain an orders.create input. Does not create records, reserve prices, sign, charge or transmit. No idempotency key is required. Creation and signing recheck current requirements.
-
-
-
client.orders().previewOrder( PreviewOrderRequest .builder() .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .prescriptions( Arrays.asList( PreviewOrderRequestPrescriptionsItem .builder() .medicationId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .build() ) ) .build() );
-
-
-
otcItems:
Optional<List<PreviewOrderRequestOtcItemsItem>>
-
practiceId:
String
-
patientId:
Optional<String>
-
patientExternalId:
Optional<String>
-
patient:
Optional<PreviewOrderRequestPatient>
-
userId:
Optional<String>
-
prescriber:
Optional<PreviewOrderRequestPrescriber>
-
shippingAddressId:
Optional<String>
-
externalOrderId:
Optional<String>
-
prescriptions:
List<PreviewOrderRequestPrescriptionsItem>
-
shipping:
Optional<PreviewOrderRequestShipping>
-
-
client.orders.signOrder(orderId, request) -> SignOrderResponse
-
-
-
Requires orders:sign, Idempotency-Key, signatureAttestation, and expectedRevision from the reviewed order. Existing integrations may send expectedVersions instead; supply exactly one. A stale revision returns 409 and requires renewed clinician review. Select prescriber by npi, provider id, or integration-scoped externalId, or inherit the draft's prescriber. First-use registration requires team:write. Actor headers are optional audit metadata with prescriber; legacy userId requires matching clinician actor headers. Signing does not submit to a pharmacy.
-
-
-
client.orders().signOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", SignOrderRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .signatureAttestation(true) .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<SignOrderRequestPrescriber>
-
signatureAttestation:
Boolean
-
expectedRevision:
Optional<String>— Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict.
-
expectedVersions:
Optional<List<SignOrderRequestExpectedVersionsItem>>
-
-
client.orders.signAndSubmitOrder(orderId, request) -> SignAndSubmitOrderResponse
-
-
-
Requires orders:sign, Idempotency-Key, signatureAttestation, and expectedRevision from the reviewed order. Existing integrations may send expectedVersions instead; supply exactly one. A stale revision returns 409 and requires renewed clinician review. Select prescriber by npi, provider id, or externalId, or inherit the draft's prescriber. First-use registration requires team:write. Actor headers are optional with prescriber; legacy userId requires matching clinician actor headers. Signs the complete order, then attempts each submission. Signing remains committed if submission fails. Replay the same key after an uncertain response; retry reported submission failures through Submit order with a new key. Submitted means queued, not pharmacy acceptance.
-
-
-
client.orders().signAndSubmitOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", SignAndSubmitOrderRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .signatureAttestation(true) .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<SignAndSubmitOrderRequestPrescriber>
-
signatureAttestation:
Boolean
-
expectedRevision:
Optional<String>— Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict.
-
expectedVersions:
Optional<List<SignAndSubmitOrderRequestExpectedVersionsItem>>
-
-
client.orders.submitOrder(orderId, request) -> SubmitOrderResponse
-
-
-
Requires orders:sign and Idempotency-Key. Queues signed prescriptions after rechecking authorization, signature integrity, billing, and fulfillment eligibility. Track pharmacy acceptance through order reads and webhooks. After a partial failure, retry submission with a new idempotency key; already queued prescriptions are not duplicated.
-
-
-
client.orders().submitOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", SubmitOrderRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<SubmitOrderRequestPrescriber>
-
-
client.orders.rejectOrder(orderId, request) -> RejectOrderResponse
-
-
-
Requires orders:sign and Idempotency-Key. Select a prescriber or inherit the draft's prescriber. Legacy userId requires matching clinician actor headers. Supply expectedRevision from the reviewed order, or expectedVersions for existing integrations. Permanently rejects the complete unsigned order after checking its revision.
-
-
-
client.orders().rejectOrder( "ord_01j2y8m6jcc9tt24af5pw9x1bc", RejectOrderRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .reason("reason") .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<RejectOrderRequestPrescriber>
-
reason:
String
-
expectedRevision:
Optional<String>— Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict.
-
expectedVersions:
Optional<List<RejectOrderRequestExpectedVersionsItem>>
-
-
client.orders.addOrderPrescription(orderId, request) -> AddOrderPrescriptionResponse
-
-
-
Requires orders:write, Idempotency-Key and expectedRevision from the order being edited. Existing integrations may send expectedVersions instead; supply exactly one. Adds a complete prescription to an unsigned Order and returns all new versions. Omitted actor context defaults to the authenticated service account as a system actor. Patient and prescriber attribution stay fixed. Signed orders cannot be amended through this endpoint. Signing and submission require orders:sign through their separate endpoints.
-
-
-
client.orders().addOrderPrescription( "ord_01j2y8m6jcc9tt24af5pw9x1bc", AddOrderPrescriptionRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .prescription( AddOrderPrescriptionRequestPrescription .builder() .daysSupply(1) .dispensing( AddOrderPrescriptionRequestPrescriptionDispensing .builder() .build() ) .directions("directions") .medicationId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .quantity( AddOrderPrescriptionRequestPrescriptionQuantity.of(AddOrderPrescriptionRequestPrescriptionQuantityOne.INFINITY) ) .quantityUnit("quantityUnit") .refills(1) .build() ) .build() );
-
-
-
orderId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
metadata:
Optional<Map<String, Optional<AddOrderPrescriptionRequestMetadataValue>>>
-
practiceId:
String
-
expectedRevision:
Optional<String>— Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict.
-
expectedVersions:
Optional<List<AddOrderPrescriptionRequestExpectedVersionsItem>>
-
prescription:
AddOrderPrescriptionRequestPrescription
-
-
client.orders.updateOrderPrescription(orderId, prescriptionId, request) -> UpdateOrderPrescriptionResponse
-
-
-
Requires orders:write, Idempotency-Key and expectedRevision from the order being edited. Existing integrations may send expectedVersions instead; supply exactly one. Replaces one prescription with complete medication instructions and returns all new versions. Omitted actor context defaults to the authenticated service account as a system actor. Patient and prescriber attribution stay fixed. Signed orders cannot be amended through this endpoint. Signing and submission require orders:sign through their separate endpoints.
-
-
-
client.orders().updateOrderPrescription( "ord_01j2y8m6jcc9tt24af5pw9x1bc", "rx_01j2y8m6jcc9tt24af5pw9x1bc", UpdateOrderPrescriptionRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .prescription( UpdateOrderPrescriptionRequestPrescription .builder() .daysSupply(1) .dispensing( UpdateOrderPrescriptionRequestPrescriptionDispensing .builder() .build() ) .directions("directions") .medicationId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .quantity( UpdateOrderPrescriptionRequestPrescriptionQuantity.of(UpdateOrderPrescriptionRequestPrescriptionQuantityOne.INFINITY) ) .quantityUnit("quantityUnit") .refills(1) .build() ) .build() );
-
-
-
orderId:
String
-
prescriptionId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
metadata:
Optional<Map<String, Optional<UpdateOrderPrescriptionRequestMetadataValue>>>
-
practiceId:
String
-
expectedRevision:
Optional<String>— Opaque revision of the complete order prescription set. Send the revision you reviewed as expectedRevision; never replace it automatically after a conflict.
-
expectedVersions:
Optional<List<UpdateOrderPrescriptionRequestExpectedVersionsItem>>
-
prescription:
UpdateOrderPrescriptionRequestPrescription
-
-
client.orders.createOrderBatch(request) -> CreateOrderBatchResponse
-
-
-
Creates 1–20 orders for distinct patients in one practice, each with 1–20 prescriptions. Each accepts patientId or inline patient details. Orders and newly created patients commit atomically; any failure saves none. Requires orders:write and Idempotency-Key; inline patients also require patients:write. Omitted actor context defaults to the authenticated service account as a system actor. Sign and submit each resulting order separately using orders:sign.
-
-
-
client.orders().createOrderBatch( CreateOrderBatchRequest .builder() .idempotencyKey("Idempotency-Key") .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .orders( Arrays.asList( CreateOrderBatchRequestOrdersItem .builder() .prescriptions( Arrays.asList( CreateOrderBatchRequestOrdersItemPrescriptionsItem .builder() .daysSupply(1) .dispensing( CreateOrderBatchRequestOrdersItemPrescriptionsItemDispensing .builder() .build() ) .directions("directions") .medicationId("cat_01j2y8m6jcc9tt24af5pw9x1bc") .quantity( CreateOrderBatchRequestOrdersItemPrescriptionsItemQuantity.of(CreateOrderBatchRequestOrdersItemPrescriptionsItemQuantityOne.INFINITY) ) .quantityUnit("quantityUnit") .refills(1) .build() ) ) .build() ) ) .build() );
-
-
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
practiceId:
String
-
userId:
Optional<String>
-
prescriber:
Optional<CreateOrderBatchRequestPrescriber>
-
orders:
List<CreateOrderBatchRequestOrdersItem>
-
-
client.webhooks.listWebhookEndpoints() -> ListWebhookEndpointsResponse
-
-
-
Requires webhooks:read. Returns endpoints owned by the key organization, or the organization selected with X-Affinity-Organization-Id. Platform delegation requires a webhook grant in the key's mode.
-
-
-
client.webhooks().listWebhookEndpoints( ListWebhookEndpointsRequest .builder() .endingBefore("whe_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("whe_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
-
client.webhooks.createWebhookEndpoint(request) -> CreateWebhookEndpointResponse
-
-
-
Requires webhooks:write and Idempotency-Key. Defaults to the API key organization. A platform can select a practice or pharmacy owner with X-Affinity-Organization-Id and an explicit webhook grant. For platform-owned endpoints, practiceIds narrows delivery to selected connected practices. An empty filter receives all otherwise-authorized events.
-
-
-
client.webhooks().createWebhookEndpoint( CreateWebhookEndpointRequest .builder() .idempotencyKey("Idempotency-Key") .url("url") .build() );
-
-
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
practiceIds:
Optional<List<String>>
-
description:
Optional<String>
-
payloadStyle:
Optional<CreateWebhookEndpointRequestPayloadStyle>
-
subscribedEvents:
Optional<List<CreateWebhookEndpointRequestSubscribedEventsItem>>
-
url:
String
-
-
client.webhooks.deleteWebhookEndpoint(endpointId) -> DeleteWebhookEndpointResponse
-
-
-
client.webhooks().deleteWebhookEndpoint( "whe_01j2y8m6jcc9tt24af5pw9x1bc", DeleteWebhookEndpointRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
endpointId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
-
client.webhooks.updateWebhookEndpoint(endpointId, request) -> UpdateWebhookEndpointResponse
-
-
-
Requires webhooks:write and Idempotency-Key. Updates an endpoint in the selected organization and mode. Omitted practiceIds preserves the filter; an empty array removes the practice filter. Subscription changes apply to newly generated events.
-
-
-
client.webhooks().updateWebhookEndpoint( "whe_01j2y8m6jcc9tt24af5pw9x1bc", UpdateWebhookEndpointRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
endpointId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
practiceIds:
Optional<List<String>>
-
description:
Optional<String>
-
payloadStyle:
Optional<UpdateWebhookEndpointRequestPayloadStyle>
-
status:
Optional<UpdateWebhookEndpointRequestStatus>
-
subscribedEvents:
Optional<List<UpdateWebhookEndpointRequestSubscribedEventsItem>>
-
url:
Optional<String>
-
-
client.webhooks.rotateWebhookEndpointSecret(endpointId) -> RotateWebhookEndpointSecretResponse
-
-
-
client.webhooks().rotateWebhookEndpointSecret( "whe_01j2y8m6jcc9tt24af5pw9x1bc", RotateWebhookEndpointSecretRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
endpointId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
-
client.webhooks.testWebhookEndpoint(endpointId) -> TestWebhookEndpointResponse
-
-
-
client.webhooks().testWebhookEndpoint( "whe_01j2y8m6jcc9tt24af5pw9x1bc", TestWebhookEndpointRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
endpointId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
-
client.webhooks.listWebhookEvents() -> ListWebhookEventsResponse
-
-
-
client.webhooks().listWebhookEvents( ListWebhookEventsRequest .builder() .endingBefore("evt_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("evt_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
status:
Optional<ListWebhookEventsRequestStatus>
-
startingAfter:
Optional<String>
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
-
client.webhooks.getWebhookEvent(eventId) -> GetWebhookEventResponse
-
-
-
client.webhooks().getWebhookEvent( "evt_01j2y8m6jcc9tt24af5pw9x1bc", GetWebhookEventRequest .builder() .build() );
-
-
-
eventId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
-
client.webhooks.replayWebhookEvent(eventId) -> ReplayWebhookEventResponse
-
-
-
client.webhooks().replayWebhookEvent( "evt_01j2y8m6jcc9tt24af5pw9x1bc", ReplayWebhookEventRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
eventId:
String
-
affinityOrganizationId:
Optional<String>— Defaults to the API key organization. A platform may select a practice or pharmacy only with an explicit webhook grant in this mode. This changes the webhook owner, not the caller or event subscriptions.
-
idempotencyKey:
String
-
-
client.webhooks.listWebhookGrants() -> ListWebhookGrantsResponse
-
-
-
Requires webhooks:read on the owning practice or pharmacy key. Lists platform webhook grants in the key's mode. Platforms cannot list or grant themselves delegated access.
-
-
-
client.webhooks().listWebhookGrants( ListWebhookGrantsRequest .builder() .startingAfter("acct_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("acct_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
-
client.webhooks.saveWebhookGrant(platformId, request) -> SaveWebhookGrantResponse
-
-
-
Requires webhooks:write on the owning practice or pharmacy key and Idempotency-Key. Grants or replaces a platform's webhook permissions in this mode. A practice must already be connected to that platform. The grant does not give the platform access to other API resources.
-
-
-
client.webhooks().saveWebhookGrant( "acct_01j2y8m6jcc9tt24af5pw9x1bc", SaveWebhookGrantRequest .builder() .idempotencyKey("Idempotency-Key") .scopes( Arrays.asList(SaveWebhookGrantRequestScopesItem.WEBHOOKS_READ) ) .build() );
-
-
-
platformId:
String
-
idempotencyKey:
String
-
scopes:
List<SaveWebhookGrantRequestScopesItem>
-
-
client.webhooks.revokeWebhookGrant(platformId) -> RevokeWebhookGrantResponse
-
-
-
Requires webhooks:write on the owning practice or pharmacy key and Idempotency-Key. Removes platform webhook access in this mode. Existing endpoints remain owned by the practice or pharmacy and continue operating.
-
-
-
client.webhooks().revokeWebhookGrant( "acct_01j2y8m6jcc9tt24af5pw9x1bc", RevokeWebhookGrantRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
platformId:
String
-
idempotencyKey:
String
-
-
client.team.registerUser(practiceId, request) -> RegisterUserResponse
-
-
-
Requires team:write and Idempotency-Key. Registers a practice member without an invitation. Test requires synthetic .test emails and Affinity Test NPIs. Live requires approved integration and practice access. Identity attestation records the integration's assertion; it does not verify login email or clinical credentials. Existing memberships and verified provider records are preserved. Use the returned user ID for orders and signing.
-
-
-
client.team().registerUser( "prac_01j2y8m6jcc9tt24af5pw9x1bc", RegisterUserRequest .builder() .idempotencyKey("Idempotency-Key") .externalId("externalId") .email("email") .name("name") .role(RegisterUserRequestRole.ADMINISTRATOR) .identityAttestation(true) .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
String
-
externalId:
String
-
email:
String
-
name:
String
-
role:
RegisterUserRequestRole
-
roles:
Optional<List<RegisterUserRequestRolesItem>>
-
profileDetails:
Optional<RegisterUserRequestProfileDetails>
-
npi:
Optional<String>
-
licenses:
Optional<List<RegisterUserRequestLicensesItem>>
-
legalName:
Optional<String>
-
displayName:
Optional<String>
-
credentials:
Optional<String>
-
address:
Optional<RegisterUserRequestAddress>
-
phone:
Optional<String>
-
locationIds:
Optional<List<String>>
-
identityAttestation:
Boolean
-
-
client.team.listPracticeTeamInvitations(practiceId) -> ListPracticeTeamInvitationsResponse
-
-
-
Requires team:read. Lists practice invitations, including invitations sent in Clinic. Filter by pending, expired, accepted, declined, or revoked status, exact email, or your integration externalId. Only your integration and API key mode can see its external identity and onboarding state. Follow person.nextActions after invitation acceptance.
-
-
-
client.team().listPracticeTeamInvitations( "prac_01j2y8m6jcc9tt24af5pw9x1bc", ListPracticeTeamInvitationsRequest .builder() .startingAfter("invite_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("invite_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
status:
Optional<ListPracticeTeamInvitationsRequestStatus>
-
email:
Optional<String>
-
externalId:
Optional<String>— Match this integration's external identity in the API key's mode.
-
-
client.team.invitePracticeTeamPerson(practiceId, request) -> InvitePracticeTeamPersonResponse
-
-
-
Requires team:write on the practice key or its platform key. Use roles to combine administrator, prescriber, clinical_staff, billing, or developer presets. Ownership uses the protected owner designation. The singular role field remains available for single-role assignments. Creates a real organization invitation and optional prescriber setup. The recipient must accept with their Affinity account. Repeating the same external identity retries pending invitation delivery. Accepted invitations do not change existing access. Team membership is shared between Test and Live; the external identity is mode-scoped. Keys cannot accept invitations. Headless registration and signing use separate endpoints.
-
-
-
client.team().invitePracticeTeamPerson( "prac_01j2y8m6jcc9tt24af5pw9x1bc", InvitePracticeTeamPersonRequest .builder() .idempotencyKey("Idempotency-Key") .externalId("externalId") .email("email") .name("name") .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
String
-
externalId:
String
-
email:
String
-
name:
String
-
role:
Optional<InvitePracticeTeamPersonRequestRole>
-
roles:
Optional<List<InvitePracticeTeamPersonRequestRolesItem>>
-
profileDetails:
Optional<InvitePracticeTeamPersonRequestProfileDetails>
-
npi:
Optional<String>
-
licenses:
Optional<List<InvitePracticeTeamPersonRequestLicensesItem>>
-
legalName:
Optional<String>
-
displayName:
Optional<String>
-
credentials:
Optional<String>
-
address:
Optional<InvitePracticeTeamPersonRequestAddress>
-
phone:
Optional<String>
-
locationIds:
Optional<List<String>>
-
-
client.team.getPracticeTeam(practiceId) -> GetPracticeTeamResponse
-
-
-
Requires team:read. Returns counts of members, invitations, and prescribers. Use the paginated members, prescribers, and invitations collections for individual records. Team access and clinician credentials are shared between Test and Live.
-
-
-
client.team().getPracticeTeam( "prac_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeTeamRequest .builder() .build() );
-
-
-
practiceId:
String
-
-
client.team.listPracticeTeamMembers(practiceId) -> ListPracticeTeamMembersResponse
-
-
-
Requires team:read. Search the roster by name or email, and filter by role or membership status. Includes members invited in Clinic, location access, and account-specific prescriber connections. Memberships are shared between Test and Live.
-
-
-
client.team().listPracticeTeamMembers( "prac_01j2y8m6jcc9tt24af5pw9x1bc", ListPracticeTeamMembersRequest .builder() .startingAfter("mbr_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("mbr_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
search:
Optional<String>
-
role:
Optional<ListPracticeTeamMembersRequestRole>
-
status:
Optional<ListPracticeTeamMembersRequestStatus>
-
-
client.team.listPracticeTeamPrescribers(practiceId) -> ListPracticeTeamPrescribersResponse
-
-
-
Requires team:read. Filter practice prescribers by name, NPI, state, and practice status. Records include submitted licenses and their IDs. Signing authority also requires an active account connection, Live practice access, and prescription eligibility.
-
-
-
client.team().listPracticeTeamPrescribers( "prac_01j2y8m6jcc9tt24af5pw9x1bc", ListPracticeTeamPrescribersRequest .builder() .startingAfter("prov_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("prov_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
search:
Optional<String>
-
npi:
Optional<String>
-
state:
Optional<String>— Match a submitted license jurisdiction. This does not establish signing eligibility.
-
status:
Optional<ListPracticeTeamPrescribersRequestStatus>
-
-
client.team.getPracticeTeamMember(practiceId, memberId) -> GetPracticeTeamMemberResponse
-
-
-
Requires team:read. Returns current account membership, roles, location access, and prescriber connection. The member ID identifies practice access; it is not the integration user ID used by orders.
-
-
-
client.team().getPracticeTeamMember( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "mbr_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeTeamMemberRequest .builder() .build() );
-
-
-
practiceId:
String
-
memberId:
String
-
-
client.team.updatePracticeTeamMember(practiceId, memberId, request) -> UpdatePracticeTeamMemberResponse
-
-
-
Requires team:write. Supply role, status, or locationIds; omitted values stay unchanged. A role replaces existing roles. Disable access with status disabled. An empty locationIds array grants all practice locations. Ownership changes require an active practice owner using a personal API key; service keys manage non-owner memberships. The final active owner cannot be removed. Changes apply to both Test and Live. Sign-in email and account security remain account settings.
-
-
-
client.team().updatePracticeTeamMember( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "mbr_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePracticeTeamMemberRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
memberId:
String
-
idempotencyKey:
String
-
role:
Optional<UpdatePracticeTeamMemberRequestRole>
-
roles:
Optional<List<UpdatePracticeTeamMemberRequestRolesItem>>
-
status:
Optional<UpdatePracticeTeamMemberRequestStatus>
-
locationIds:
Optional<List<String>>— Replace location access. An empty array grants access to all practice locations.
-
-
client.team.getPracticeTeamPrescriber(practiceId, prescriberId) -> GetPracticeTeamPrescriberResponse
-
-
-
Requires team:read. Returns the clinical profile and submitted licenses, including license IDs. This is setup information, not a signing authorization.
-
-
-
client.team().getPracticeTeamPrescriber( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "prov_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeTeamPrescriberRequest .builder() .build() );
-
-
-
practiceId:
String
-
prescriberId:
String
-
-
client.team.updatePracticeTeamPrescriber(practiceId, prescriberId, request) -> UpdatePracticeTeamPrescriberResponse
-
-
-
Requires team:write. Set practiceStatus to inactive to remove prescribing access in this practice, or active to restore an existing association. This does not create membership or signing authority. Practice status applies to Test and Live. Shared identity and license edits require Affinity support.
-
-
-
client.team().updatePracticeTeamPrescriber( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "prov_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePracticeTeamPrescriberRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
prescriberId:
String
-
idempotencyKey:
String
-
displayName:
Optional<String>
-
legalName:
Optional<String>
-
credentials:
Optional<String>
-
phone:
Optional<String>
-
address:
Optional<UpdatePracticeTeamPrescriberRequestAddress>
-
practiceStatus:
Optional<UpdatePracticeTeamPrescriberRequestPracticeStatus>
-
-
client.team.createPracticeTeamLicense(practiceId, prescriberId, request) -> CreatePracticeTeamLicenseResponse
-
-
-
Requires team:write and an active accepted prescriber account connection in this practice. Adds a license. Expiration is optional, but must be in the future when supplied. An exact repeat returns the existing license; update an existing license with PATCH and its license ID. Licenses are shared across practices and Test/Live. Other licenses stay unchanged.
-
-
-
client.team().createPracticeTeamLicense( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "prov_01j2y8m6jcc9tt24af5pw9x1bc", CreatePracticeTeamLicenseRequest .builder() .idempotencyKey("Idempotency-Key") .state("state") .licenseNumber("licenseNumber") .build() );
-
-
-
practiceId:
String
-
prescriberId:
String
-
idempotencyKey:
String
-
state:
String
-
licenseNumber:
String
-
expiresAt:
Optional<String>
-
-
client.team.updatePracticeTeamLicense(practiceId, prescriberId, licenseId, request) -> UpdatePracticeTeamLicenseResponse
-
-
-
Requires team:write and an active accepted prescriber account connection in this practice. Correct the state or license number, or set or clear the optional expiresAt value. A supplied expiration must be in the future. Other licenses stay unchanged. Changes apply across practices and Test/Live.
-
-
-
client.team().updatePracticeTeamLicense( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "prov_01j2y8m6jcc9tt24af5pw9x1bc", "lic_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePracticeTeamLicenseRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
prescriberId:
String
-
licenseId:
String
-
idempotencyKey:
String
-
state:
Optional<String>
-
licenseNumber:
Optional<String>
-
expiresAt:
Optional<String>
-
-
client.team.getPracticeTeamInvitation(practiceId, invitationId) -> GetPracticeTeamInvitationResponse
-
-
-
Requires team:read. Returns invitation status and current onboarding state for your integration. An accepted invitation can still have disabled membership or pending clinical review. Invitation tokens are never returned.
-
-
-
client.team().getPracticeTeamInvitation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "invite_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeTeamInvitationRequest .builder() .build() );
-
-
-
practiceId:
String
-
invitationId:
String
-
-
client.team.revokePracticeTeamInvitation(practiceId, invitationId) -> RevokePracticeTeamInvitationResponse
-
-
-
Requires team:write. Revokes a pending or expired invitation and its pending prescriber account connection. Repeating the revoke returns the revoked invitation. Accepted invitations return 409; disable the member instead. Retains invitation history.
-
-
-
client.team().revokePracticeTeamInvitation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "invite_01j2y8m6jcc9tt24af5pw9x1bc", RevokePracticeTeamInvitationRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
invitationId:
String
-
idempotencyKey:
String
-
-
client.team.resendPracticeTeamInvitation(practiceId, invitationId) -> ResendPracticeTeamInvitationResponse
-
-
-
Requires team:write. Resends a pending or expired invitation with the same ID, recipient, roles, and locations. The previous link stops working and the new link expires in seven days. Accepted and revoked invitations return 409. A 502 means the invitation was saved but email delivery could not be confirmed; retry this operation.
-
-
-
client.team().resendPracticeTeamInvitation( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "invite_01j2y8m6jcc9tt24af5pw9x1bc", ResendPracticeTeamInvitationRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
invitationId:
String
-
idempotencyKey:
String
-
-
client.patients.listPatientAddresses(practiceId, patientId) -> ListPatientAddressesResponse
-
-
-
client.patients().listPatientAddresses( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", ListPatientAddressesRequest .builder() .startingAfter("addr_01j2y8m6jcc9tt24af5pw9x1bc") .endingBefore("addr_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
status:
Optional<ListPatientAddressesRequestStatus>
-
startingAfter:
Optional<String>
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.createPatientAddress(practiceId, patientId, request) -> CreatePatientAddressResponse
-
-
-
Returns the existing active address for a normalized duplicate. The first address becomes the default. API keys require Idempotency-Key.
-
-
-
client.patients().createPatientAddress( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", CreatePatientAddressRequest .builder() .idempotencyKey("Idempotency-Key") .address( CreatePatientAddressRequestAddress .builder() .city("city") .line1("line1") .postalCode("postalCode") .state("state") .build() ) .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
address:
CreatePatientAddressRequestAddress
-
label:
Optional<String>
-
preferredShipping:
Optional<Boolean>
-
recipientName:
Optional<String>
-
-
client.patients.archivePatientAddress(practiceId, patientId, addressId) -> ArchivePatientAddressResponse
-
-
-
Preserves the address ID and history. Archiving the default selects the oldest remaining active address. Existing orders remain unchanged.
-
-
-
client.patients().archivePatientAddress( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", "addr_01j2y8m6jcc9tt24af5pw9x1bc", ArchivePatientAddressRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
addressId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.updatePatientAddress(practiceId, patientId, addressId, request) -> UpdatePatientAddressResponse
-
-
-
client.patients().updatePatientAddress( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", "addr_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePatientAddressRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
addressId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
address:
Optional<UpdatePatientAddressRequestAddress>
-
label:
Optional<String>
-
recipientName:
Optional<String>
-
preferredShipping:
Optional<Boolean>
-
-
client.patients.setDefaultPatientAddress(practiceId, patientId, addressId) -> SetDefaultPatientAddressResponse
-
-
-
Changes delivery selection for future drafts, without changing patient clinical location or existing signed orders.
-
-
-
client.patients().setDefaultPatientAddress( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", "addr_01j2y8m6jcc9tt24af5pw9x1bc", SetDefaultPatientAddressRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
addressId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.listPatients(practiceId) -> ListPatientsResponse
-
-
-
Lists patients in one practice and mode. Use externalId for an exact match in the calling integration's namespace. Use externalIdentitySource with externalIdentityValue to search an explicit alias. Identity matching is case-sensitive after trimming whitespace. Other filters also apply.
-
-
-
client.patients().listPatients( "prac_01j2y8m6jcc9tt24af5pw9x1bc", ListPatientsRequest .builder() .endingBefore("pat_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("pat_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
practiceId:
String
-
endingBefore:
Optional<String>
-
externalId:
Optional<String>
-
externalIdentitySource:
Optional<String>
-
externalIdentityValue:
Optional<String>
-
gender:
Optional<ListPatientsRequestGender>
-
lastOrderAfter:
Optional<String>
-
lastOrderBefore:
Optional<String>
-
limit:
Optional<Integer>
-
program:
Optional<String>
-
query:
Optional<String>
-
sort:
Optional<ListPatientsRequestSort>
-
startingAfter:
Optional<String>
-
states:
Optional<String>
-
status:
Optional<ListPatientsRequestStatus>
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.createPatient(practiceId, request) -> CreatePatientResponse
-
-
-
Creates a patient or resolves a matching externalId or external identity within this practice and mode. externalId belongs to the calling integration; externalIdentities holds aliases from other systems. Resolution preserves existing demographics; use PATCH to update them. Conflicting identifiers return 409. Email never merges patients. API keys require Idempotency-Key.
-
-
-
client.patients().createPatient( "prac_01j2y8m6jcc9tt24af5pw9x1bc", CreatePatientRequest .builder() .idempotencyKey("Idempotency-Key") .dateOfBirth("dateOfBirth") .name( CreatePatientRequestName .builder() .first("first") .last("last") .build() ) .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
address:
Optional<CreatePatientRequestAddress>
-
clinicalProfile:
Optional<CreatePatientRequestClinicalProfile>
-
dateOfBirth:
String
-
email:
Optional<String>
-
externalId:
Optional<String>
-
externalIdentities:
Optional<List<CreatePatientRequestExternalIdentitiesItem>>
-
addresses:
Optional<List<CreatePatientRequestAddressesItem>>
-
encounters:
Optional<List<CreatePatientRequestEncountersItem>>
-
gender:
Optional<CreatePatientRequestGender>
-
locationId:
Optional<String>
-
metadata:
Optional<Map<String, Object>>
-
medicalRecordNumber:
Optional<String>
-
measurements:
Optional<List<CreatePatientRequestMeasurementsItem>>
-
name:
CreatePatientRequestName
-
phone:
Optional<String>
-
programs:
Optional<List<CreatePatientRequestProgramsItem>>
-
-
client.patients.getPatient(practiceId, patientId) -> GetPatientResponse
-
-
-
Returns one patient in the authorized practice and mode.
-
-
-
client.patients().getPatient( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", GetPatientRequest .builder() .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.deletePatient(practiceId, patientId) -> DeletePatientResponse
-
-
-
Requires patients:write and Idempotency-Key for API keys. Permanently deletes a patient with no order history. Any order history returns 409; use Update patient with status archived instead. Available to practice keys and authorized platform keys. Reusing the same idempotency key returns the original deletion result.
-
-
-
client.patients().deletePatient( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", DeletePatientRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.updatePatient(practiceId, patientId, request) -> UpdatePatientResponse
-
-
-
Updates a patient in the current practice and mode. Omitted fields remain unchanged; null clears an optional field. externalId updates the calling integration's identifier. externalIdentities replaces its explicit aliases. Identifiers cannot be reassigned from another patient. API keys require Idempotency-Key.
-
-
-
client.patients().updatePatient( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePatientRequest .builder() .idempotencyKey("Idempotency-Key") .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
address:
Optional<UpdatePatientRequestAddress>
-
clinicalProfile:
Optional<UpdatePatientRequestClinicalProfile>
-
dateOfBirth:
Optional<String>
-
email:
Optional<String>
-
externalId:
Optional<String>
-
externalIdentities:
Optional<List<UpdatePatientRequestExternalIdentitiesItem>>
-
addresses:
Optional<List<UpdatePatientRequestAddressesItem>>
-
encounters:
Optional<List<UpdatePatientRequestEncountersItem>>
-
gender:
Optional<UpdatePatientRequestGender>
-
locationId:
Optional<String>
-
metadata:
Optional<Map<String, Object>>
-
medicalRecordNumber:
Optional<String>
-
measurements:
Optional<List<UpdatePatientRequestMeasurementsItem>>
-
name:
Optional<UpdatePatientRequestName>
-
programs:
Optional<List<UpdatePatientRequestProgramsItem>>
-
phone:
Optional<String>
-
status:
Optional<UpdatePatientRequestStatus>
-
-
client.patients.getPatientAllergies(practiceId, patientId) -> GetPatientAllergiesResponse
-
-
-
Returns the patient's structured allergy entries and review status. A not_reviewed status is not a no-known-allergies assertion and blocks clinical review and signing.
-
-
-
client.patients().getPatientAllergies( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", GetPatientAllergiesRequest .builder() .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
-
client.patients.replacePatientAllergies(practiceId, patientId, request) -> ReplacePatientAllergiesResponse
-
-
-
Replaces the patient's structured allergy record. Sending no_known is the explicit no-known-allergies acknowledgement; recorded requires at least one entry. Idempotency-Key is required.
-
-
-
client.patients().replacePatientAllergies( "prac_01j2y8m6jcc9tt24af5pw9x1bc", "pat_01j2y8m6jcc9tt24af5pw9x1bc", ReplacePatientAllergiesRequest .builder() .idempotencyKey("Idempotency-Key") .reviewStatus(ReplacePatientAllergiesRequestReviewStatus.NOT_REVIEWED) .allergies( Arrays.asList( ReplacePatientAllergiesRequestAllergiesItem .builder() .category(ReplacePatientAllergiesRequestAllergiesItemCategory.DRUG) .source(ReplacePatientAllergiesRequestAllergiesItemSource.DOCTOR) .substance("substance") .verificationStatus(ReplacePatientAllergiesRequestAllergiesItemVerificationStatus.UNCONFIRMED) .reactions( Arrays.asList( ReplacePatientAllergiesRequestAllergiesItemReactionsItem .builder() .display("display") .build() ) ) .type( Nullable.ofNull() ) .build() ) ) .build() );
-
-
-
practiceId:
String
-
patientId:
String
-
idempotencyKey:
String
-
affinityActorId:
Optional<String>— Required for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
-
affinityActorType:
Optional<String>— Use user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
-
allergies:
List<ReplacePatientAllergiesRequestAllergiesItem>
-
reviewStatus:
ReplacePatientAllergiesRequestReviewStatus
-
-
client.practices.listPractices() -> ListPracticesResponse
-
-
-
Returns the practices that belong to the platform. The default Affinity-Version is 2026-09-28.
-
-
-
client.practices().listPractices( ListPracticesRequest .builder() .endingBefore("prac_01j2y8m6jcc9tt24af5pw9x1bc") .startingAfter("prac_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
search:
Optional<String>— Case-insensitive search by practice name or external ID.
-
endingBefore:
Optional<String>
-
limit:
Optional<Integer>
-
startingAfter:
Optional<String>
-
-
client.practices.createPractice(request) -> CreatePracticeResponse
-
-
-
Creates a practice owned by the platform. Set liveEnabled to true to enable Live access at creation with an approved platform and a Live request. Defaults to false. Requires practices:write. Send Idempotency-Key when you retry the same request.
-
-
-
client.practices().createPractice( CreatePracticeRequest .builder() .address( CreatePracticeRequestAddress .builder() .city("Los Angeles") .line1("100 Practice Way") .postalCode("90001") .state("CA") .country("US") .build() ) .attestations( CreatePracticeRequestAttestations .builder() .authorizedPracticeRelationship(true) .authorizedPhiTransfer(true) .minimumNecessaryPhi(true) .providerDataAccuracy(true) .build() ) .name("Example Medical Group") .externalId("practice_123") .legalName("Example Medical Group PLLC") .metadata( new HashMap<String, Object>() {{ put("key", "value"); }} ) .prescribers( Optional.of( Arrays.asList( CreatePracticeRequestPrescribersItem .builder() .name("Alex Morgan") .npi("1234567893") .credentials("MD") .licenseStates( Arrays.asList("CA") ) .build() ) ) ) .primaryContact( CreatePracticeRequestPrimaryContact .builder() .email("operations@example-practice.com") .name("Jordan Lee") .build() ) .supportEmail("support@example-practice.com") .build() );
-
-
-
idempotencyKey:
Optional<String>
-
liveEnabled:
Optional<Boolean>— Enable Live access at creation. Requires an approved platform and a Live request. Defaults to false.
-
address:
CreatePracticeRequestAddress
-
attestations:
CreatePracticeRequestAttestations
-
complianceContact:
Optional<CreatePracticeRequestComplianceContact>
-
externalId:
Optional<String>
-
legalName:
Optional<String>
-
metadata:
Optional<Map<String, Object>>
-
name:
String
-
prescribers:
Optional<List<CreatePracticeRequestPrescribersItem>>
-
primaryContact:
Optional<CreatePracticeRequestPrimaryContact>
-
supportEmail:
Optional<String>
-
supportPhone:
Optional<String>
-
timezone:
Optional<String>— Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record.
-
-
client.practices.getPractice(practiceId) -> GetPracticeResponse
-
-
-
Returns one practice that belongs to the platform.
-
-
-
client.practices().getPractice( "prac_01j2y8m6jcc9tt24af5pw9x1bc", GetPracticeRequest .builder() .build() );
-
-
-
practiceId:
String
-
-
client.practices.updatePractice(practiceId, request) -> UpdatePracticeResponse
-
-
-
Updates one practice owned by the platform. Set liveEnabled to true or false to control Live access with an approved platform and a Live request. Affinity Admin decisions take precedence. Requires practices:write. Send Idempotency-Key when you retry the same request.
-
-
-
client.practices().updatePractice( "prac_01j2y8m6jcc9tt24af5pw9x1bc", UpdatePracticeRequest .builder() .build() );
-
-
-
practiceId:
String
-
idempotencyKey:
Optional<String>
-
liveEnabled:
Optional<Boolean>— Enable or disable Live access for an owned practice. Requires an approved platform and a Live request. Affinity Admin decisions take precedence.
-
address:
Optional<UpdatePracticeRequestAddress>
-
attestations:
Optional<UpdatePracticeRequestAttestations>
-
complianceContact:
Optional<UpdatePracticeRequestComplianceContact>
-
externalId:
Optional<String>
-
legalName:
Optional<String>
-
metadata:
Optional<Map<String, Object>>
-
name:
Optional<String>
-
prescribers:
Optional<List<UpdatePracticeRequestPrescribersItem>>
-
primaryContact:
Optional<UpdatePracticeRequestPrimaryContact>
-
supportEmail:
Optional<String>
-
supportPhone:
Optional<String>
-
timezone:
Optional<String>— Optional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record.
-
-
client.platformPricing.platformPublicApiSellingPricesReadSellingPrice(catalogItemId) -> PlatformPublicApiSellingPricesReadSellingPriceResponse
-
-
-
Requires selling_prices:read. Omit practiceId for the platform default, or supply a managed practice. A null amount inherits the next applicable price. Amounts use the catalog pricing basis, in USD cents. purchaseAmountCents is the platform's Affinity purchase price for that same basis. requiresReview indicates changed product pricing terms, not a below-purchase-price discount.
-
-
-
client.platformPricing().platformPublicApiSellingPricesReadSellingPrice( "cat_01j2y8m6jcc9tt24af5pw9x1bc", PlatformPublicApiSellingPricesReadSellingPriceRequest .builder() .practiceId("prac_01j2y8m6jcc9tt24af5pw9x1bc") .build() );
-
-
-
catalogItemId:
String
-
practiceId:
Optional<String>
-
-
client.platformPricing.platformPublicApiSellingPricesUpdateSellingPrice(catalogItemId, request) -> PlatformPublicApiSellingPricesUpdateSellingPriceResponse
-
-
-
Requires selling_prices:write. Sets a platform default or managed practice override in the current Test/Live mode. Send baseVersion from Read selling price. Null removes the override. Prices use the catalog pricing basis. Intentional discounts below purchaseAmountCents are allowed; compare these amounts to warn about selling below your Affinity purchase price. This does not change the platform's Affinity purchase price or collect practice payments.
-
-
-
client.platformPricing().platformPublicApiSellingPricesUpdateSellingPrice( "cat_01j2y8m6jcc9tt24af5pw9x1bc", PlatformPublicApiSellingPricesUpdateSellingPriceRequest .builder() .idempotencyKey("Idempotency-Key") .baseVersion(1) .build() );
-
-
-
catalogItemId:
String
-
idempotencyKey:
String
-
practiceId:
Optional<String>
-
amountCents:
Optional<Integer>
-
baseVersion:
Integer
-
-