> ## Documentation Index
> Fetch the complete documentation index at: https://api.vitarelay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycle windows

> Scope `customers:read`. Days since a customer's last order for reorder due, lapsed and partner dormant.



## OpenAPI

````yaml /pharmacy-api/customers-openapi.yaml get /customers/settings
openapi: 3.1.0
info:
  title: Pharmacy Customers API
  version: 1.0.0
  description: >
    Connect your CRM (GoHighLevel and similar) to your pharmacy's customers:
    send a provider when your CRM marks it as converted,

    get webhooks when its orders ship or deliver and when it needs a reorder,
    has lapsed or (for a partner rep) has gone

    dormant, and export your providers.


    **Authentication.** `Authorization: Bearer vr_live_...`. A key belongs to
    your pharmacy and carries `customers:read`

    and/or `customers:write` (create it under **Settings → API keys**). Test
    keys (`vr_test_...`) can read; their writes are

    acknowledged with `sandbox: true` and change nothing. Your pharmacy must
    have customers enabled.


    **Ids.** A customer's `id` is its VitaRelay organization id. `external_id`
    is your CRM's own id for the provider (the

    GoHighLevel contact id); sending the same `external_id` again updates the
    provider and never creates a second one.


    **Webhooks.** Subscribe with `POST /customers/webhooks`. Each request is
    signed:

    `X-Webhook-Signature: sha256=<hex HMAC-SHA256 of the exact request body,
    keyed with your endpoint secret>`, with

    `X-Webhook-Event`, `X-Webhook-Delivery` and `X-Webhook-Timestamp` headers.
    Delivery is at least once with exponential

    backoff for about a day; deduplicate on `X-Webhook-Delivery`. Events:
    `order.shipped`, `order.delivered`,

    `order.cancelled`, `customer.reorder_due`, `customer.lapsed`,
    `partner.dormant`. Use `POST /customers/webhooks/ping`

    to send yourself a test event.


    **Lifecycle windows** are days since a customer's last order (reorder due
    30, lapsed 60, partner dormant 90 by default;

    change them with `PUT /customers/settings`). Each event fires once per last
    order. Connecting a CRM does not send events

    for customers that are already past a window: read their `lifecycle_status`
    from `GET /customers`.
servers:
  - url: https://vitarelay.com/api/public/v1
    description: Production
security:
  - bearer: []
paths:
  /customers/settings:
    get:
      summary: Lifecycle windows
      description: >-
        Scope `customers:read`. Days since a customer's last order for reorder
        due, lapsed and partner dormant.
      responses:
        '200':
          description: The windows
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.