Lifecycle Processor

Use to unblock your testing in the development environment!

Approve Prescription

Endpoint: /approvePrescription

Simulates a practitioner approving prescription(s) on an order.

Requirements:

  • Order must be in "Requires Provider Review" status

Behavior:

  • Based on configuration settings, the order will either:
    • Transition to "Requires Order Processing" status, OR
    • Be sent to the pharmacy (mocked in development) and then transition to "Completed" status
  • Applies a refill count to every prescription on the order, so the order can reach a refill state.

Request Body (optional):

{
  "refillsAllowed": 3
}
  • refillsAllowed — number of refills to grant on approval.
    • If omitted, an existing refill count already set on the prescription (e.g. from a prior manual update) is preserved.
    • If none is set, defaults to the prescription's suggested refill count (based on the product's configured refill count), or 0 if that isn't configured either.

Example:

POST {telegra.url}/orders/<order-id>/actions/lifecycleProcessor/approvePrescription?access_token={{ias.affiliate.accessToken}}
{
  "refillsAllowed": 3
}

Reaching and verifying a refill state:

To exercise a refill state, call /approvePrescription (with or without refillsAllowed, as above) on an order in "Requires Provider Review" status, then check the result with:

GET {telegra.url}/patients/<patient-id>/actions/getPrescriptions?access_token={{ias.affiliate.accessToken}}

Which field holds the refill count depends on the project's refill management:

  • refillsAllowed — used when the project is Telegra-managed (refillManager: telegra)
  • refillsAllocatedToPharmacy — used when the project is pharmacy-managed (refillManager: pharmacy, the default)

Note: prescriptionComplete is not set anywhere in the system and always reads false. Do not rely on it to detect a completed or refill state — use the fields above instead.


Get Order Creation Payload

Endpoint: /getOrderCreationPayload

Generates the complete payload needed to create an order via the API.

Requirements:

  • Choose an order that is already submitted

Behavior:

  • Returns all the data required to hit the /Create Order + Patient + Questionnaires endpoint
  • Useful for replicating or testing order creation flows

Example:

POST {telegra.url}/orders/<order-id>/actions/lifecycleProcessor/getOrderCreationPayload?access_token={{ias.affiliate.accessToken}}

Trigger Webhook Event

Endpoint: /triggerWebhook

Simulates a specific webhook event being triggered for an order to test webhook integrations.

Requirements:

  • Configure the webhook endpoint in the affiliate admin portal
  • Request must include a JSON body
  • The webhookId must be configured to listen for the specified eventType

Request Body Structure:

{
  "eventType": "order_submitted",
  "webhookId": "webhook::example_id"
}

Example:

POST {telegra.url}/orders/<order-id>/actions/lifecycleProcessor/triggerWebhook?access_token={{ias.affiliate.accessToken}}

Supported Event Types:

  • affiliate_admin_was_assigned
  • external_questionnaire_instance_synchronization_attempt
  • message-from-admin-practitioner-received
  • message-from-patient-received
  • new_status_set_to_request
  • order_created
  • order_expedited
  • order_payment_collected
  • order_product_variation_transitioned
  • order_submitted
  • order_updated
  • patient_communication_answered_call
  • patient_communication_follow_up_required
  • patient_communication_text_message_sent
  • patient_communication_unanswered_call
  • pharmacy_bundle_fax_sent
  • order_reminder_sent
  • visit_type_overridden
  • visit_type_updated

Did this page help you?